Select Polyline (save attributes)

2444
6
07-26-2011 09:25 AM
AaronDrake
New Contributor
The following code will select point and polyline features in a web editing application I am working on.  I can save any attribute changes I make to the point features.  However, when I attempt to save changes to a polyline feature class I get the following (via Firebug):

Firebug Output:
{"addResults":[],"updateResults":[{"objectId":2427,"globalId" : null,"success":false,"error":{"code":-2147221399,"description":"Geometry does not have M Value(s), hence cannot update the feature."}}],"deleteResults":[]}

I used the polyline feature class on arcgis.com, and was able to save the attributes.


   
var ext = new esri.geometry.Extent(evt.mapPoint.x - 50, evt.mapPoint.y - 50, evt.mapPoint.x + 50, evt.mapPoint.y + 50, mapSR);
selectQuery.geometry = ext;

FL.selectFeatures(selectQuery, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {
if (features.length > 0) {
     //store the current feature
     updateFeature = features[0];
     map.infoWindow.setTitle(FL.name); 
     map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
} else {
     alert('No features selected!');
     map.infoWindow.hide();
}
    });
0 Kudos
6 Replies
ab1
by
Occasional Contributor II
Hello Aaron,

Have you found any solution to your problem?
I have the same error. I'm trying to save geometry edits on a polyline feature.
0 Kudos
DianaBenedict
Occasional Contributor III
According to ESRI documentation, you are not able to update existing polyline feature classes that are M-aware.  You can create new features that have an m value of NaN or you can delete existing polyline features but you can not modify existing polyline features with m values/m-aware. 

Note that you can test this by creating a new polyline feature class that is not M-aware.

Someone, please correct me if I am wrong.

Hope this helps.

Diana
0 Kudos
ab1
by
Occasional Contributor II
My polylines are not m-aware. I just want to modify polylines. I don't need to create them.
0 Kudos
AaronDrake
New Contributor
I was not able to get it to work with M-aware feature classes.  I ended up exporting the polyline feature classes, and removing the M-aware functionality.  I then imported them back in to SDE, and set them up as Feature Layers.  I was then able to save edits on the features...
0 Kudos
DianaBenedict
Occasional Contributor III
Aaron

Thank you for confirming my suspicions.  I am not sure when ESRI will support editing functionality for m-aware polyline featureclasses from within their Feature Services.  I have done a lot of Desktop ArcObjects development and we had to manually manage the m-aware values when users were actively modifying geometry of current features.  Essentially, we set the m-values to NaN (not a number) in order to ensure that m-values were not improperly indicated.  Not sure why this couldn't be done within their web editing functinoality...or at least provide the Feature Service with an option to allow editing of features with m-values.  Something like a "check box" to indicate to allow editing of m-aware feature classes and to set existing m-value to "NaN" when updating the geometry of existing features. 

Currently the only option for editing m-aware feature classes over the web is to replicate your SDE feature classes and remove all m-aware feature classes (essentially what you did).  Doesn't seem like a very streamlined workflow.
0 Kudos
ab1
by
Occasional Contributor II
Thank you all for your feedbacks 🙂
0 Kudos