Select to view content in your preferred language

Edit Function to explode multi-part feature in silverlight

836
3
01-06-2012 10:14 AM
ArtUllman
Emerging Contributor
I need to be able to provide a function for users to explode multi-part polygons in a silverlight application.  I am using the Editor class and Geometry services for all of my other functions.  I do not see any built-in functions for exploding multi-part features either in the Editor Class, or in the Geometry Service.  The only way I can think to do this manually would be to grab the point collections, and check to see if they are clockwise or counter-clockwise so I can tell if the point collections are donuts or multi-part features.  Unfortunatelly, I don't see any built-in functions that can tell me the ring orientation.  I know that nettopology suites has some libraries, that I could possibly look into.

What is the best way for me to explode a multi-part feature in Silverlight?  It sure would be nice if the geometry service or editor class had this functionality built-in.
0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor
Yes you would have to do this manually so you are on the right track.
For ring orientation a simple method is to look for the top-most point (ie highest Y value) in a ring, and see of the previous point is to the left or right of it. (There's are some edgecases: Directly below=> check previous point. Is first vertex, check last vertex instead of previous).
0 Kudos
ArtUllman
Emerging Contributor
Thanks.  That is a really good idea for checking ring orientation.  That should make it real easy.  That solves my problem.

By the way, if the ArcGIS Server team ever runs out of things to do, I would not mind having an Explode Multi-Part feature option for the Geometry Service.  😉
0 Kudos
DeminHu
Deactivated User
Hi, Art

when I have many user drawn graphics which I need to use for query or clip, I simplify them first, otherwsie, I get uncorrect results because of drawing directions. I am not for sure this  will help you situation.

Good Luck.

Demin
0 Kudos