Using the ArcGIS JavaScript 3.2x API, what would be the most efficient way to explode/break apart a multi-part polygon, yet retain those shapes that have holes in them as a single polygon?
Obviously we could extract all the rings into individual polygons, but then the 'holes' become polygons, and the original 'donut' looses it's hole.
We could step through every ring, check it's direction and test whether it's inside/outside of every other ring, but that seems over the top.
Any suggestions on the most efficient way to do it?
cheers
-Paul
Solved! Go to Solution.
Paul,
We could step through every ring, check it's direction and test whether it's inside/outside of every other ring, but that seems over the top.
There is no other way that I am aware of. Explode is something that is a Desktop operation that ArcObjects can handle easily but the JS API will be pretty slow at an operation like this.
Paul,
We could step through every ring, check it's direction and test whether it's inside/outside of every other ring, but that seems over the top.
There is no other way that I am aware of. Explode is something that is a Desktop operation that ArcObjects can handle easily but the JS API will be pretty slow at an operation like this.
Thanks Robert.
It seems like a classic example of where there should be built-in methods. Maybe something for the future of the 4.x API!
cheers,
-Paul