Access measure value of point on feature in featureLayer?

3416
10
04-13-2012 11:11 AM
ChrisChalstrom
New Contributor
Hi,

I have a feature layer set up in ArcMap 10.  This feature layer is composed of a set of polylines. 
I followed the steps at this URL:
http://eaglemap.com/blog/bid/46805/How-to-Add-Measure-Station-Values-to-Pipelines-in-ArcMap
to set up a route that has M values for each vertex in the polyline.  When I start editing -> double click a line -> click sketch properties, I can see that the M value has been correctly set for each vertex.

How can I access this information via the javascript API?  I have a feature layer set up with this feature layer added to it.  But when I click the feature layer, I can't get the measure information.  I can get the e.graphic.geometry and so on, but there isn't measure info associated with any of the points.

What would be even better is if I could get the exact measure value for a specific point on the line (a point that is not necessarily the same as any vertex which composes the line).  Is it possible to do this with the javascript API?  If so, how?

Thanks
0 Kudos
10 Replies
derekswingley1
Frequent Contributor II
Not currently possible. We will support M's sometime in the future but it will require ArcGIS Server 10.1 and a 3.x version of the API.

Have you considered publishing your data with M values as a regular attribute? That would give you access to them via the JS API.
0 Kudos
nicogis
MVP Frequent Contributor

If you need now of this functionality I have create a simple soe where you can return measure M or create a point from M. http://www.arcgis.com/home/item.html?id=e3bfa7c991e34aa8872c937ca9169507

I also have added the test project (live) in js api esri.

Live:
http://www.studioat.eu/js/samples/dsutility/

0 Kudos
SteveBurdette
Occasional Contributor

Given the latest version of ArcGIS Server and the latest Javascript API, what is the best method to 1) get measures down an m polyline based on a user click on the line and 2) dynamically displaying point values on a polyline based on a table of measured events down that line?  

0 Kudos
nicogis
MVP Frequent Contributor

You can use my soe for get measures down an m polyline based on a user click on the line. For dynamically displaying point values on a polyline based on a table of measured events down that line depends if you have yet set in service this configuration or you need create on the fly the table and create the visualization on the fly. For this second approch I use a my soe.  Esri has an Extension Desktop and Server for manager LRS http://desktop.arcgis.com/en/desktop/latest/guide-books/extensions/roads-and-highways/esri-roads-and... see also: http://blogs.esri.com/esri/arcgis/2011/08/19/a-server-object-extension-for-performing-dynamic-segmen...

0 Kudos
SteveBurdette
Occasional Contributor

Thank you...we loaded your soe onto our server with no issues and it is working well for us.  It is exactly what we needed.  Great job on this extension.

0 Kudos
SteveBurdette
Occasional Contributor

The dynamic segmentation utility has been very helpful.  It seems, though, that the routeMeasureUnit parameter is not affecting the output at all.  I can enter esriMeters or esriMiles and I get the same output.  Does the service default to esriMeters?  Have you seen this same behavior in your use of the utility? 

Thanks,

Steve

0 Kudos
nicogis
MVP Frequent Contributor

Yes, I have same behavior. In code I have checked and I set the routeMeasureUnit correctly but there's something I don't get! Peraphs I need get unit of spatial reference and convert manually unit but in these case I don't understand use of the property routeMeasureUnit    

0 Kudos
SteveBurdette
Occasional Contributor

Thanks again for this utility...it has been very helpful.  In my application I have a set of data that contains mile points and I am using these mile points to draw lines/points along the route.  So, I initially tried to use esriMiles as my route unit, but I was getting the same results as when I used esriMeters as my units. 

To get around the issue I'm converting from miles to meters before I make the utility PointLocation and LineLocation service calls, so I'm able to work around it.  Just thought I would let you know in case there is an easy fix to the issue. 

Thanks again,

Steve

0 Kudos
nicogis
MVP Frequent Contributor

I have fixed Thanks

0 Kudos