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.


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.



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.



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 the date_range parameter to get metrics in situations that may have very low sample data, such as pedestrian travel mode with day_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 geographies. For more information, see


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® ?


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.