cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny
Loading...

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the 500_cities_citylevel_data_gis_friendly_format_2016 table in this repository, by referencing it like:

"cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest"."500_cities_citylevel_data_gis_friendly_format_2016"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "diabetes_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of diagnosed diabetes among adults aged >=18 years
    "diabetes_adjprev", -- Model-based estimate for age-adjusted prevalence of diagnosed diabetes among adults aged >=18 years, 2014
    "diabetes_crude95ci", -- Estimated confidence interval for crude prevalence of diagnosed diabetes among adults aged >=18 years 
    "diabetes_crudeprev", -- Model-based estimate for crude prevalence of diagnosed diabetes among adults aged >=18 years, 2014
    "dental_adj95ci", --   Estimated confidence interval for age-adjusted prevalence of visits to dentist or dental clinic among adults aged >=18 years  
    "dental_adjprev", -- Model-based estimate for age-adjusted prevalence of visits to dentist or dental clinic among adults aged >=18 years, 2014
    "dental_crude95ci", -- Estimated confidence interval for crude prevalence of visits to dentist or dental clinic among adults aged >=18 years 
    "dental_crudeprev", -- Model-based estimate for crude prevalence of visits to dentist or dental clinic among adults aged >=18 years, 2014
    "csmoking_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of current smoking among adults aged >=18 years
    "csmoking_adjprev", -- Model-based estimate for age-adjusted prevalence of current smoking among adults aged >=18 years, 2014
    "csmoking_crudeprev", -- Model-based estimate for crude prevalence of current smoking among adults aged >=18 years, 2014
    "corew_adj95ci", --   Estimated confidence interval for age-adjusted prevalence of older adult women aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 years 
    "corew_adjprev", -- Model-based estimate for age-adjusted prevalence of older adult women aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 years, 2014
    "corew_crude95ci", -- Estimated confidence interval for crude prevalence of older adult women aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 years 
    "corew_crudeprev", -- Model-based estimate for crude prevalence of older adult women aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 years, 2014
    "corem_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of older adult men aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening
    "corem_adjprev", -- Model-based estimate for age-adjusted prevalence of older adult men aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, 2014
    "corem_crude95ci", -- Estimated confidence interval for crude prevalence of older adult men aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening
    "corem_crudeprev", -- Model-based estimate for crude prevalence of older adult men aged >=65 years who are up to date on a core set of clinical preventive services: Flu shot past year, PPV shot ever, Colorectal cancer screening, 2014
    "copd_adjprev", -- Model-based estimate for age-adjusted prevalence of chronic obstructive pulmonary disease among adults aged >=18 years, 2014
    "copd_crude95ci", -- Estimated confidence interval for crude prevalence of chronic obstructive pulmonary disease among adults aged >=18 years
    "copd_crudeprev", -- Model-based estimate for crude prevalence of chronic obstructive pulmonary disease among adults aged >=18 years, 2014
    "colon_screen_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 years
    "colon_screen_crude95ci", -- Estimated confidence interval for crude prevalence of fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 years
    "colon_screen_crudeprev", -- Model-based estimate for crude prevalence of fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 years, 2014
    "cholscreen_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of cholesterol screening among adults aged >=18 years 
    "cholscreen_adjprev", -- Model-based estimate for age-adjusted prevalence of cholesterol screening among adults aged >=18 years, 2013
    "cholscreen_crude95ci", -- Estimated confidence interval for crude prevalence of cholesterol screening among adults aged >=18 years 
    "cholscreen_crudeprev", -- Model-based estimate for crude prevalence of cholesterol screening among adults aged >=18 years, 2013
    "checkup_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of visits to doctor for routine checkup within the past year among adults aged >=18 years
    "checkup_adjprev", -- Model-based estimate for age-adjusted prevalence of visits to doctor for routine checkup within the past year among adults aged >=18 years, 2014
    "checkup_crude95ci", -- Estimated confidence interval for crude prevalence of visits to doctor for routine checkup within the past year among adults aged >=18 years 
    "checkup_crudeprev", -- Model-based estimate for crude prevalence of visits to doctor for routine checkup within the past year among adults aged >=18 years, 2014
    "chd_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of coronary heart disease among adults aged >=18 years
    "chd_adjprev", -- Model-based estimate for age-adjusted prevalence of coronary heart disease among adults aged >=18 years, 2014
    "chd_crudeprev", -- Model-based estimate for crude prevalence of coronary heart disease among adults aged >=18 years, 2014 
    "casthma_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of current asthma among adults aged >=18 years
    "obesity_crudeprev", -- Model-based estimate for crude prevalence of obesity among adults aged >=18 years, 2014
    "obesity_crude95ci", -- Estimated confidence interval for crude prevalence of obesity among adults aged >=18 years
    "obesity_adjprev", -- Model-based estimate for age-adjusted prevalence of obesity among adults aged >=18 years, 2014
    "obesity_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of obesity among adults aged >=18 years
    "paptest_crudeprev", -- Model-based estimate for crude prevalence of papanicolaou smear use among adult women aged 21–65 years, 2014
    "casthma_adjprev", -- Model-based estimate for age-adjusted prevalence of current asthma among adults aged >=18 years, 2014
    "casthma_crude95ci", -- Estimated confidence interval for crude prevalence of current asthma among adults aged >=18 years 
    "casthma_crudeprev", -- Model-based estimate for crude prevalence of current asthma among adults aged >=18 years, 2014
    "cancer_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of cancer (excluding skin cancer) among adults aged >=18 years 
    "cancer_adjprev", -- Model-based estimate for age-adjusted prevalence of cancer (excluding skin cancer) among adults aged >=18 years, 2014 
    "cancer_crude95ci", -- Estimated confidence interval for crude prevalence of cancer (excluding skin cancer) among adults aged >=18 years
    "cancer_crudeprev", -- Model-based estimate for crude prevalence of cancer (excluding skin cancer) among adults aged >=18 years, 2014
    "bpmed_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of taking medicine for high blood pressure control among adults aged >=18 years with high blood pressure
    "bpmed_adjprev", -- Model-based estimate for age-adjusted prevalence of taking medicine for high blood pressure control among adults aged >=18 years with high blood pressure, 2013
    "bpmed_crude95ci", -- Estimated confidence interval for crude prevalence of taking medicine for high blood pressure control among adults aged >=18 years with high blood pressure 
    "bpmed_crudeprev", -- Model-based estimate for crude prevalence of taking medicine for high blood pressure control among adults aged >=18 years with high blood pressure, 2013
    "bphigh_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of high blood pressure among adults aged >=18 years 
    "bphigh_adjprev", -- Model-based estimate for age-adjusted prevalence of high blood pressure among adults aged >=18 years, 2013
    "bphigh_crude95ci", -- Estimated confidence interval for crude prevalence of high blood pressure among adults aged >=18 years 
    "bphigh_crudeprev", -- Model-based estimate for crude prevalence of high blood pressure among adults aged >=18 years, 2013 
    "binge_adj95ci", -- Confidence interval for age-adjusted prevalence estimate of binge drinking among adults aged ≥18 years
    "binge_adjprev", -- Model-based estimate for age-adjusted prevalence of binge drinking among adults aged >=18 years, 2014 
    "binge_crude95ci", -- Estimated confidence interval for crude prevalence of binge drinking among adults aged >=18 years 
    "binge_crudeprev", -- Model-based estimate for crude prevalence of binge drinking among adults aged >=18 years, 2014
    "mammouse_adjprev", -- Model-based estimate for age-adjusted prevalence of mammography use among women aged 50–74 years, 2014
    "arthritis_crude95ci", -- Estimated confidence interval for crude prevalence of arthritis among adults aged ≥18 years 
    "arthritis_crudeprev", -- Model-based estimate for crude prevalence of arthritis among adults aged >=18 years, 2014
    "access2_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of current lack of health insurance among adults aged 18 - 64 years 
    "access2_crude95ci", -- Estimated confidence interval for crude prevalence of current lack of health insurance among adults aged 18 - 64 years 
    "access2_crudeprev", -- Model-based estimate for crude prevalence of current lack of health insurance among adults aged 18-64 years, 2014
    "population2010", -- Population Count 2010
    "placefips", -- City FIPS code
    "placename", -- City name
    "stateabbr", -- State abbreviation
    "geolocation_zip",
    "geolocation_city",
    "geolocation_address",
    "geolocation", -- Latitude, longitude of city centroid
    "teethlost_crude95ci", -- Estimated confidence interval for crude prevalence of all teeth lost among adults aged >=65 years
    "phlth_adjprev", -- Model-based estimate for age-adjusted prevalence of physical health not good for >=14 days among adults aged >=18 years, 2014
    "mhlth_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of mental health not good for >=14 days among adults aged >=18 years 
    "mhlth_crudeprev", -- Model-based estimate for crude prevalence of mental health not good for >=14 days among adults aged >=18 years, 2014
    "csmoking_crude95ci", -- Estimated confidence interval for crude prevalence of current smoking among adults aged >=18 years
    "copd_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of chronic obstructive pulmonary disease among adults aged >=18 years 
    "colon_screen_adjprev", -- Model-based estimate for age-adjusted prevalence of fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 years, 2014
    "chd_crude95ci", -- Estimated confidence interval for crude prevalence of coronary heart disease among adults aged >=18 years 
    "arthritis_adj95ci", -- Confidence interval for age-adjusted prevalence estimate of arthritis among adults aged ≥18 years
    "access2_adjprev", -- Age-adjusted prevalence estimate of current lack of health insurance among adults aged 18-64 years, 2014
    "lpa_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of no leisure-time physical activity among adults aged >=18 years
    "lpa_adjprev", -- Model-based estimate for age-adjusted prevalence of no leisure-time physical activity among adults aged >=18 years, 2014
    "lpa_crude95ci", -- Estimated confidence interval for crude prevalence of no leisure-time physical activity among adults aged >=18 years
    "lpa_crudeprev", -- Model-based estimate for crude prevalence of no leisure-time physical activity among adults aged >=18 years, 2014 
    "kidney_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of chronic kidney disease among adults aged >=18 years
    "arthritis_adjprev", -- Model-based estimate for age-adjusted prevalence of arthritis among adults aged >=18 years, 2014
    "mammouse_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of mammography use among women aged 50–74 years
    "mhlth_crude95ci", -- Estimated confidence interval for crude prevalence of mental health not good for >=14 days among adults aged >=18 years
    "mhlth_adjprev", -- Model-based estimate for age-adjusted prevalence of mental health not good for >=14 days among adults aged >=18 years , 2014
    "mammouse_crude95ci", -- Estimated confidence interval for crude prevalence of mammography use among women aged 50–74 years 
    "mammouse_crudeprev", -- Model-based estimate for crude prevalence of mammography use among women aged 50–74 years, 2014
    "geolocation_state",
    "teethlost_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of all teeth lost among adults aged >=65 years
    "teethlost_adjprev", -- Model-based estimate for age-adjusted prevalence of all teeth lost among adults aged >=65 years, 2014
    "teethlost_crudeprev", -- Model-based estimate for crude prevalence of all teeth lost among adults aged >=65 years, 2014
    "stroke_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of stroke among adults aged >=18 years
    "stroke_adjprev", -- Model-based estimate for age-adjusted prevalence of stroke among adults aged >=18 years, 2014
    "stroke_crude95ci", -- Estimated confidence interval for crude prevalence of stroke among adults aged >=18 years
    "stroke_crudeprev", -- Model-based estimate for crude prevalence of stroke among adults aged >=18 years, 2014
    "sleep_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of sleeping less than 7 hours among adults aged >=18 years
    "sleep_adjprev", -- Model-based estimate for age-adjusted prevalence of sleeping less than 7 hours among adults aged >=18 years, 2014
    "sleep_crude95ci", -- Estimated confidence interval for crude prevalence of stroke among adults aged >=18 years
    "sleep_crudeprev", -- Model-based estimate for crude prevalence of stroke among adults aged >=18 years, 2014
    "paptest_crude95ci", -- Estimated confidence interval for crude prevalence of papanicolaou smear use among adult women aged 21–65 years
    "paptest_adjprev", -- Model-based estimate for age-adjusted prevalence of papanicolaou smear use among adult women aged 21–65 years, 2014
    "paptest_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of papanicolaou smear use among adult women aged 21–65 years
    "phlth_crudeprev", -- Model-based estimate for crude prevalence of physical health not good for >=14 days among adults aged >=18 years, 2014
    "phlth_crude95ci", -- Estimated confidence interval for crude prevalence of physical health not good for >=14 days among adults aged >=18 years 
    "phlth_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of physical health not good for >=14 days among adults aged >=18 years
    "kidney_adjprev", -- Model-based estimate for age-adjusted prevalence of chronic kidney disease among adults aged >=18 years, 2014
    "kidney_crude95ci", -- Estimated confidence interval for crude prevalence of chronic kidney disease among adults aged >=18 years 
    "kidney_crudeprev", -- Model-based estimate for crude prevalence of chronic kidney disease among adults aged >=18 years, 2014
    "highchol_adj95ci", -- Estimated confidence interval for age-adjusted prevalence of high cholesterol among adults aged >=18 years who have been screened in the past 5 years
    "highchol_adjprev", -- Model-based estimate for age-adjusted prevalence of high cholesterol among adults aged >=18 years who have been screened in the past 5 years, 2013
    "highchol_crude95ci", -- Estimated confidence interval for crude prevalence of high cholesterol among adults aged >=18 years who have been screened in the past 5 years
    "highchol_crudeprev" -- Model-based estimate for crude prevalence of high cholesterol among adults aged >=18 years who have been screened in the past 5 years, 2013
FROM
    "cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest"."500_cities_citylevel_data_gis_friendly_format_2016"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny with SQL in under 60 seconds.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest

This will download all the objects for the latest tag of cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, cdc-gov/500-cities-citylevel-data-gis-friendly-format-2016-k56w-7tny is just another Postgres schema.

Related Documentation:

Loading...