Created
Last Updated
byadmin
Print Issue
This article describes the ArcGIS Server requirements for street centerline, geocode/locator and print services, including samples of expected REST API request URLs and JSON responses. These services are required for Crash Magic GIS-based features to work.
Explanation
For Crash Magic GIS-based features to work, we require three publicly available REST services hosted from your ArcGIS Server (ArcGIS Online and other providers are not currently supported):
- Map Service with street centerline data
- Geocode Service based on same data set as street centerline map service.
- Print Service (required if you are hosting an instance of Crash Magic internal to your agency)
Street Centerline Map Service Requirements
- Street centerline data available as one or more layers.
- Capable of an Identify operation (a “feature service” does not support Identify).
- Dynamic, not tiled.
- In addition to the required input parameters, we also require: f, sr, layers, returnGeometry.
- Preferred spatial reference in an appropriate local projected coordinate system (not 3857).
- Must be capable of returning segment geometry (polylines). The SpatialReference return parameter must indicate the coordinate reference system of the returned segment data.
- Returned attributes must include full street name (and city or municipality as a separate attribute, if map service covers more than a single city or municipality).
- Centerlines must break at intersection crossings.
Geocode Service Requirements
- Able to geocode an intersection (e.g., W Main Ave & Elm St).
- Able to geocode an address (e.g., 123 Main Street). This is only required when crash data references locations by address.
- Capable of a findAddressCandidates operation.
- Primary input fields (one or both acceptable):
- Single line input
- Street or Address (and City, if data set includes more than one city or municipality)
- Additional required input fields: outFields, outSR
- Preferred spatial reference in an appropriate local projected coordinate system (not 3857).
- Preferred intersection connector: &
- Geocoded points should be placed on the corresponding street center line(s) from the Map Service.
- Returned data must include SpatialReference, and Candidates list, each candidate including address, location, score and attributes. The SpatialReference return parameter must indicate the coordinate reference system of the returned location data.
- Candidate attributes should include an ‘Addr_type’ with possible values: address, streetaddress, intersection, or streetint.
- For agencies, such as counties, that encompass multiple cities and unincorporated areas that may have similar street names, the locator must be capable of accepting a qualifier such as city name to assure a successful result.
- For larger agencies (such as an MPO, COG or state DOT) that encompass multiple incorporated cities and counties, the locator must be capable of accepting necessary qualifiers to be able to return the proper locations.
Print Service Requirements
- Provide an “Export Web Map Task” endpoint.
- Required input fields: Web_Map_as_JSON, Format, Layout_Template, f.
- Web_Map_as_JSON field must accept the format outlined in the Export Web Map Specification (see ESRI documentation link below).
Solution
Examples and documentation for each required service type are available below:
Street Centerline Map Service
- Example Request: https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer/identify?geometryType=esriGeometryPoint&geometry=-104.989471%2C39.780229&sr=4326&layers=all%3A0&time=&layerTimeOptions=&layerdefs=&tolerance=10&mapExtent=-119%2C38%2C-121%2C41&imageDisplay=400%2C300%2C96&returnGeometry=true&maxAllowableOffset=&f=pjson
- Example Response:
{ "results" : [ { "layerId" : 0, "layerName" : "ushigh", "value" : "Multi-Lane Divided", "displayFieldName" : "TYPE", "attributes" : { "OBJECTID" : "163", "Shape" : "Polyline", "LENGTH" : "181.315", "TYPE" : "Multi-Lane Divided", "ADMN_CLASS" : "Interstate", "TOLL_RD" : "N", "RTE_NUM1" : "76", "RTE_NUM2" : "", "ROUTE" : "Interstate (CO) 76", "Shape_Length" : "3.229986" }, "geometryType" : "esriGeometryPolyline", "geometry" : { "spatialReference" : { "wkid" : 4326 }, "paths" : [ [ [-104.993174210508, 39.813249116825], ...(additional geometry removed for space constraints)... [-102.14287153145, 41.0157740405192] ] ] } }, { "layerId" : 0, "layerName" : "ushigh", "value" : "Multi-Lane Divided", "displayFieldName" : "TYPE", "attributes" : { "OBJECTID" : "164", "Shape" : "Polyline", "LENGTH" : "91.392", "TYPE" : "Multi-Lane Divided", "ADMN_CLASS" : "Interstate", "TOLL_RD" : "N", "RTE_NUM1" : "25", "RTE_NUM2" : "", "ROUTE" : "Interstate 25", "Shape_Length" : "1.326403" }, "geometryType" : "esriGeometryPolyline", "geometry" : { "spatialReference" : { "wkid" : 4326 }, "paths" : [ [ [-104.993174210508, 39.813249116825], ...(additional geometry removed for space constraints)... [-104.859014557709, 41.108704782616] ] ] } } ...(additional results removed for space constraints)... ] }
- ESRI documentation
Intersection and Address Geocode Service
- Example Request: https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Locators/ESRI_Geocode_USA/GeocodeServer/findAddressCandidates?Address=S+Public+Rd+%26+W+Emma+St&City=Lafayette&State=CO&Zip=&outFields=*&outSR=&f=pjson
- Example Response:
{ "spatialReference" : { "wkid" : 4326 }, "candidates" : [ ...(additional results removed for space constraints)... { "address" : "S PUBLIC RD & W EMMA ST, LAFAYETTE, CO, 80026", "location" : { "x" : -105.09045499999991, "y" : 39.994276000000127 }, "score" : 89, "attributes" : { "Addr_type": "StreetInt" ...(additional attributes removed for space constraints)... } }, { "address" : "S PUBLIC RD & W EMMA ST, LAFAYETTE, CO, 80026", "location" : { "x" : -105.09045499999991, "y" : 39.994276000000127 }, "score" : 89, "attributes" : { "Addr_type": "StreetInt" ...(additional attributes removed for space constraints)... } }, { "address" : "S PUBLIC RD & E EMMA ST, LAFAYETTE, CO, 80026", "location" : { "x" : -105.09045499999991, "y" : 39.994276000000127 }, "score" : 78, "attributes" : { "Addr_type": "StreetInt" ...(additional attributes removed for space constraints)... } } ...(additional results removed for space constraints)... ] }
- ESRI documentation
- Geocode Service REST API:
- General information on geocoding and creating address locators: https://desktop.arcgis.com/en/arcmap/latest/manage-data/geocoding/what-is-geocoding.htm
- Publishing a geocode service: https://desktop.arcgis.com/en/arcmap/latest/manage-data/geocoding/publishing-a-geocode-service.htm
- Geocode service properties: https://desktop.arcgis.com/en/arcmap/latest/manage-data/geocoding/setting-geocode-service-properties.htm
Print Service
- ESRI documentation:
- Export Web Map Task: http://utility.arcgisonline.com/arcgis/sdk/rest/#/Export_Web_Map_Task/02ss000000mv000000
- Export Web Map Specification: https://utility.arcgisonline.com/arcgis/sdk/rest/index.html#//02ss000000n0000000
Was this article helpful?
0 out Of 5 Stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
5