This solution (developed in c#) creates a SOE Rest in arcgis server 10.4 and superior for these operations:
- Identify Route M
- Set M point location
- Set M line location
- Identify Route M Ex (like Identify Route M but force snap setting RouteId) see sample test
Installation:
-
upload file Studioat.ArcGis.Soe.Rest.DSUtility.soe (see https://resources.arcgis.com/en/help/main/10.1/0154/0154000004sm000000.htm)
-
create a service map and enable the extension 'Dynamic Segmentation Utility' in capabilities. In this msd you must have at least a polylineM.
-
from service directory you can see all your polylineM layers https://hostname/instanceags/rest/services/PolylineM/MapServer/exts/DSUtility
IdentifyRoute operation (for instance) layerID = 0 https://hostname/instanceags/rest/services/yourservice/MapServer/exts/DSUtility/RouteLayers/0/IdentifyRoute
- location: Geometry Point (see rest api esri)
- tolerance: number (optional but if you don't set, soe set 0 so you could no have results)
- routeMeasureUnit: (optional (default is esriUnknownUnits)) example: routeMeasureUnit: esriMeters (see https://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004200000030000000)
- routeIDFieldName: string
- routeIDFieldName: string
- routeID: string, int or double (depends fieldtype routeIDFieldName)
- measure: double
- lateralOffset (optional default: 0)
- routeMeasureUnit: (optional (default is esriUnknownUnits)) example: routeMeasureUnit: esriMeters (see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004200000030000000)
- routeLocationMeasureUnit: (optional (default is esriUnknownUnits)) example: routeLocationMeasureUnit: esriMeters (see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004200000030000000)
- routeIDFieldName: string
- routeID: string, int or double (depends fieldtype routeIDFieldName)
- fromMeasure: double (optional if you set toMeasure)
- toMeasure: double (optional if you set fromMeasure)
- lateralOffset (optional default: 0)
- routeMeasureUnit: (optional (default is esriUnknownUnits)) example: routeMeasureUnit: esriMeters (see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004200000030000000)
- routeLocationMeasureUnit: (optional (default is esriUnknownUnits)) example: routeLocationMeasureUnit: esriMeters (see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004200000030000000)
- location: Geometry Point (see rest api esri) example: {"x":-8582617.03619766,"y":4896408.449978509,"spatialReference":{"wkid":102113}}
- routeID: string, int or double (depends fieldtype routeIDFieldName)
- tolerance: number (optional but if you don't set, you could no have results)
- routeMeasureUnit: (optional (default is esriUnknownUnits)) example: routeMeasureUnit: esriMeters (see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//004200000030000000)
- routeIDFieldName: string
- segmentExtension: (optional (default is esriNoExtension) see https://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//002m00000022000000)
In capabilities (operations allowed) you can allow these operations (IdentifyRoute (method IdentifyRoute, IdentifyRouteEx), PointLocation and LineLocation).
I have added in file zip an example in api esri javascript to see how to use it. You only need edit config.js. If missing set mime in your web server for video (mp4, ogv and webm). I have added data used for demo
The solutions are checked 100% with stylecop and fxcop.