Select to view content in your preferred language

Clone geometries

1109
3
08-22-2017 03:09 AM
ManelKEDDAR
Deactivated User

Hello , Is there any way methods to clone geometries using arcgis runtime v100.1 ? i've checked the API references and i saw it's possible to clone only layers , symbols , maps ,ect but there's no geometries cloning ? for example MapPoint cloning ?

Thanks

0 Kudos
3 Replies
AnttiKajanus1
Deactivated User

Hi,

Geometries are immutable by nature so you if your workflow is to copy the geometry and then doing edits into it, you should use GeometryBuilders such as MapPointBuilder Class. These behaves similarly to StringBuilder and when you have done with the edits just call GeometryBuilder(T).ToGeometry Method method to get the final geometry out.

Hope that helps.

ManelKEDDAR
Deactivated User

Thanks that really helped me 

0 Kudos
dotMorten_esri
Esri Notable Contributor

There's a couple of ways it can be done. Here's two:

Polygon p = new Polygon(...);
var p2 = new PolygonBuilder(p).ToGeometry();
var p3 = new Polygon(p.Parts, p.SpatialReference);

0 Kudos