Defining Geometry
StreetLight Advanced Traffic Counts API
Multiple endpoints in the StreetLight Advanced Traffic Counts API require you to define a geometry. We recommend defining your geometry using the same method as you call different StreetLight Advanced Traffic Counts API endpoints.
How are segments defined?
When you request metrics, you define a geometry that contains a set of StreetLight segments. Metrics are delivered for each of these segments.
StreetLight segments are derived from OpenStreetMap (OSM) and split based on intersection and distance rules. For more information in the StreetLight Help Center, see Chopped OpenStreetMap (OSM) Segments .
Each StreetLight segment has a segment ID that is a response for the geometry
and metrics
endpoints. You can also use StreetLight segment IDs to define the geometry you want to analyze. StreetLight segments are not the same as OSM segments, and so StreetLight segment IDs are different from OSM IDs.
Methods to define geometry
There are multiple ways to define geometry for an area you want to study. You only need to use one of the methods below.
If you enter a coordinate pair to define your geometry, ensure each pair is listed in the order “Longitude, Latitude” in your requests.
radius
A radius around a point. The point is defined with a pair of latitude and longitude coordinates, and the radius from that point is defined in miles or kilometers.
polygon
A bounding polygon defined by at least 4 pairs of coordinates, where the first and last coordinate pair in the array are the same. The polygon includes the area inside the boundary formed by the supplied coordinates.
nearest
Specify a point and a number of segments X to query the nearest X segments to the point. For example, you can use the nearest
geometry type with a Get metrics for a geometry request to get metrics for the nearest 10 segments to a potential site.
Use caution when using the
nearest
geometry type and thedate_range
parameter to get metrics in situations that may have very low sample data, such aspedestrian
travel mode withday_parts
late at night. This may yield a different selection of segments being returned for each month/year
tract_id, zip_id, blockgroup_id
GEOIDs for different local U.S. geographies. For more information, see data.census.gov
dissemination_area_id, census_division_id, census_subdivision_id
GEOIDs for different Canadian geographies. For more information, see www12.statcan.gc.ca
osm_id
An array of OpenStreetMap IDs defining the road segments you want to analyze. Note that these are different from the segment IDs defined by StreetLight. OSM IDs are not counted by the segmentcount endpoint.
For more information on how StreetLight Data uses OpenStreetMap, see How do changes in OpenStreetMap over time affect StreetLight InSight® ?
segment_id
An array of StreetLight segment IDs defining the road segments you want to analyze. The StreetLight Advanced Traffic Counts API returns traffic metrics for segments defined by Streetlight segment ID.
The geometry
endpoint returns StreetLight segment IDs and GeoJSON line strings. You can query the geometry
endpoint to determine each segment and geography that is included in the geometry you defined. You can visualize the segments by bringing the output from the geometry endpoint into your GIS tool.
Updated 3 months ago