From 9b48a4756b58c72f2b0f2dacebb9202e40d66db6 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 25 Apr 2016 13:25:27 -0400 Subject: [PATCH 01/18] adding placeholder for obs functions-WIP --- doc/API.md | 4 +++- doc/demographic_functions.md | 26 ++++++++++++++++++++++++++ doc/segmentation_functions.md | 26 ++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 doc/demographic_functions.md create mode 100644 doc/segmentation_functions.md diff --git a/doc/API.md b/doc/API.md index 0442075..9e3b92d 100644 --- a/doc/API.md +++ b/doc/API.md @@ -8,4 +8,6 @@ The CartoDB Data Services API offers a set of location based services that can b * [Geocoding Functions](geocoding_functions.md) * [Isoline Functions](isoline_functions.md) * [Routing Functions](routing_functions.md) -* [Quota Information](quota_information.md) +* [Demographic Functions](demographic_functions.md) +* [Segmentation Functions](segmentation_functions.md) +* [Quota Information](quota_information.md) \ No newline at end of file diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md new file mode 100644 index 0000000..540504f --- /dev/null +++ b/doc/demographic_functions.md @@ -0,0 +1,26 @@ +# Demographic Functions + +Add description here. + +### OBS_GetDemographicSnapshot( Point Geometry ); + +#### Arguments + +Name | Type | Description | Accepted values +--- | --- | --- | --- + + + +#### Returns + +Name | Type | Description +--- | --- | --- + + +#### Examples + +##### Name of Example + +```bash +code +``` diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md new file mode 100644 index 0000000..fdceb1f --- /dev/null +++ b/doc/segmentation_functions.md @@ -0,0 +1,26 @@ +# Segmentation Functions + +Add description here. + +### OBS_GetSegmentationSnapshot( Point Geometry ); + +#### Arguments + +Name | Type | Description | Accepted values +--- | --- | --- | --- + + + +#### Returns + +Name | Type | Description +--- | --- | --- + + +#### Examples + +##### Name of Example + +```bash +code +``` From b6cf319ed575b6a503be6a6a5d6833757891b6f2 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 2 May 2016 09:15:48 -0400 Subject: [PATCH 02/18] added demo & segment docs from obs-ext source file --- doc/demographic_functions.md | 62 +++++++++++++++++++++++++++++------ doc/segmentation_functions.md | 54 +++++++++++++++++++++++++----- 2 files changed, 97 insertions(+), 19 deletions(-) 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)) ``` From 2628a73a3f9dbccf2c828f353ac9ed7070ac1ee5 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 2 May 2016 10:25:59 -0400 Subject: [PATCH 03/18] applied username for consitency, updated notes about availability-WIP --- doc/demographic_functions.md | 20 ++++++-------------- doc/segmentation_functions.md | 24 ++++++------------------ 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 91564bd..34dbc57 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -2,29 +2,21 @@ 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. +_**Note:** The Demographic Snapshot API is currently only available for the United States._ + ## OBS_GetDemographicSnapshot( Point Geometry ); <<<<<<<<**PLEASE CONFIRM NAME, SPACING IN THE ACTUAL DATASERVICES API CODE APPEARS DIFFERENTLY FOR THIS FUNCTION?**>>>>>>>> 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: - -* 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` +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)` -<<<<<<<<**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. @@ -45,7 +37,7 @@ Name | Type | Description <<<<<<<<**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 +https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetDemographicSnapshot({{point geometry}}) ``` @@ -55,7 +47,7 @@ __Get the Demographic Snapshot at Camp David__ ```text -https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetDemographicSnapshot(CDB_LatLng(39.648333, -77.465)) ``` @@ -63,6 +55,6 @@ __Get the Demographic Snapshot in the Upper West Side__ ```text -https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +https://{username}.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 8f90d9a..6d73d39 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -1,30 +1,20 @@ # Segmentation Functions -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. +The Segmentation Snapshot API function enables you to determine the pre-calculated population segment for a location. Segmentation is a method that divides a target market into subgroups based on shared common traits. 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. -_**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._ +_**Note:** The Segmentation Snapshot API is currently only available for the United States. 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._ ## OBS_GetSegmentationSnapshot( Point Geometry ); <<<<<<<<**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` +username | The username 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 __todo__ @@ -36,10 +26,8 @@ __todo__ ### Examples -<<<<<<<<**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 +https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot({{point geometry}}) ``` @@ -49,7 +37,7 @@ __Get the Segmentation Snapshot around the MGM Grand__ ```text -https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516)) ``` @@ -57,6 +45,6 @@ __Get the Segmentation Snapshot at CartoDB's NYC HQ__ ```text -https://example_account.cartodb.com/api/v2/sql?q=SELECT * FROM +https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot(CDB_LatLng(40.704512, -73.936669)) ``` From 6017944db15b0f8a252d0a5c177c1998f82b4a77 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 2 May 2016 11:39:02 -0400 Subject: [PATCH 04/18] added markdown table for demographic measures --- doc/demographic_functions.md | 110 ++++++++++++++++++++++++++++++----- 1 file changed, 96 insertions(+), 14 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 34dbc57..20f93f1 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -19,23 +19,10 @@ 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. - -[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) - -<<<<<<<<**IS THIS THE SAME AS THE MEASURES_TABLE OPTIONS IN THE OBSERVATORY-EXTENSION GLOSSARY docs, OR SOMETHING DIFFERENT?**>>>>>>>> +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 details, see [Glossary of Demographic Measures](#glossary-of-demographic-measures). ### Examples -<<<<<<<<**THESE SHOULD BE WORKABLE EXAMPLES, WHY AREN'T WE USING {username}, LIKE OTHER API EXAMPLES?**>>>>>>>> - ```html https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetDemographicSnapshot({{point geometry}}) @@ -56,5 +43,100 @@ __Get the Demographic Snapshot in the Upper West Side__ ```text https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM + 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. + + Measure name | Measure Description | Response Mame | Response Units +-------------- |---------------------- |----------------- |------------------ +Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates. | total_pop | Count per sq. km +Male Population | The number of people within each geography who are male. | male_pop | Count per sq. km +Female Population | The number of people within each geography who are female.| female_pop | Count per sq. km +Population not Hispanic | The number of people not identifying as Hispanic or Latino in each geography. | not_hispanic_pop | Count per sq. km +White Population | The number of people identifying as white, non-Hispanic in each geography. | white_pop | Count per sq. km +Black or African American Population| The number of people identifying as black or African American, non-Hispanic in each geography. | black_pop | Count per sq. km +American Indian and Alaska Native Population | The number of people identifying as American Indian or Alaska native in each geography.| amerindian_pop| Count per sq. km +Asian Population | The number of people identifying as Asian, non-Hispanic in each geography.| asian_pop | Count per sq. km +Other Race population | The number of people identifying as another race in each geography. | other_race_pop | Count per sq. km +Two or more races population| The number of people identifying as two or more races in each geography | two_or_more_races_pop | Count per sq. km +Hispanic Population | The number of people identifying as Hispanic or Latino in each geography. | hispanic_pop | Count per sq. km +Not a U.S. Citizen Population | The number of people within each geography who indicated that they are not U.S. citizens. | not_us_citizen_pop | Count per sq. km +Median Age | The median age of all people in a given geographic area.| median_age | Years +Children under 18 Years of Age | The number of people within each geography who are under 18 years of age.| children | Count per sq. km +Population 15 Years and Over | The number of people in a geographic area who are over the age of 15. This is used mostly as a denominator of marital status. | pop_15_and_over | Count per sq. km +Population 3 Years and Over | The total number of people in each geography age 3 years and over. This denominator is mostly used to calculate rates of school enrollment. | population_3_years_over | Count per sq. km +Population 5 Years and Over | The number of people in a geographic area who are over the age of 5. This is primarily used as a denominator of measures of language spoken at home.| pop_5_years_over | Count per sq. km +Workers over the Age of 16 | The number of people in each geography who work. Workers include those employed at private for-profit companies, the self-employed, government workers and non-profit employees. | workers_16_and_over | Count per sq. km +Workers age 16 and over who do not work from home| The number of workers over the age of 16 who do not work from home in a geographic area| commuters_16_over | Count per sq. km +Commuters by Car, Truck, or Van | The number of workers age 16 years and over within a geographic area who primarily traveled to work by car, truck or van. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. | commuters_by_car_truck_van | Count per sq. km +Commuters who drove alone | The number of workers age 16 years and over within a geographic area who primarily traveled by car driving alone. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. | commuters_drove_alone | Count per sq. km +Commuters by Carpool| The number of workers age 16 years and over within a geographic area who primarily traveled to work by carpool. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. | commuters_by_carpool | Count per sq. km +Commuters by Public Transportation | The number of workers age 16 years and over within a geographic area who primarily traveled to work by public transportation. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. | commuters_by_public_transportation | Count per sq. km | +Commuters by Bus | The number of workers age 16 years and over within a geographic area who primarily traveled to work by bus. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport. | commuters_by_bus| Count per sq. km +Commuters by Subway or Elevated | The number of workers age 16 years and over within a geographic area who primarily traveled to work by subway or elevated train. This is the principal mode of travel or type of conveyance, by distance rather than time, that the worker usually used to get from home to work. This is a subset of workers who commuted by public transport. | commuters_by_subway_or_elevated | Count per sq. km +Walked to Work | The number of workers age 16 years and over within a geographic area who primarily walked to work. This would mean that of any way of getting to work, they travelled the most distance walking. | walked_to_work | Count per sq. km +Worked at Home | The count within a geographical area of workers over the age of 16 who worked at home. | worked_at_home | Count per sq. km +Number of workers with less than 10 minute commute | The number of workers over the age of 16 who do not work from home and commute in less than 10 minutes in a geographic area. | commute_less_10_mins | Count per sq. km +Number of workers with a commute between 10 and 14 minutes| The number of workers over the age of 16 who do not work from home and commute in between 10 and 14 minutes in a geographic area. | commute_10_14_mins | Count per sq. km +Number of workers with a commute between 15 and 19 minutes | The number of workers over the age of 16 who do not work from home and commute in between 15 and 19 minutes in a geographic area. | commute_15_19_mins | Count per sq. km +Number of workers with a commute between 20 and 24 minutes | The number of workers over the age of 16 who do not work from home and commute in between 20 and 24 minutes in a geographic area. | commute_20_24_mins | Count per sq. km +Number of workers with a commute between 25 and 29 minutes | The number of workers over the age of 16 who do not work from home and commute in between 25 and 29 minutes in a geographic area. | commute_25_29_mins| Count per sq. km +Number of workers with a commute between 30 and 34 minutes | The number of workers over the age of 16 who do not work from home and commute in between 30 and 34 minutes in a geographic area. | commute_30_34_mins | Count per sq. km +Number of workers with a commute between 35 and 44 minutes | The number of workers over the age of 16 who do not work from home and commute in between 35 and 44 minutes in a geographic area. | commute_35_44_mins | Count per sq. km +Number of workers with a commute between 45 and 59 minutes | The number of workers over the age of 16 who do not work from home and commute in between 45 and 59 minutes in a geographic area. | commute_45_59_mins | Count per sq. km +Number of workers with a commute of over 60 minutes | The number of workers over the age of 16 who do not work from home and commute in over 60 minutes in a geographic area.| commute_60_more_mins | Count per sq. km +Aggregate travel time to work | The total number of minutes every worker over the age of 16 who did not work from home spent spent commuting to work in one day in a geographic area. | aggregate_travel_time_to_work | Minutes +Households | A count of the number of households in each geography. A household consists of one or more people who live in the same dwelling and also share at meals or living accommodation, and may consist of a single family or some other grouping of people. | households | Count per sq. km +Never Married | The number of people in a geographic area who have never been married. | pop_never_married | Count per sq. km +Currently married| The number of people in a geographic area who are currently married. | pop_now_married | Count per sq. km +Married but separated | The number of people in a geographic area who are married but separated.| pop_separated | Count per sq. km +Widowed | The number of people in a geographic area who are widowed.| pop_widowed | Count per sq. km +Divorced | The number of people in a geographic area who are divorced. | pop_divorced | Count per sq. km +Students Enrolled in School | The total number of people in each geography currently enrolled at any level of school, from nursery or pre-school to advanced post-graduate education. Only includes those over the age of 3. | in_school | Count per sq. km +Students Enrolled in Grades 1 to 4 | The total number of people in each geography currently enrolled in grades 1 through 4 inclusive. This corresponds roughly to elementary school. | in_grades_1_to_4 | Count per sq. km +Students Enrolled in Grades 5 to 8 | The total number of people in each geography currently enrolled in grades 5 through 8 inclusive. This corresponds roughly to middle school. | in_grades_5_to_8 | Count per sq. km +Students Enrolled in Grades 9 to 12 | The total number of people in each geography currently enrolled in grades 9 through 12 inclusive. This corresponds roughly to high school. | in_grades_9_to_12 | Count per sq. km +Students Enrolled as Undergraduate in College | The number of people in a geographic area who are enrolled in college at the undergraduate level. Enrollment refers to being registered or listed as a student in an educational program leading to a college degree. This may be a public school or college, a private school or college. | in_undergrad_college | Count per sq. km +Population 25 Years and Over | The number of people in a geographic area who are over the age of 25. This is used mostly as a denominator of educational attainment. | pop_25_years_over | Count per sq. km +Population Completed High School | The number of people in a geographic area over the age of 25 who completed high school, and did not complete a more advanced degree. | high_school_diploma| Count per sq. km +Population completed less than one year of college, no degree | The number of people in a geographic area over the age of 25 who attended college for less than one year and no further. | less_one_year_college | Count per sq. km +Population completed more than one year of college, no degree | The number of people in a geographic area over the age of 25 who attended college for more than one year but did not obtain a degree. | one_year_more_college | Count per sq. km +Population Completed Associate's Degree | The number of people in a geographic area over the age of 25 who obtained a associate's degree, and did not complete a more advanced degree.| associates_degree | Count per sq. km +Population Completed Bachelor's Degree| The number of people in a geographic area over the age of 25 who obtained a bachelor's degree, and did not complete a more advanced degree. | bachelors_degree| Count per sq. km +Population Completed Master's Degree | The number of people in a geographic area over the age of 25 who obtained a master's degree, but did not complete a more advanced degree. | masters_degree | Count per sq. km +Speaks only English at Home | The number of people in a geographic area over age 5 who speak only English at home. | speak_only_english_at_home | Count per sq. km +Speaks Spanish at Home | The number of people in a geographic area over age 5 who speak Spanish at home, possibly in addition to other languages. | speak_spanish_at_home | Count per sq. km +Population for Whom Poverty Status Determined | The number of people in each geography who could be identified as either living in poverty or not. This should be used as the denominator when calculating poverty rates, as it excludes people for whom it was not possible to determine poverty. | pop_determined_poverty_status | Count per sq. km +Income In The Past 12 Months Below Poverty Level | The number of people in a geographic area who are part of a family (which could be just them as an individual) determined to be "in poverty" following the [Office of Management and Budget's Directive 14](https://www.census.gov/hhes/povmeas/methodology/ombdir14.html). | poverty | Count per sq. km +Households with income less than $10,000 | The number of households in a geographic area whose annual income was less than $10,000. | income_less_10000 | Count per sq. km +Households with income of $10,000 to $14,999 | The number of households in a geographic area whose annual income was between $10,000 and $14,999. | income_10000_14999 | Count per sq. km +Households with income of $15,000 to $19,999 | The number of households in a geographic area whose annual income was between $15,000 and $19,999. | income_15000_19999 | Count per sq. km +Households with income of $20,000 To $24,999 | The number of households in a geographic area whose annual income was between $20,000 and $24,999. | income_20000_24999 | Count per sq. km +Households with income of $25,000 To $29,999 | The number of households in a geographic area whose annual income was between $20,000 and $24,999. | income_25000_29999 | Count per sq. km +Households with income of $30,000 To $34,999 | The number of households in a geographic area whose annual income was between $30,000 and $34,999. | income_30000_34999 | Count per sq. km +Households with income of $35,000 To $39,999 | The number of households in a geographic area whose annual income was between $35,000 and $39,999. | income_35000_39999 | Count per sq. km +Households with income of $40,000 To $44,999 | The number of households in a geographic area whose annual income was between $40,000 and $44,999. | income_40000_44999| Count per sq. km +Households with income of $45,000 To $49,999 | The number of households in a geographic area whose annual income was between $45,000 and $49,999. | income_45000_49999 | Count per sq. km +Households with income of $50,000 To $59,999 | The number of households in a geographic area whose annual income was between $50,000 and $59,999. | income_50000_59999 | Count per sq. km +Households with income of $60,000 To $74,999 | The number of households in a geographic area whose annual income was between $60,000 and $74,999. | income_60000_74999 | Count per sq. km +Households with income of $75,000 To $99,999 | The number of households in a geographic area whose annual income was between $75,000 and $99,999. | income_75000_99999 | Count per sq. km +Households with income of $100,000 To $124,999 | The number of households in a geographic area whose annual income was between $100,000 and $124,999. | income_100000_124999 | Count per sq. km +Households with income of $125,000 To $149,999 | The number of households in a geographic area whose annual income was between $125,000 and $149,999. | income_125000_149999 | Count per sq. km +Households with income of $150,000 To $199,999 | The number of households in a geographic area whose annual income was between $150,000 and $1999,999. | income_150000_199999 | Count per sq. km +Households with income of $200,000 Or More | The number of households in a geographic area whose annual income was more than $200,000. | income_200000_or_more | Count per sq. km +Median Household Income in the past 12 Months | Within a geographic area, the median income received by every household on a regular basis before payments for personal income taxes, social security, union dues, medicare deductions, etc. It includes income received from wages, salary, commissions, bonuses, and tips; self-employment income from own nonfarm or farm businesses, including proprietorships and partnerships; interest, dividends, net rental income, royalty income, or income from estates and trusts; Social Security or Railroad Retirement income; Supplemental Security Income (SSI); any cash public assistance or welfare payments from the state or local welfare office; retirement, survivor, or disability benefits; and any other sources of income received regularly such as Veterans' (VA) payments, unemployment and/or worker's compensation, child support, and alimony. | median_income | USD +Per Capita Income in the past 12 Months | | income_per_capita | USD +Gini Index | A measurement of the income distribution of a country's residents. | gini_index | None +Housing Units | A count of housing units in each geography. A housing unit is a house, an apartment, a mobile home or trailer, a group of rooms, or a single room occupied as separate living quarters, or if vacant, intended for occupancy as separate living quarters. | housing_units | Count per sq. km +Vacant Housing Units | The count of vacant housing units in a geographic area. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant. | vacant_housing_units | Count per sq. km +Vacant Housing Units for Rent | The count of vacant housing units in a geographic area that are for rent. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant. | vacant_housing_units_for_rent | Count per sq. km +Vacant Housing Units for Sale| The count of vacant housing units in a geographic area that are for sale. A housing unit is vacant if no one is living in it at the time of enumeration, unless its occupants are only temporarily absent. Units temporarily occupied at the time of enumeration entirely by people who have a usual residence elsewhere are also classified as vacant. | vacant_housing_units_for_sale | Count per sq. km +Owner-occupied Housing Units | The count of owner occupied housing units in a geographic area. | owner_occupied_housing_units | Count per sq. km +Owner-occupied Housing Units valued at $1,000,000 or more. | The count of owner occupied housing units in a geographic area that are valued at $1,000,000 or more. Value is the respondent's estimate of how much the property (house and lot, mobile home and lot, or condominium unit) would sell for if it were for sale. | million_dollar_housing_units | Count per sq. km +Owner-occupied Housing Units with a Mortgage | The count of housing units within a geographic area that are mortagaged. "Mortgage" refers to all forms of debt where the property is pledged as security for repayment of the debt, including deeds of trust, trust deed, contracts to purchase, land contracts, junior mortgages, and home equity loans. | mortgaged_housing_units | Count per sq. km +Median Rent | The median contract rent within a geographic area. The contract rent is the monthly rent agreed to or contracted for, regardless of any furnishings, utilities, fees, meals, or services that may be included. For vacant units, it is the monthly rent asked for the rental unit at the time of interview.| median_rent | USD +Percent of Household Income Spent on Rent | Within a geographic area, the median percentage of household income which was spent on gross rent. Gross rent is the amount of the contract rent plus the estimated average monthly cost of utilities (electricity, gas, water, sewer etc.) and fuels (oil, coal, wood, etc.) if these are paid by the renter. Household income is the sum of the income of all people 15 years and older living in the household. | percent_income_spent_on_rent | Percent From 7434b72a203c804999c6f915bb6c88e1dbd4bdd6 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 2 May 2016 12:04:21 -0400 Subject: [PATCH 05/18] Fixed table spacing --- doc/demographic_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 20f93f1..1c5f375 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -52,7 +52,7 @@ OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960)) This list contains the demographic measures and reponse names for results from the ```OBS_GetDemographicSnapshot``` function. Measure name | Measure Description | Response Mame | Response Units --------------- |---------------------- |----------------- |------------------ +--- |--- |--- |--- Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates. | total_pop | Count per sq. km Male Population | The number of people within each geography who are male. | male_pop | Count per sq. km Female Population | The number of people within each geography who are female.| female_pop | Count per sq. km From 7cb89434bc1c6091e039a01dbb3b1c359d5de119 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 2 May 2016 12:14:02 -0400 Subject: [PATCH 06/18] testing table output --- doc/demographic_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 1c5f375..1273fc6 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -52,7 +52,7 @@ OBS_GetDemographicSnapshot(CDB_LatLng(40.80, -73.960)) This list contains the demographic measures and reponse names for results from the ```OBS_GetDemographicSnapshot``` function. Measure name | Measure Description | Response Mame | Response Units ---- |--- |--- |--- +--- | --- | --- | --- Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates. | total_pop | Count per sq. km Male Population | The number of people within each geography who are male. | male_pop | Count per sq. km Female Population | The number of people within each geography who are female.| female_pop | Count per sq. km From df8810f55d88b56bd3943bf5a99d09f54fd6d888 Mon Sep 17 00:00:00 2001 From: "Andrew W. Hill" Date: Tue, 3 May 2016 14:36:05 -0400 Subject: [PATCH 07/18] Update demographic_functions.md --- doc/demographic_functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 1273fc6..dd5644b 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -1,6 +1,6 @@ # Demographic Functions -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. +The Demographic Snapshot API function enables you to collect demographic details around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics around that location. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation. _**Note:** The Demographic Snapshot API is currently only available for the United States._ From 8c6318e25da1b17927f955d142cc502f16086858 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 9 May 2016 08:36:05 -0400 Subject: [PATCH 08/18] removed comments about function signature, changed code to appear correctly in output --- doc/demographic_functions.md | 11 ++++------- doc/segmentation_functions.md | 12 +++++------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index dd5644b..522d216 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -1,13 +1,11 @@ # Demographic Functions -The Demographic Snapshot API function enables you to collect demographic details around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics around that location. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation. +The Demographic Snapshot functions enable you to collect demographic details around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics around that location. If you need help creating coordinates from addresses, see the [Geocoding Functions](/cartodb-platform/dataservices-api/geocoding-functions/) documentation. -_**Note:** The Demographic Snapshot API is currently only available for the United States._ +_**Note:** The Demographic Snapshot functions are only available for the United States._ ## OBS_GetDemographicSnapshot( Point Geometry ); -<<<<<<<<**PLEASE CONFIRM NAME, SPACING IN THE ACTUAL DATASERVICES API CODE APPEARS DIFFERENTLY FOR THIS FUNCTION?**>>>>>>>> - Fields returned include information about income, education, transportation, race, and more. Not all fields will have information for every coordinate queried. ### Arguments @@ -23,7 +21,7 @@ The Demographic Snapshot contains a broad subset of demographic measures in the ### Examples -```html +```bash https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetDemographicSnapshot({{point geometry}}) ``` @@ -41,9 +39,8 @@ OBS_GetDemographicSnapshot(CDB_LatLng(39.648333, -77.465)) __Get the Demographic Snapshot in the Upper West Side__ -```text +```bash https://{username}.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 6d73d39..5960a10 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -1,13 +1,11 @@ # Segmentation Functions -The Segmentation Snapshot API function enables you to determine the pre-calculated population segment for a location. Segmentation is a method that divides a target market into subgroups based on shared common traits. 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. +The Segmentation Snapshot functions enable you to determine the pre-calculated population segment for a location. Segmentation is a method that divides a target market into subgroups based on shared common traits. 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. -_**Note:** The Segmentation Snapshot API is currently only available for the United States. 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._ +_**Note:** The Segmentation Snapshot functions are only available for the United States. 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._ ## OBS_GetSegmentationSnapshot( Point Geometry ); -<<<<<<<<**PLEASE CONFIRM NAME, SPACING IN THE ACTUAL DATASERVICES API CODE APPEARS DIFFERENTLY FOR THIS FUNCTION?**>>>>>>>> - ### Arguments Name | Type | Description | Example Values @@ -26,7 +24,7 @@ __todo__ ### Examples -```html +```bash https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot({{point geometry}}) ``` @@ -36,7 +34,7 @@ OBS_GetSegmentationSnapshot({{point geometry}}) __Get the Segmentation Snapshot around the MGM Grand__ -```text +```bash https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516)) ``` @@ -44,7 +42,7 @@ OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516)) __Get the Segmentation Snapshot at CartoDB's NYC HQ__ -```text +```bash https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetSegmentationSnapshot(CDB_LatLng(40.704512, -73.936669)) ``` From d745ba2ae711e7de96daa8809e43a016a78c0e87 Mon Sep 17 00:00:00 2001 From: andrewxhill Date: Wed, 11 May 2016 09:45:02 -0400 Subject: [PATCH 09/18] first changes --- doc/demographic_functions.md | 12 +++++++----- doc/segmentation_functions.md | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 522d216..22e36a0 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -1,10 +1,10 @@ # Demographic Functions -The Demographic Snapshot functions enable you to collect demographic details around a point location. For example, you can take the coordinates of a coffee shop and find the average population characteristics around that location. 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 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. _**Note:** The Demographic Snapshot functions are only available for the United States._ -## OBS_GetDemographicSnapshot( Point Geometry ); +## OBS_GetDemographicSnapshot( point geometry ); Fields returned include information about income, education, transportation, race, and more. Not all fields will have information for every coordinate queried. @@ -17,7 +17,9 @@ 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 details, see [Glossary of Demographic Measures](#glossary-of-demographic-measures). +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 details, see [Glossary of Demographic Measures](#glossary-of-demographic-measures) below.** ### Examples @@ -50,11 +52,11 @@ This list contains the demographic measures and reponse names for results from t Measure name | Measure Description | Response Mame | Response Units --- | --- | --- | --- -Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates. | total_pop | Count per sq. km +Total Population | The total number of all people living in a given geographic area. This is a very useful catch-all denominator when calculating rates. | total_pop | Count per sq. km Male Population | The number of people within each geography who are male. | male_pop | Count per sq. km Female Population | The number of people within each geography who are female.| female_pop | Count per sq. km Population not Hispanic | The number of people not identifying as Hispanic or Latino in each geography. | not_hispanic_pop | Count per sq. km -White Population | The number of people identifying as white, non-Hispanic in each geography. | white_pop | Count per sq. km +White Population | The number of people identifying as white, non-Hispanic in each geography. | white_pop | Count per sq. km Black or African American Population| The number of people identifying as black or African American, non-Hispanic in each geography. | black_pop | Count per sq. km American Indian and Alaska Native Population | The number of people identifying as American Indian or Alaska native in each geography.| amerindian_pop| Count per sq. km Asian Population | The number of people identifying as Asian, non-Hispanic in each geography.| asian_pop | Count per sq. km diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 5960a10..602fd9f 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -1,8 +1,8 @@ # Segmentation Functions -The Segmentation Snapshot functions enable you to determine the pre-calculated population segment for a location. Segmentation is a method that divides a target market into subgroups based on shared common traits. 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. +The Segmentation Snapshot functions enable you to determine the pre-calculated population segment for a location. Segmentation is a method that divides a populations into subclassifications based on common traits. For example, you can take the 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. -_**Note:** The Segmentation Snapshot functions are only available for the United States. 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._ +_**Note:** The Segmentation Snapshot functions are only available for the United States. Our first release (May 18, 2016) is derived from Census 2010 variables. Our next release will be based on Census 2014 data. For the latest information, see the [Open Segments](https://github.com/CartoDB/open-segments) project repository._ ## OBS_GetSegmentationSnapshot( Point Geometry ); From 1039d1caa8672c1c5b73155d8d7b323974b8ff13 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Fri, 13 May 2016 14:49:47 -0400 Subject: [PATCH 10/18] Update demographic_functions.md Adding in example response and field details --- doc/demographic_functions.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 22e36a0..21a98ed 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -17,7 +17,26 @@ 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. * +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 + +Value | Name | Tablename | Aggregate | Type | Description +----- | ---- | --------- | --------- | ---- |------------ +The value of the measure at the point you requested | The name of the measure | The table it was drawn from | Indicated if the measure is a count or median. | The posgresql type | A description of the measure + +For example the "Female Population" measure returns + +```json +obs_getdemographicsnapshot: { + "value": 32.5395066379175, + "name": "Female Population", + "tablename": "obs_1a098da56badf5f32e336002b0a81708c40d29cd", + "aggregate": "sum", + "type": "Numeric", + "description": "The number of people within each geography who are female." +} +``` **For details, see [Glossary of Demographic Measures](#glossary-of-demographic-measures) below.** From 4f8fc16434904c264656f49cc3be8b9c73cfaa26 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Fri, 13 May 2016 17:00:38 -0400 Subject: [PATCH 11/18] Updating documentation with categories and examples --- doc/segmentation_functions.md | 147 ++++++++++++++++++++++++++++++++-- 1 file changed, 141 insertions(+), 6 deletions(-) diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 602fd9f..4500bef 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -4,7 +4,7 @@ The Segmentation Snapshot functions enable you to determine the pre-calculated p _**Note:** The Segmentation Snapshot functions are only available for the United States. Our first release (May 18, 2016) is derived from Census 2010 variables. Our next release will be based on Census 2014 data. For the latest information, see the [Open Segments](https://github.com/CartoDB/open-segments) project repository._ -## OBS_GetSegmentationSnapshot( Point Geometry ); +## OBS_GetSegmentSnapshot( Point Geometry ); ### Arguments @@ -15,18 +15,153 @@ point geometry | A WKB point geometry. You can use the helper function, `CDB_Lat ### 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: + +```json +obs_getsegmentsnapshot: { + "x10_segment": "Wealthy, urban without Kids", + "x55_segment": "Wealthy city commuters", + "us.census.acs.B01001001_quantile": "0.0180540540540541", + "us.census.acs.B01001002_quantile": "0.0279864864864865", + "us.census.acs.B01001026_quantile": "0.016527027027027", + "us.census.acs.B01002001_quantile": "0.507297297297297", + "us.census.acs.B03002003_quantile": "0.133162162162162", + "us.census.acs.B03002004_quantile": "0.283743243243243", + "us.census.acs.B03002006_quantile": "0.683945945945946", + "us.census.acs.B03002012_quantile": "0.494594594594595", + "us.census.acs.B05001006_quantile": "0.670972972972973", + "us.census.acs.B08006001_quantile": "0.0607567567567568", + "us.census.acs.B08006002_quantile": "0.0684324324324324", + "us.census.acs.B08006008_quantile": "0.565135135135135", + "us.census.acs.B08006009_quantile": "0.638081081081081", + "us.census.acs.B08006011_quantile": "0", + "us.census.acs.B08006015_quantile": "0.900932432432432", + "us.census.acs.B08006017_quantile": "0.186648648648649", + "us.census.acs.B09001001_quantile": "0.0193513513513514", + "us.census.acs.B11001001_quantile": "0.0617972972972973", + "us.census.acs.B14001001_quantile": "0.0179594594594595", + "us.census.acs.B14001002_quantile": "0.0140405405405405", + "us.census.acs.B14001005_quantile": "0", + "us.census.acs.B14001006_quantile": "0", + "us.census.acs.B14001007_quantile": "0", + "us.census.acs.B14001008_quantile": "0.0609054054054054", + "us.census.acs.B15003001_quantile": "0.0314594594594595", + "us.census.acs.B15003017_quantile": "0.0403378378378378", + "us.census.acs.B15003022_quantile": "0.285972972972973", + "us.census.acs.B15003023_quantile": "0.214567567567568", + "us.census.acs.B16001001_quantile": "0.0181621621621622", + "us.census.acs.B16001002_quantile": "0.0463108108108108", + "us.census.acs.B16001003_quantile": "0.540540540540541", + "us.census.acs.B17001001_quantile": "0.0237567567567568", + "us.census.acs.B17001002_quantile": "0.155972972972973", + "us.census.acs.B19013001_quantile": "0.380662162162162", + "us.census.acs.B19083001_quantile": "0.986891891891892", + "us.census.acs.B19301001_quantile": "0.989594594594595", + "us.census.acs.B25001001_quantile": "0.998418918918919", + "us.census.acs.B25002003_quantile": "0.999824324324324", + "us.census.acs.B25004002_quantile": "0.999986486486486", + "us.census.acs.B25004004_quantile": "0.999662162162162", + "us.census.acs.B25058001_quantile": "0.679054054054054", + "us.census.acs.B25071001_quantile": "0.569716216216216", + "us.census.acs.B25075001_quantile": "0.0415", + "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 -__todo__ +The possible segments are + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
X10 segment X55 Segment
Hispanic and kids
Middle Class, Educated, Suburban, Mixed Race
Low Income on Urban Periphery
Suburban, Young and Low-income
low-income, urban, young, unmarried
Low education, mainly suburban
Young, working class and rural
Low-Income with gentrification
Low Income and Diverse
High school education Long Commuters, Black, White Hispanic mix
Rural, Bachelors or college degree, Rent owned mix
Rural,High School Education, Owns property
Young, City based renters in Sparse neighborhoods, Low poverty
LOW INCOME, MINORITY MIX
Predominantly black, high high school attainment, home owners
White and minority mix multilingual, mixed income / education. Married
Hispanic Black mix multilingual, high poverty, renters, uses public transport
Predominantly black renters, rent own mix
MIDDLE INCOME, SINGLE FAMILY HOMES
Lower Middle Income with higher rent burden
Black and mixed community with rent burden
Lower Middle Income with affordable housing
Relatively affordable, satisfied lower middle class
Satisfied Lower Middle Income Higher Rent Costs
Suburban/Rural Satisfied, decently educated lower middle class
Struggling lower middle class with rent burden
Older white home owners, less comfortable financially
Older home owners, more financially comfortable, some diversity
Native American
Younger, poorer,single parent family Native Americans
Older, middle income Native Americans once married and Educated
Old Wealthy, White
Older, mixed race professionals
Works from home, Highly Educated, Super Wealthy
Retired Grandparents
Wealthy and Rural Living
Wealthy, Retired Mountains/Coasts
Wealthy Diverse Suburbanites On the Coasts
Retirement Communitties
Low Income African American
Urban - Inner city
Rural families
Residential institutions, young people
College towns
College town with poverty
University campus wider area
City Outskirt University Campuses
City Center University Campuses
Wealthy Nuclear Families
Lower educational attainment, Homeowner, Low rent
Younger, Long Commuter in dense neighborhood
Long commuters White black mix
Low rent in built up neighborhoods
Renters within cities, mixed income areas, White/Hispanic mix, Unmarried
Older Home owners with high income
Older home owners and very high income
White Asian Mix Big City Burbs Dwellers
Bachelors degree Mid income With Mortgages
Asian Hispanic Mix, Mid income
Bachelors degree Higher income Home Owners
Wealthy Nuclear Families
Lower educational attainment, Homeowner, Low rent
Younger, Long Commuter in dense neighborhood
Long commuters White black mix
Low rent in built up neighborhoods
Renters within cities, mixed income areas, White/Hispanic mix, Unmarried
Older Home owners with high income
Older home owners and very high income
White Asian Mix Big City Burbs Dwellers
Bachelors degree Mid income With Mortgages
Asian Hispanic Mix, Mid income
Bachelors degree Higher income Home Owners
Wealthy, urban, and kid-free
Wealthy city commuters
New Developments
Very wealthy, multiple million dollar homes
High rise, dense urbanites
### Examples ```bash https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM -OBS_GetSegmentationSnapshot({{point geometry}}) +OBS_GetSegmentSnapshot({{point geometry}}) ``` ##### Get the Geographic Snapshot of a Segmentation @@ -36,7 +171,7 @@ __Get the Segmentation Snapshot around the MGM Grand__ ```bash https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM -OBS_GetSegmentationSnapshot(CDB_LatLng(36.10222, -115.169516)) +OBS_GetSegmentSnapshot(CDB_LatLng(36.10222, -115.169516)) ``` __Get the Segmentation Snapshot at CartoDB's NYC HQ__ @@ -44,5 +179,5 @@ __Get the Segmentation Snapshot at CartoDB's NYC HQ__ ```bash https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM -OBS_GetSegmentationSnapshot(CDB_LatLng(40.704512, -73.936669)) +OBS_GetSegmentSnapshot(CDB_LatLng(40.704512, -73.936669)) ``` From 632cfd92936f39978f176b956ac0bff2482ff344 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Fri, 13 May 2016 17:34:04 -0400 Subject: [PATCH 12/18] Proper segment names --- doc/segmentation_functions.md | 95 ++++++++++++++++------------------- 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 4500bef..a3a09f7 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -79,81 +79,70 @@ The possible segments are - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - + - + - - + + - + - - - - - - + + + + + + - + - - + + - - - + + + - - + + - - - - - - - - - - - - - - - - + + + + + - - - + + +
X10 segment X55 Segment
Hispanic and kids
Middle Class, Educated, Suburban, Mixed Race
Low Income on Urban Periphery
Suburban, Young and Low-income
low-income, urban, young, unmarried
Low education, mainly suburban
Young, working class and rural
Low-Income with gentrification
Middle class, educated, suburban, mixed race
Low income on urban periphery
Suburban, young and low-income
Low-income, urban, young, unmarried
Low education, mainly suburban
Young, working class and rural
Low income with gentrification
Low Income and Diverse
High school education Long Commuters, Black, White Hispanic mix
Rural, Bachelors or college degree, Rent owned mix
Rural,High School Education, Owns property
Young, City based renters in Sparse neighborhoods, Low poverty
High school education, long commuters, black, white, hispanic mix
Non-urban, bachelors or college degree, rent owned mix
Rural, high school education, owns property
Young, city based renters in sparse neighborhoods, low poverty
LOW INCOME, MINORITY MIX
Predominantly black, high high school attainment, home owners
White and minority mix multilingual, mixed income / education. Married
Hispanic Black mix multilingual, high poverty, renters, uses public transport
Predominantly black renters, rent own mix
Predominantly black, high school attainment, home owners
White and minority mix, multilingual, mixed income / education. Married
Hispanic black mix, multilingual, high poverty, renters, uses public transport
Predominantly black renters, rent own mix
MIDDLE INCOME, SINGLE FAMILY HOMES
Lower Middle Income with higher rent burden
Lower middle income with higher rent burden
Black and mixed community with rent burden
Lower Middle Income with affordable housing
Lower middle income with affordable housing
Relatively affordable, satisfied lower middle class
Satisfied Lower Middle Income Higher Rent Costs
Suburban/Rural Satisfied, decently educated lower middle class
Satisfied lower middle income higher rent costs
Suburban/rural satisfied, decently educated lower middle class
Struggling lower middle class with rent burden
Older white home owners, less comfortable financially
Older home owners, more financially comfortable, some diversity
Native American
Younger, poorer,single parent family Native Americans
Older, middle income Native Americans once married and Educated
Older, middle income Native Americans once married and educated
Old Wealthy, White
Older, mixed race professionals
Works from home, Highly Educated, Super Wealthy
Retired Grandparents
Wealthy and Rural Living
Wealthy, Retired Mountains/Coasts
Wealthy Diverse Suburbanites On the Coasts
Retirement Communitties
Works from home, highly hducated, super wealthy
Retired grandparents
Wealthy and rural living
Wealthy, retired mountains/coasts
Wealthy diverse suburbanites on the coasts
communities
Low Income African American
Urban - Inner city
Urban - inner city
Rural families
Residential institutions, young people
College towns
College town with poverty
University campus wider area
City Outskirt University Campuses
City Center University Campuses
City outskirt university cumpuses
City center university campuses
Wealthy Nuclear Families
Lower educational attainment, Homeowner, Low rent
Younger, Long Commuter in dense neighborhood
Long commuters White black mix
Lower educational attainment, homeowner, low rent
Younger, long commuter in dense neighborhood
Long commuters white black mix
Low rent in built up neighborhoods
Renters within cities, mixed income areas, White/Hispanic mix, Unmarried
Older Home owners with high income
Renters within cities, mixed income areas, white/hispanic mix, unmarried
Mix of older home owners with middle income and farmers
Older home owners and very high income
White Asian Mix Big City Burbs Dwellers
Bachelors degree Mid income With Mortgages
Asian Hispanic Mix, Mid income
Bachelors degree Higher income Home Owners
Wealthy Nuclear Families
Lower educational attainment, Homeowner, Low rent
Younger, Long Commuter in dense neighborhood
Long commuters White black mix
Low rent in built up neighborhoods
Renters within cities, mixed income areas, White/Hispanic mix, Unmarried
Older Home owners with high income
Older home owners and very high income
White Asian Mix Big City Burbs Dwellers
Bachelors degree Mid income With Mortgages
Asian Hispanic Mix, Mid income
Bachelors degree Higher income Home Owners
White, asian mix big city burbs dwellers
Bachelors degree, mid income with mortgages
Asian hispanic mix, mid income
Bachelors degree higher income home owners
Wealthy, urban, and kid-free
Wealthy city commuters
New Developments
Very wealthy, multiple million dollar homes
Wealthy city commuters
New developments
Wealthy transplants displacing long-term local residents
High rise, dense urbanites
From f9c0b737373aa83792fdb408e365b962260b33f8 Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 16 May 2016 08:33:38 -0400 Subject: [PATCH 13/18] fixed some spelling errors and code examples, wordsmithed segmentation level descriptions --- doc/demographic_functions.md | 14 +++++--------- doc/segmentation_functions.md | 14 +++++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 21a98ed..fbb949f 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -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 --- | --- | --- | --- diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index a3a09f7..4673d5f 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -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: @@ -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}}) ``` From 5376af3d2b4438246a5f15605958b39c8074373e Mon Sep 17 00:00:00 2001 From: csobier Date: Mon, 16 May 2016 08:48:51 -0400 Subject: [PATCH 14/18] moved order of some examples for output --- doc/demographic_functions.md | 2 +- doc/segmentation_functions.md | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index fbb949f..25b8519 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -41,7 +41,7 @@ obs_getdemographicsnapshot: { ### Examples ```bash -https://{{username}}.cartodb.com/api/v2/sql?q=SELECT * FROM +https://{username}.cartodb.com/api/v2/sql?q=SELECT * FROM OBS_GetDemographicSnapshot({{point geometry}}) ``` diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 4673d5f..9512251 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -8,19 +8,21 @@ _**Note:** The Segmentation Snapshot functions are only available for the United ### Arguments -Name | Type | Description | Example Values ---- | --- | --- | --- +Name | Description | Example Values +--- | --- | --- 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 levels for the point you requests, the x10\_segment and x55\_segment. These segmentation levels contain different classifications of population within with each segment: +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. 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. -- x10\_segments contain populations at high-levels, broken down into 10 broad categories -- x55\_segments contain more granular sub-levels to categorize the population +Name | Type | Description +---- | ---- | ----------- +x10\_segment | text | The demographic segment location at the 10 segment level, containing populations at high-levels, broken down into 10 broad categories +x55\_segment | text | The demographic segment location at the 55 segment level, containing 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: +An example response appears as follows: ```json obs_getsegmentsnapshot: { @@ -73,11 +75,6 @@ obs_getsegmentsnapshot: { } ``` -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:
X10 segment X55 Segment
From 182e6a0e92a75f05ec26d38067bef8a8e9573aa9 Mon Sep 17 00:00:00 2001 From: Stuart Lynn Date: Tue, 17 May 2016 09:38:29 -0400 Subject: [PATCH 15/18] update segmentation table --- doc/segmentation_functions.md | 97 +++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 9512251..14626f4 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -79,74 +79,81 @@ The possible segments are:
+ - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + - + - - + + + - + + - - - - - - + + + + + + + - + - - + + + - - - + + + - - + + - - - - - + + + + + - - - + + +
X10 segment X55 Segment
Hispanic and kids
Middle class, educated, suburban, mixed race
Low income on urban periphery
Suburban, young and low-income
Low-income, urban, young, unmarried
Low education, mainly suburban
Young, working class and rural
Low income with gentrification
Middle Class, Educated, Suburban, Mixed Race
Low Income on Urban Periphery
Suburban, Young and Low-income
low-income, urban, young, unmarried
Low education, mainly suburban
Young, working class and rural
Low-Income with gentrification
Low Income and Diverse
High school education, long commuters, black, white, hispanic mix
Non-urban, bachelors or college degree, rent owned mix
Rural, high school education, owns property
Young, city based renters in sparse neighborhoods, low poverty
LOW INCOME, MINORITY MIX
Predominantly black, high school attainment, home owners
White and minority mix, multilingual, mixed income / education. Married
Hispanic black mix, multilingual, high poverty, renters, uses public transport
Predominantly black renters, rent own mix
MIDDLE INCOME, SINGLE FAMILY HOMES
Lower middle income with higher rent burden
High school education Long Commuters, Black, White Hispanic mix
Rural, Bachelors or college degree, Rent owned mix
Rural,High School Education, Owns property
Young, City based renters in Sparse neighborhoods, Low poverty
Low income, minority mix
Predominantly black, high high school attainment, home owners
White and minority mix multilingual, mixed income / education. Married
Hispanic Black mix multilingual, high poverty, renters, uses public transport
Predominantly black renters, rent own mix
Middle income, single family homes
Lower Middle Income with higher rent burden
Black and mixed community with rent burden
Lower middle income with affordable housing
Lower Middle Income with affordable housing
Relatively affordable, satisfied lower middle class
Satisfied lower middle income higher rent costs
Suburban/rural satisfied, decently educated lower middle class
Satisfied Lower Middle Income Higher Rent Costs
Suburban/Rural Satisfied, decently educated lower middle class
Struggling lower middle class with rent burden
Older white home owners, less comfortable financially
Older home owners, more financially comfortable, some diversity
Native American
Younger, poorer,single parent family Native Americans
Older, middle income Native Americans once married and educated
Older, middle income Native Americans once married and Educated
Old Wealthy, White
Older, mixed race professionals
Works from home, highly hducated, super wealthy
Retired grandparents
Wealthy and rural living
Wealthy, retired mountains/coasts
Wealthy diverse suburbanites on the coasts
communities
Works from home, Highly Educated, Super Wealthy
Retired Grandparents
Wealthy and Rural Living
Wealthy, Retired Mountains/Coasts
Wealthy Diverse Suburbanites On the Coasts
Retirement Communitties
Low Income African American
Urban - inner city
Urban - Inner city
Rural families
Residential institutions, young people
College towns
College town with poverty
University campus wider area
City outskirt university cumpuses
City center university campuses
City Outskirt University Campuses
City Center University Campuses
Wealthy Nuclear Families
Lower educational attainment, homeowner, low rent
Younger, long commuter in dense neighborhood
Long commuters white black mix
Lower educational attainment, Homeowner, Low rent
Younger, Long Commuter in dense neighborhood
Long commuters White black mix
Low rent in built up neighborhoods
Renters within cities, mixed income areas, white/hispanic mix, unmarried
Mix of older home owners with middle income and farmers
Renters within cities, mixed income areas, White/Hispanic mix, Unmarried
Older Home owners with high income
Older home owners and very high income
White, asian mix big city burbs dwellers
Bachelors degree, mid income with mortgages
Asian hispanic mix, mid income
Bachelors degree higher income home owners
White Asian Mix Big City Burbs Dwellers
Bachelors degree Mid income With Mortgages
Asian Hispanic Mix, Mid income
Bachelors degree Higher income Home Owners
Wealthy, urban, and kid-free
Wealthy city commuters
New developments
Wealthy transplants displacing long-term local residents
Wealthy city commuters
New Developments
Very wealthy, multiple million dollar homes
High rise, dense urbanites
- ### Examples ```bash From 75fc489143c986b8399a3a819fdd91d025d963b2 Mon Sep 17 00:00:00 2001 From: csobier Date: Tue, 17 May 2016 15:01:56 -0400 Subject: [PATCH 16/18] applied Carla's edits --- doc/demographic_functions.md | 6 +++--- doc/segmentation_functions.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 25b8519..51fd9c7 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -4,7 +4,7 @@ The Demographic Snapshot enables you to collect demographic reports around a poi _**Note:** The Demographic Snapshot functions are only available for the United States._ -## OBS_GetDemographicSnapshot( point geometry ); +## OBS_GetDemographicSnapshot( point geometry ) Fields returned include information about income, education, transportation, race, and more. Not all fields will have information for every coordinate queried. @@ -13,7 +13,7 @@ Fields returned include information about income, education, transportation, rac Name | Description | Example Values --- | --- | --- 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)` +point geometry | A 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 @@ -21,7 +21,7 @@ The Demographic Snapshot contains a broad subset of demographic measures in the Value | Name | Tablename | Aggregate | Type | Description ----- | ---- | --------- | --------- | ---- |------------ -The value of the measure at the point you requested | The name of the measure | The table it was drawn from | Indicated if the measure is a count or median. | The posgresql type | A description of the measure +The value of the measure at the point you requested | The name of the measure | The table it was drawn from | Indicated if the measure is a count or median. | postgresql | A description of the measure For example the "Female Population" measure returns diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 14626f4..17a1f37 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -4,14 +4,14 @@ The Segmentation Snapshot functions enable you to determine the pre-calculated p _**Note:** The Segmentation Snapshot functions are only available for the United States. Our first release (May 18, 2016) is derived from Census 2010 variables. Our next release will be based on Census 2014 data. For the latest information, see the [Open Segments](https://github.com/CartoDB/open-segments) project repository._ -## OBS_GetSegmentSnapshot( Point Geometry ); +## OBS_GetSegmentSnapshot( Point Geometry ) ### Arguments Name | Description | Example Values --- | --- | --- 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)` +point geometry | A 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 From 5e61ef2076b74c0ec9bc9cfc63c89ec757d54a46 Mon Sep 17 00:00:00 2001 From: "Andrew W. Hill" Date: Tue, 17 May 2016 18:54:56 -0400 Subject: [PATCH 17/18] Update demographic_functions.md removed username --- doc/demographic_functions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/demographic_functions.md b/doc/demographic_functions.md index 51fd9c7..73084a6 100644 --- a/doc/demographic_functions.md +++ b/doc/demographic_functions.md @@ -12,7 +12,6 @@ Fields returned include information about income, education, transportation, rac Name | Description | Example Values --- | --- | --- -username | The username of your CartoDB account where the Data Observatory has been enabled | `username` point geometry | A 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 From 0d5fa7a1999ecc45087b130024a4ff1b9ad5890c Mon Sep 17 00:00:00 2001 From: csobier Date: Tue, 17 May 2016 19:58:07 -0400 Subject: [PATCH 18/18] removed username from segmentation for consistency- this branch is ready to go --- doc/segmentation_functions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/segmentation_functions.md b/doc/segmentation_functions.md index 17a1f37..6e031f5 100644 --- a/doc/segmentation_functions.md +++ b/doc/segmentation_functions.md @@ -10,7 +10,6 @@ _**Note:** The Segmentation Snapshot functions are only available for the United Name | Description | Example Values --- | --- | --- -username | The username of your CartoDB account where the Data Observatory has been enabled | `username` point geometry | A 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