Geometry is not supported

3745
4
Jump to solution
11-04-2014 05:09 AM
Harald_ØysteinLund
New Contributor

Hi, I'm new to ArcGIS Runtime SDK for .Net, but have been working with ArcGIS since the beginning. Anyway, I'm now playing with this API to learn this by my self. I'm struggling with a sample code clipped from the FeatureLayerEditGeometry in the GITHub Project ArcGISRuntimeSDKDotNet_Desktop.

I've copied the code and pasted it into my own solution where I do some modification to fit my data.

In the line

var geometry = await MyMapView.Editor.EditGeometryAsync(feature.Geometry);

it fails withe the following error when the geometry type is a Point: Geometry type is not supported. It Works fine for lines and polygons.

Can't find anything in the documentation that EditGeometryAsync doesn't support Point geometry, and can't understand that Point either shouldn't be supported.

Any one else out there experience this behaviour?

Regards

Harald Lund

0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Occasional Contributor III

You can use RequestPointAsync to get point.

var geometry = await editor.RequestPointAsync();

You can handle point case by replacing it and in with other types, edit it.

if (feature.Geometry.GeometryType == GeometryType.Point)

  geometry = await editor.RequestPointAsync(); // cannot "edit" points, replace it with the new one

else

  geometry = await editor.EditGeometryAsync(feature.Geometry); // edit geometry

View solution in original post

0 Kudos
4 Replies
AnttiKajanus1
Occasional Contributor III

You can use RequestPointAsync to get point.

var geometry = await editor.RequestPointAsync();

You can handle point case by replacing it and in with other types, edit it.

if (feature.Geometry.GeometryType == GeometryType.Point)

  geometry = await editor.RequestPointAsync(); // cannot "edit" points, replace it with the new one

else

  geometry = await editor.EditGeometryAsync(feature.Geometry); // edit geometry

0 Kudos
Harald_ØysteinLund
New Contributor

Hi,

Thank you for your quick respons!

Ok, I've seen that, but thought that EditGeometryAsync would handle Points as well. I'll check this out and see if this fits my need of point edit handling.

0 Kudos
Harald_ØysteinLund
New Contributor

Thank you again for your answer.

This approach would work, and probably is the way to do edit point anyway.

Harald

0 Kudos
AnttiKajanus1
Occasional Contributor III

Happy to help. I marked this answered.