INRIX documentation logo

The INRIX GetSegmentsIn* API returns the segments that are contained within a specified geographic area or route. You may request either INRIX XD Segments (XDS) or TMC segments.

Specifically the following apis exist: GetSegmentsInBox, GetSegmentsInRadius, GetSegmentsInGeography, GetSegmentsInRoute

/?Action=GetSegmentsInBox

GET Retrieves segments for a specified rectangular region.

Parameters

  = required
Name Located In Type Description
action Query String Use GetSegmentsInBox
Token Query String A valid authorization token returned in response to a GetSecurityToken request.
Corner1 Query String The first corner of the region in which to get data. This parameter must be specified as a pair of latitude and longitude values separated by a pipe character (|), in the form Corner1=”latitude|longitude”. The latitude and longitude values are expressed using the WGS 84 datum. Northern latitudes are positive and southern latitudes are negative. Eastern hemisphere longitudes are positive and western hemisphere longitudes are negative. Longitudes in North America are negative. The corner specified by the Corner1 parameter can be any of the four corners of the bounding rectangle.
Corner2 Query String The second corner of the region in which to get data. The Corner2 parameter is the geometric opposite of Corner1.
SegmentOutputFields Query String The segment fields to be returned in the response. This parameter can specify a single field, or multiple fields in a comma-separated list such as “RoadInfo,LocationInfo”.
If this SegmentOutputFields is not specified, only the top level segment info is returned.
Value Description
RoadInfo Returns information about the road the segment is on
LocationInfo Returns the location of the segment
All Returns all the information associated with the segment
FRCLevel Query String The Federal Road Classification code of the Segments to report. Multiple codes can be specified in a comma-delimited list.
Value Description
All (default) Report all road types.
1 First class roads, such as national highway network roads.
2 Second class roads, such as state highway network roads.
3 Third class roads, such as state interconnecting network roads.
4 Fourth class roads, such as major connecting roads.
5 Fifth class roads, such as minor roads connecting suburbs
6 Sixth class roads, such as destination and destination collector roads.
7 Seventh class roads, such as destination dead-end roads.
Units Query Integer Use 0 for English units, 1 for metric. Default is 0.
RoadSegmentType Query String This indicates the type of Segment to return. If RoadSegmentType is not specified, INRIX XD Segments (XDS) are returned. Multiple RoadSegmentTypes can be specified in a call as a comma separated ordered list and the ordering matters. For instance, if “TMC,XDS” is specified, TMCs will be returned for all TMC-defined road segments, and INRIX XD Segments will be returned for additional road segments not defined by the TMC Table and where traffic coverage is available. If “XDS,TMC” is specified then XD Segments will be returned where available, else TMC segments would be returned. However as XD segments in general cover all TMC locations this call would return only XD Segments.
Value Description
XDS (default) INRIX XD Segments
TMC INRIX Default TMC Tables

Requests

Example GetSegmentsInBox Request
Query
http://{serverPath}.INRIX.com/...?Action=GetSegmentsInBox&Token={token}&Corner1=47.63905031375326|-122.2366032595215&Corner2=47.63487345599106|-122.23214006372069&RoadSegmentType=TMC,XDS

Responses

200 Success
<Inrix docType="GetSegmentInBox" copyright="Copyright INRIX Inc." versionNumber="5.21" createdDate="2014-07-23T20:09:26Z" statusId="0" statusText="" responseId="d94cb652-6470-4e1d-9af6-8632bd204bb6">
  <SegmentResultSet>
    <Segment code="114+04232" type="TMC"/>
    <Segment code="114N04232" type="TMC"/>
    <Segment code="114-04231" type="TMC"/>
    <Segment code="114P04232" type="TMC"/>
    <Segment code="114+04233" type="TMC"/>
    <Segment code="114P04233" type="TMC"/>
    <Segment code="3557921" type="XDS"/>
  </SegmentResultSet>
</Inrix>

Response Elements

Property Type Description
SegmentResultSet Array Represents a collection of segments.
Property Type Description
Segment Element Represents a segment.
Property Type Description
code Attribute (string) Unique identifier for the segment. The value would be the TMC code or the INRIX XD Segment ID.
type Attribute (string) Indicates type of segment. Possible values are “TMC” and “XDS”. XDS refers to a segment type of INRIX XD segment.
Offset Attribute (integer,integer) Start and end offset on the segment in meters.
RoadInfo Element Defines the information about the road on which this segment lies.
Property Type Description
RefSpeed Attribute (integer) The free flow speed on the segment.
Length Attribute (float) Length of segment in meters.
FRCLevel Attribute (integer) The Federal Road Classification code of the Segments, as described above.
Name Element (string) Name of the road that the segment is on.
LocationInfo Element Defines the information about the road on which this segment lies.
Property Type Description
Country Element (string) Represents the country the segment is in.
Center Element (string) Represents the longitude and latitude for the center of the segment.

/?Action=GetSegmentsInRadius

GET Retrieves segments in a radius.

Parameters

  = required
Name Located In Type Description
action Query String Use GetSegmentsInRadius
Token Query String A valid authorization token returned in response to a GetSecurityToken request.
Center Query String The center of the region in which to get data. This parameter must be specified as a pair of latitude and longitude values separated by a pipe character (|), in the form Center=”latitude|longitude”. Northern latitudes are positive and southern latitudes are negative. Eastern hemisphere longitudes are positive and western hemisphere longitudes are negative. Longitudes in North America are negative. The latitude and longitude values are expressed using the WGS 84 datum.
Radius Query Double The radius of the circular bounding area from which to return data. Any features that are fully or partially enclosed within the bounding area are selected. If the Units parameter is set to Metric, the radius is measured in kilometers; if Units is set to US (the default), the radius is measured in miles.
SegmentOutputFields Query String The segment fields to be returned in the response. This parameter can specify a single field, or multiple fields in a comma-separated list such as “RoadInfo,LocationInfo”.
If this SegmentOutputFields is not specified, only the top level segment info is returned.
Value Description
RoadInfo Returns information about the road the segment is on
LocationInfo Returns the location of the segment
All Returns all the information associated with the segment
FRCLevel Query String The Federal Road Classification code of the Segments to report. Multiple codes can be specified in a comma-delimited list.
Value Description
All (default) Report all road types.
1 First class roads, such as national highway network roads.
2 Second class roads, such as state highway network roads.
3 Third class roads, such as state interconnecting network roads.
4 Fourth class roads, such as major connecting roads.
5 Fifth class roads, such as minor roads connecting suburbs
6 Sixth class roads, such as destination and destination collector roads.
7 Seventh class roads, such as destination dead-end roads.
Units Query Integer Use 0 for English units, 1 for metric. Default is 0.
RoadSegmentType Query String This indicates the type of Segment to return. If RoadSegmentType is not specified, INRIX XD Segments (XDS) are returned. Multiple RoadSegmentTypes can be specified in a call as a comma separated ordered list and the ordering matters. For instance, if “TMC,XDS” is specified, TMCs will be returned for all TMC-defined road segments, and INRIX XD Segments will be returned for additional road segments not defined by the TMC Table and where traffic coverage is available. If “XDS,TMC” is specified then XD Segments will be returned where available, else TMC segments would be returned. However as XD segments in general cover all TMC locations this call would return only XD Segments.
Value Description
XDS (default) INRIX XD Segments
TMC INRIX Default TMC Tables

Requests

Example GetSegmentsInRadius Request
Query
http://{serverPath}.INRIX.com/...?Action=GetSegmentsInRadius&Token={token}&Center=47.60934091460299|-122.33118867822266&Radius=1.5&RoadSegmentType=TMC,XDS

Responses

200 Success
<Inrix docType="GetSegmentInRadius" copyright="Copyright INRIX Inc." versionNumber="5.21" createdDate="2014-07-23T20:09:26Z" statusId="0" statusText="" responseId="d94cb652-6470-4e1d-9af6-8632bd204bb6">
  <SegmentResultSet>
    <Segment code="114+04232" type="TMC"/>
    <Segment code="114N04232" type="TMC"/>
    <Segment code="114-04231" type="TMC"/>
    <Segment code="114P04232" type="TMC"/>
    <Segment code="114+04233" type="TMC"/>
    <Segment code="114P04233" type="TMC"/>
    <Segment code="3557921" type="XDS"/>
  </SegmentResultSet>
</Inrix>

Response Elements

Property Type Description
SegmentResultSet Array Represents a collection of segments.
Property Type Description
Segment Element Represents a segment.
Property Type Description
code Attribute (string) Unique identifier for the segment. The value would be the TMC code or the INRIX XD Segment ID.
type Attribute (string) Indicates type of segment. Possible values are “TMC” and “XDS”. XDS refers to a segment type of INRIX XD segment.
Offset Attribute (integer,integer) Start and end offset on the segment in meters.
RoadInfo Element Defines the information about the road on which this segment lies.
Property Type Description
RefSpeed Attribute (integer) The free flow speed on the segment.
Length Attribute (float) Length of segment in meters.
FRCLevel Attribute (integer) The Federal Road Classification code of the Segments, as described above.
Name Element (string) Name of the road that the segment is on.
LocationInfo Element Defines the information about the road on which this segment lies.
Property Type Description
Country Element (string) Represents the country the segment is in.
Center Element (string) Represents the longitude and latitude for the center of the segment.

/?Action=GetSegmentsInGeography

GET Retrieves segments for a specified region.

Parameters

  = required
Name Located In Type Description
action Query String Use GetSegmentsInGeography
Token Query String A valid authorization token returned in response to a GetSecurityToken request.
GeoId Query String The ID of the specified geography. For more information on how to obtain the ID, see GetGeography. When using a custom GeoId (previously created with CreateGeography), the first call will create cached files. Once these have been created the call will return the correct information.
SegmentOutputFields Query String The segment fields to be returned in the response. This parameter can specify a single field, or multiple fields in a comma-separated list such as “RoadInfo,LocationInfo”.
If this SegmentOutputFields is not specified, only the top level segment info is returned.
Value Description
RoadInfo Returns information about the road the segment is on.
LocationInfo Returns the location of the segment.
All Returns all the information associated with the segment.
FRCLevel Query String The Federal Road Classification code of the Segments to report. Multiple codes can be specified in a comma-delimited list.
Value Description
All (default) Report all road types.
1 First class roads, such as national highway network roads.
2 Second class roads, such as state highway network roads.
3 Third class roads, such as state interconnecting network roads.
4 Fourth class roads, such as major connecting roads.
5 Fifth class roads, such as minor roads connecting suburbs
6 Sixth class roads, such as destination and destination collector roads.
7 Seventh class roads, such as destination dead-end roads.
Units Query Integer Use 0 for English units, 1 for metric. Default is 0.
RoadSegmentType Query String This indicates the type of Segment to return. If RoadSegmentType is not specified, INRIX XD Segments (XDS) are returned. Multiple RoadSegmentTypes can be specified in a call as a comma separated ordered list and the ordering matters. For instance, if “TMC,XDS” is specified, TMCs will be returned for all TMC-defined road segments, and INRIX XD Segments will be returned for additional road segments not defined by the TMC Table and where traffic coverage is available. If “XDS,TMC” is specified then XD Segments will be returned where available, else TMC segments would be returned. However as XD segments in general cover all TMC locations this call would return only XD Segments.
Value Description
XDS (default) INRIX XD Segments
TMC INRIX Default TMC Tables

Requests

Example GetSegmentsInGeography Request
Query
http://{serverPath}.INRIX.com/...?Action=GetSegmentsInGeography&Token={token}&GeoId=237&RoadSegmentType=TMC,XDS

Responses

200 Success
<Inrix docType="GetSegmentInGeography" copyright="Copyright INRIX Inc." versionNumber="5.21" createdDate="2014-07-23T20:09:26Z" statusId="0" statusText="" responseId="d94cb652-6470-4e1d-9af6-8632bd204bb6">
  <SegmentResultSet>
    <Segment code="114+04232" type="TMC"/>
    <Segment code="114N04232" type="TMC"/>
    <Segment code="114-04231" type="TMC"/>
    <Segment code="114P04232" type="TMC"/>
    <Segment code="114+04233" type="TMC"/>
    <Segment code="114P04233" type="TMC"/>
    <Segment code="3557921" type="XDS"/>
  </SegmentResultSet>
</Inrix>

Response Elements

Property Type Description
SegmentResultSet Array Represents a collection of segments.
Property Type Description
Segment Element Represents a segment.
Property Type Description
code Attribute (string) Unique identifier for the segment. The value would be the TMC code or the INRIX XD Segment ID.
type Attribute (string) Indicates type of segment. Possible values are “TMC” and “XDS”. XDS refers to a segment type of INRIX XD segment.
Offset Attribute (integer,integer) Start and end offset on the segment in meters.
RoadInfo Element Defines the information about the road on which this segment lies.
Property Type Description
RefSpeed Attribute (integer) The free flow speed on the segment.
Length Attribute (float) Length of segment in meters.
FRCLevel Attribute (integer) The Federal Road Classification code of the Segments, as described above.
Name Element (string) Name of the road that the segment is on.
LocationInfo Element Defines the information about the road on which this segment lies.
Property Type Description
Country Element (string) Represents the country the segment is in.
Center Element (string) Represents the longitude and latitude for the center of the segment.

/?Action=GetSegmentsInRoute

GET Retrieves segments in a specified route.

Parameters

  = required
Name Located In Type Description
action Query String Use GetSegmentsInRoute
Token Query String A valid authorization token returned in response to a GetSecurityToken request.
RouteId Query String A valid route ID, returned from a previous call to FindRoute, from which to return Segments.
SegmentOutputFields Query String The segment fields to be returned in the response. This parameter can specify a single field, or multiple fields in a comma-separated list such as “RoadInfo,LocationInfo”.
If this SegmentOutputFields is not specified, only the top level segment info is returned.
Value Description
RoadInfo Returns information about the road the segment is on
LocationInfo Returns the location of the segment
All Returns all the information associated with the segment
FRCLevel Query String The Federal Road Classification code of the Segments to report. Multiple codes can be specified in a comma-delimited list.
Value Description
All (default) Report all road types.
1 First class roads, such as national highway network roads.
2 Second class roads, such as state highway network roads.
3 Third class roads, such as state interconnecting network roads.
4 Fourth class roads, such as major connecting roads.
5 Fifth class roads, such as minor roads connecting suburbs
6 Sixth class roads, such as destination and destination collector roads.
7 Seventh class roads, such as destination dead-end roads.
Units Query Integer Use 0 for English units, 1 for metric. Default is 0.
RoadSegmentType Query String This indicates the type of Segment to return. If RoadSegmentType is not specified, INRIX XD Segments (XDS) are returned. Multiple RoadSegmentTypes can be specified in a call as a comma separated ordered list and the ordering matters. For instance, if “TMC,XDS” is specified, TMCs will be returned for all TMC-defined road segments, and INRIX XD Segments will be returned for additional road segments not defined by the TMC Table and where traffic coverage is available. If “XDS,TMC” is specified then XD Segments will be returned where available, else TMC segments would be returned. However as XD segments in general cover all TMC locations this call would return only XD Segments.
Value Description
XDS (default) INRIX XD Segments
TMC INRIX Default TMC Tables

Requests

Example GetSegmentsInRoute Request
Query
http://{serverPath}.INRIX.com/...?Action=GetSegmentsInRoute&Token={token}&RouteID=38140420&RoadSegmentType=XDS

Responses

200 Success
<Inrix docType="GetSegmentsInRoute" copyright="Copyright INRIX Inc." versionNumber="5.2" createdDate="2014-07-22T00:02:15Z" statusId="0" statusText="" responseId="f14e2705-c723-468c-8754-f5ef8300b6bf">
  <SegmentResultSet>
    <Segment code="3556698" type="XDS" offset="635,977">
      <RoadInfo refSpeed="31" length="0.635150583628844" FRCLevel="3">
        <Name>NE Points Dr|Northup Way</Name>
      </RoadInfo>
      <LocationInfo>
        <Country>US</Country>
        <Center longitude="-122.204025268555" latitude="47.6431274414063"/>
      </LocationInfo>
    </Segment>
    <Segment code="3557299" type="XDS" offset="52,103">
      <RoadInfo refSpeed="31" length="0.0646196600020101" FRCLevel="3">
        <Name>Lake Washington Blvd NE</Name>
      </RoadInfo>
      <LocationInfo>
        <Country>US</Country>
        <Center longitude="-122.201721191406" latitude="47.6437530517578"/>
      </LocationInfo>
    </Segment>
    ...
  </SegmentResultSet>
</Inrix>

Response Elements

Property Type Description
SegmentResultSet Array Represents a collection of segments.
Property Type Description
Segment Element Represents a segment.
Property Type Description
code Attribute (string) Unique identifier for the segment. The value would be the TMC code or the INRIX XD Segment ID.
type Attribute (string) Indicates type of segment. Possible values are “TMC” and “XDS”. XDS refers to a segment type of INRIX XD segment.
Offset Attribute (integer,integer) Start and end offset on the segment in meters.
RoadInfo Element Defines the information about the road on which this segment lies.
Property Type Description
RefSpeed Attribute (integer) The free flow speed on the segment.
Length Attribute (float) Length of segment in meters.
FRCLevel Attribute (integer) The Federal Road Classification code of the Segments, as described above.
Name Element (string) Name of the road that the segment is on.
LocationInfo Element Defines the information about the road on which this segment lies.
Property Type Description
Country Element (string) Represents the country the segment is in.
Center Element (string) Represents the longitude and latitude for the center of the segment.