edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj
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 driver_feedback_sign_aggregated_data table in this repository, by referencing it like:

"edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj:latest"."driver_feedback_sign_aggregated_data"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "date_and_time", -- The Timestamp of when the data was recorded. The time interval between recordings is 15 minutes. Note: It is possible to not have a specific recording of data at a specific Timestamp. This can occur for a number of reasons; however, the data values are still for the 15 minute interval.
    ":@computed_region_ueb5_7sqn", -- This column was automatically created in order to record in what polygon from the dataset 'City of Edmonton Ward Boundary and Council Composition: Current' (ueb5-7sqn) the point in column 'geocoded_column' is located.  This enables the creation of region maps (choropleths) in the visualization canvas and data lens.
    ":@computed_region_ecxu_fw7u", -- This column was automatically created in order to record in what polygon from the dataset 'Roadway Maintenance Area Polygon' (ecxu-fw7u) the point in column 'geocoded_column' is located.  This enables the creation of region maps (choropleths) in the visualization canvas and data lens.
    ":@computed_region_7ccj_gre3", -- This column was automatically created in order to record in what polygon from the dataset 'Neighbourhood Boundaries : 2019' (7ccj-gre3) the point in column 'geocoded_column' is located.  This enables the creation of region maps (choropleths) in the visualization canvas and data lens.
    "geocoded_column", -- The combination of latitude/longitude to map the location for the DFS unit.
    "vehicle_count_in_time_in",
    "hi_over_limit_percent", -- The percentage or ratio of the subtotal of the number of vehicles counted going over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_over_limit_count", -- A subtotal of the number of vehicles counted going over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_over_limit_percent", -- The percentage or ratio of the subtotal of the number of vehicles counted going over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_over_limit_count", -- A subtotal of the number of vehicles counted going over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_31_over_percent", -- The percentage of vehicles counted at or faster than 31 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_31_over_count", -- The number of vehicles counted at or faster than 31 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_31_over_percent", -- The percentage of vehicles counted at or faster than 31 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_31_over_count", -- The number of vehicles counted at or faster than 31 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_26_to_30_over_percent", -- The percentage of vehicles counted between 26 and 30 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_26_to_30_over_count", -- The number of vehicles counted between 26 and 30 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_26_to_30_over_percent", -- The percentage of vehicles counted between 26 and 30 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_26_to_30_over_count", -- The number of vehicles counted between 26 and 30 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_21_to_25_over_percent", -- The percentage of vehicles counted between 21 and 25 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_21_to_25_over_count", -- The number of vehicles counted between 21 and 25 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_21_to_25_over_percent", -- The percentage of vehicles counted between 21 and 25 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_21_to_25_over_count", -- The number of vehicles counted between 21 and 25 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_16_to_20_over_percent", -- The percentage of vehicles counted between 16 and 20 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_16_to_20_over_count", -- The number of vehicles counted between 16 and 20 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_16_to_20_over_percent", -- The percentage of vehicles counted between 16 and 20 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_16_to_20_over_count", -- The number of vehicles counted between 16 and 20 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_11_to_15_over_percent", -- The percentage of vehicles counted between 11 and 15 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_11_to_15_over_count", -- The number of vehicles counted between 11 and 15 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_11_to_15_over_percent", -- The percentage of vehicles counted between 11 and 15 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_11_to_15_over_count", -- The number of vehicles counted between 11 and 15 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_6_to_10_over_percent", -- The percentage of vehicles counted between 6 and 10 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_6_to_10_over_count", -- The number of vehicles counted between 6 and 10 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_6_to_10_over_percent", -- The percentage of vehicles counted between 6 and 10 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_6_to_10_over_count", -- The number of vehicles counted between 6 and 10 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_1_to_5_over_percent", -- The percentage of vehicles counted between 1 and 5 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_1_to_5_over_count", -- The number of vehicles counted between 1 and 5 km/h over the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_1_to_5_over_percent", -- The percentage of vehicles counted between 1 and 5 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_1_to_5_over_count", -- The number of vehicles counted between 1 and 5 km/h over the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_at_or_under_limit_per",
    "lo_at_or_under_limit_per",
    "hi_at_or_under_limit_cou",
    "lo_at_or_under_limit_cou",
    "hi_0_to_4_under_percent", -- The percentage of vehicles counted between 0 and 4 km/h below the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_0_to_4_under_count", -- The number of vehicles counted between 0 and 4 km/h below the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_0_to_4_under_percent", -- The percentage of vehicles counted between 0 and 4 km/h below the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_0_to_4_under_count", -- The number of vehicles counted between 0 and 4 km/h below the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_5_to_9_under_percent", -- The percentage of vehicles counted between 5 and 9 km/h below the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_5_to_9_under_count", -- The number of vehicles counted between 5 and 9 km/h below the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_5_to_9_under_percent", -- The percentage of vehicles counted between 5 and 9 km/h below the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_5_to_9_under_count", -- The number of vehicles counted between 5 and 9 km/h below the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "hi_10_under_percent", -- The percentage of vehicles counted at 10 km/h and below of the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "hi_10_under_count", -- The number of vehicles counted at 10 km/h and below of the speed limit for the date and time of the recorded data.  This is based on the fastest speed detected.
    "lo_10_under_percent", -- The percentage of vehicles counted at 10 km/h and below of the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "lo_10_under_count", -- The number of vehicles counted at 10 km/h and below of the speed limit for the date and time of the recorded data.  This is based on the slowest speed detected.
    "quarter_of_hour", -- A number from 1 to 4 representing which quarter of the hour portion of the date/timestamp of the recorded data. 1 - 0 min to 14 min, 2 - 15 min to 29 min, 3 - 30 min to 44 min, 4 - 45 min to 59 min.
    "hour_of_day", -- The 2 digit hour representation of the hour portion of the date/timestamp of the recorded data.
    "day_of_week", -- 1-Mon, 2-Tue, 3-Wed, 4-Thu, 5-Fri, 6-Sat and 7-Sun representing the day of the week of the date/timestamp of the recorded data.
    "calendar_month", -- The 2 digit month and the 3 letter abbreviation of the month portion of the date/timestamp of the recorded data.
    "year_recorded", -- The Year portion of the date/timestamp of the recorded data.
    "uom", -- The Speed Unit of Measure. Note: The usual setting is KPH but could also be MPH.
    "speed_limit", -- The posted speed limit for the specific stretch of road for which the DFS unit is capturing data.
    "longitude", -- The longitude value of the DFS unit's geo location.
    "latitude", -- The latitude value for the DFS unit's geo location.
    "neighbourhood_name", -- The name of the neighbourhood that the DFS unit is located.
    "neighbourhood_id", -- The neighbourhood ID associated to the neighbourhood that the DFS unit is located.
    "ward", -- The civic ward that the DFS unit is located.
    "direction", -- The direction of travel of vehicles that are being detected by the DFS unit.
    "location_description", -- A brief / abbreviated description of the location where the DFS unit is located.
    "site_id", -- A unique ID assigned to the location for proper/accurate identification.
    "row_id" -- System generated ID to eliminate the possibility of duplicate data.
FROM
    "edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj:latest"."driver_feedback_sign_aggregated_data"
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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj 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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj: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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj

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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj:latest

This will download all the objects for the latest tag of edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj 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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj: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 edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj: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, edmonton-ca/driver-feedback-sign-aggregated-data-h2v4-zkmj is just another Postgres schema.

Related Documentation:

Loading...