fixed some spelling errors and code examples, wordsmithed segmentation level descriptions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Demographic Functions
|
||||
|
||||
The Demographic Snapshot enables you to collect demographic report around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics such as total population, educational attainment, housing and income information around that location. You can use raw street addresses by combining the Demographic Snapshot with CartoDB's geocoding features. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation.
|
||||
The Demographic Snapshot enables you to collect demographic reports around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics, such as total population, educational attainment, housing and income information around that location. You can use raw street addresses by combining the Demographic Snapshot with CartoDB's geocoding features. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation.
|
||||
|
||||
_**Note:** The Demographic Snapshot functions are only available for the United States._
|
||||
|
||||
@@ -17,9 +17,7 @@ point geometry | A WKB point geometry. You can use the helper function, `CDB_Lat
|
||||
|
||||
### Returns
|
||||
|
||||
The Demographic Snapshot contains a broad subset of demographic measures in the Data Observatory. Over 80 measurements are returned by a single API request.
|
||||
|
||||
For each demographic measure the API will return
|
||||
The Demographic Snapshot contains a broad subset of demographic measures in the Data Observatory. Over 80 measurements are returned by a single API request. For each demographic measure, the API returns the following values.
|
||||
|
||||
Value | Name | Tablename | Aggregate | Type | Description
|
||||
----- | ---- | --------- | --------- | ---- |------------
|
||||
@@ -38,7 +36,7 @@ obs_getdemographicsnapshot: {
|
||||
}
|
||||
```
|
||||
|
||||
**For details, see [Glossary of Demographic Measures](#glossary-of-demographic-measures) below.**
|
||||
**For details, see the [Glossary of Demographic Measures](#glossary-of-demographic-measures).**
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -51,15 +49,13 @@ OBS_GetDemographicSnapshot({{point geometry}})
|
||||
|
||||
__Get the Demographic Snapshot at Camp David__
|
||||
|
||||
|
||||
```text
|
||||
```bash
|
||||
https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
||||
OBS_GetDemographicSnapshot(CDB_LatLng(39.648333, -77.465))
|
||||
```
|
||||
|
||||
__Get the Demographic Snapshot in the Upper West Side__
|
||||
|
||||
|
||||
```bash
|
||||
https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
||||
OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960))
|
||||
@@ -67,7 +63,7 @@ OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960))
|
||||
|
||||
## Glossary of Demographic Measures
|
||||
|
||||
This list contains the demographic measures and reponse names for results from the ```OBS_GetDemographicSnapshot``` function.
|
||||
This list contains the demographic measures and response names for results from the ```OBS_GetDemographicSnapshot``` function.
|
||||
|
||||
Measure name | Measure Description | Response Mame | Response Units
|
||||
--- | --- | --- | ---
|
||||
|
||||
@@ -10,12 +10,17 @@ _**Note:** The Segmentation Snapshot functions are only available for the United
|
||||
|
||||
Name | Type | Description | Example Values
|
||||
--- | --- | --- | ---
|
||||
username | The username of your CartoDB account where the Data Observatory has been enabled | `example_account`
|
||||
username | The username of your CartoDB account where the Data Observatory has been enabled | `username`
|
||||
point geometry | A WKB point geometry. You can use the helper function, `CDB_LatLng` to quickly generate one from latitude and longitude | `CDB_LatLng(40.760410,-73.964242)`
|
||||
|
||||
### Returns
|
||||
|
||||
The segmentation function returns two segment names for the point you requests, the x10\_segment and x55\_segment. These describe the population at that point at a high level x10, and a sublevel which is more sepecific x55. The function also returns the quantile of a number of census varaibles. So for example if total_poulation is at 90% quantile level then this tract has a higher total population than 90% of the other tracts. An exmple response looks like this:
|
||||
The segmentation function returns two segment levels for the point you requests, the x10\_segment and x55\_segment. These segmentation levels contain different classifications of population within with each segment:
|
||||
|
||||
- x10\_segments contain populations at high-levels, broken down into 10 broad categories
|
||||
- x55\_segments contain more granular sub-levels to categorize the population
|
||||
|
||||
The function also returns the quantile of a number of census variables. For example, if total_poulation is at 90% quantile level then this tract has a higher total population than 90% of the other tracts. An example response appears as follows:
|
||||
|
||||
```json
|
||||
obs_getsegmentsnapshot: {
|
||||
@@ -67,14 +72,13 @@ obs_getsegmentsnapshot: {
|
||||
"us.census.acs.B25075025_quantile": "0.891702702702703"
|
||||
}
|
||||
```
|
||||
__todo__
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
x10\_segment | text | The demographic segment this location belongs at the 10 segment level
|
||||
x55\_segment | text | The demographic segment this location belongs at the 55 segment level
|
||||
|
||||
The possible segments are
|
||||
The possible segments are:
|
||||
|
||||
<table>
|
||||
<tr><th> X10 segment</th> <th> X55 Segment </th></tr>
|
||||
@@ -149,7 +153,7 @@ The possible segments are
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
||||
https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM
|
||||
OBS_GetSegmentSnapshot({{point geometry}})
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user