How to change the geometry of a feature with code

2365
3
09-14-2015 08:23 AM
SotlarStéphane
New Contributor II

Hello,
I wonder if it was possible to modify the code by neighboring feature geometries in a geometry changed Sketchgraphic layer . I would like the neighboring geometries modified geometry is modified to fit the shape of the geometry.
thank you in advance

image sample : Geometry change with sketch graphic - A

sample.jpg

Stéphane

Tags (4)
0 Kudos
3 Replies
DavidLednik
Occasional Contributor II

Hi Stéphane!

Not exactly sure if I understood you correctly. But you can programatically trim geometries if needed. Look at the GeometryEngine and its operations. What version of SDK are you using?

David

0 Kudos
SotlarStéphane
New Contributor II

Hi david,

i have look the GeometryEngine but i'have not see that i want.

I've the sdk version 10.2.4

0 Kudos
DavidLednik
Occasional Contributor II

Thank you for the information!

What you're looking for is

(AGSGeometry *) - differenceOfGeometry:andGeometry:

This method will return the polygon which is equal to poly1 - poly2.

So if you wan't to trim existing polygons to the one you added to the layer. You will need to pass the existing first and your added as second polygon.

But first thing you will have to do is maybe buffer new geometry and then find all the polygons that this geometry intersects. This way you will get the array of neighbouring geometries. Then you just need to create a difference for each polygon in the array.

hope this helps,

David

0 Kudos