diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 540504f..91564bd 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -1,26 +1,68 @@ # Demographic Functions -Add description here. +The Demographic Snapshot API function enables you to collect demographic details around a point location. For example, you can take the coordinates of a bus stop and find the average population characteristics in that location. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation. -### OBS_GetDemographicSnapshot( Point Geometry ); +## OBS_GetDemographicSnapshot( Point Geometry ); -#### Arguments +<<<<<<<<**PLEASE CONFIRM NAME, SPACING IN THE ACTUAL DATASERVICES API CODE APPEARS DIFFERENTLY FOR THIS FUNCTION?**>>>>>>>> -Name | Type | Description | Accepted values ---- | --- | --- | --- +Fields returned include information about income, education, transportation, race, and more. Not all fields will have information for every coordinate queried. +##### Geographic Scope +The Demographic Snapshot API is available for the following countries: -#### Returns +* United States + +<<<<<<<<**ARE THERE ANY MORE COUNTRIES SUPPORTED? OTHERWISE, I WILL MOVE THIS SECTION AS A NOTE INSTEAD**>>>>>>>> + +### Arguments + +Name | Description | Example Values +--- | --- | --- +account name | The name of your CartoDB account where the Data Observatory has been enabled | `example_account` +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)` + +<<<<<<<<**IS ACCOUNT NAME DIFFERENT THAN THE USERNAME FROM THEIR ACCOUNT SETTINGS?**>>>>>>>> + +### 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. + +[Click to expand](https://gist.github.com/ohasselblad/c9e59a6e8da35728d0d81dfed131ed17) + +<<<<<<<<**HOW DO YOU WANT TO DISPLAY THIS INTERNAL CONTENT?**>>>>>>>> Name | Type | Description --- | --- | --- +[https://docs.google.com/spreadsheets/d/1U3Uajw_PsIy3_YgeujnJ7AiL2VREdT-ozdaulx07q2g/edit#gid=430723120](https://docs.google.com/spreadsheets/d/1U3Uajw_PsIy3_YgeujnJ7AiL2VREdT-ozdaulx07q2g/edit#gid=430723120) -#### Examples +<<<<<<<<**IS THIS THE SAME AS THE MEASURES_TABLE OPTIONS IN THE OBSERVATORY-EXTENSION GLOSSARY docs, OR SOMETHING DIFFERENT?**>>>>>>>> -##### Name of Example +### Examples -```bash -code +<<<<<<<<**THESE SHOULD BE WORKABLE EXAMPLES, WHY AREN'T WE USING {username}, LIKE OTHER API EXAMPLES?**>>>>>>>> + +```html +https://{{account name}}.cartodb.com/api/v2/sql?q=SELECT * FROM +OBS_GetDemographicSnapshot({{point geometry}}) +``` + +##### Get the Geographic Snapshot of a Demographic + +__Get the Demographic Snapshot at Camp David__ + + +```text +https://example_account.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__ + + +```text +https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960)) ``` diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index fdceb1f..8f90d9a 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -1,26 +1,62 @@ # Segmentation Functions -Add description here. +The Segmentation Snapshot API function enables you to determine the pre-calculated population segment for a location. For example, you can take the location of a store location and determine what classification of population exists around that location. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation. -### OBS_GetSegmentationSnapshot( Point Geometry ); +_**Note:** Segmentation is a method that divides a target market into subgroups based on shared common traits. Currently, CartoDB includes the segmentation profile defined in the Output Data: US_tract_clusters_new_, as detailed in the _[Understanding America's Neighborhoods Using Uncertain Data from the American Community Survey](http://www.tandfonline.com/doi/pdf/10.1080/00045608.2015.1052335) contextual approach. Subsequent releases will include additional segmentation profiles._ -#### Arguments +## OBS_GetSegmentationSnapshot( Point Geometry ); -Name | Type | Description | Accepted values +<<<<<<<<**PLEASE CONFIRM NAME, SPACING IN THE ACTUAL DATASERVICES API CODE APPEARS DIFFERENTLY FOR THIS FUNCTION?**>>>>>>>> + +##### Geographic Scope + +The Segmentation Snapshot API is available for the following countries: + +* United States + +<<<<<<<<**ARE THERE ANY MORE COUNTRIES SUPPORTED? OTHERWISE, I WILL MOVE THIS SECTION AS A NOTE INSTEAD**>>>>>>>> + +### Arguments + +Name | Type | Description | Example Values --- | --- | --- | --- +account name | The name of your CartoDB account where the Data Observatory has been enabled | `example_account` +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)` +<<<<<<<<**IS ACCOUNT NAME DIFFERENT THAN THE USERNAME FROM THEIR ACCOUNT SETTINGS?**>>>>>>>> +### Returns -#### Returns +__todo__ Name | Type | Description --- | --- | --- +__todo__ -#### Examples +### Examples -##### Name of Example +<<<<<<<<**THESE SHOULD BE WORKABLE EXAMPLES, WHY AREN'T WE USING {username}, LIKE OTHER API EXAMPLES?**>>>>>>>> -```bash -code +```html +https://{{account name}}.cartodb.com/api/v2/sql?q=SELECT * FROM +OBS_GetSegmentationSnapshot({{point geometry}}) +``` + +##### Get the Geographic Snapshot of a Segmentation + +__Get the Segmentation Snapshot around the MGM Grand__ + + +```text +https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516)) +``` + +__Get the Segmentation Snapshot at CartoDB's NYC HQ__ + + +```text +https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +OBS_GetSegmentationSnapshot(CDB_LatLng(40.704512, -73.936669)) ```