Select to view content in your preferred language

version4.18 api, How to realize the inner cavity of one ring inside another?

1268
5
03-09-2021 10:05 PM
ruikang
Emerging Contributor
0 Kudos
5 Replies
JeffreyWilkerson
Frequent Contributor

I just set up a Python routine to do this, but it's using the Union function which very easily locates 'donuts' by uninioning only the 1 layer and closing gaps, and then searching for a missing attribute that the 'donuts' wouldn't have.  You could set up a geoprocessing service to return the polygons with donuts, but that might be more than you are looking for.

My next thought was that it would be in the 'rings' attribute of the Polygon object.  There should be a different ring for the inner 'donut' so if you parse out the separate rings and look for one being contained by the other you could determine that an 'inner cavity' existed.

0 Kudos
ruikang
Emerging Contributor

Thank you for your answer! I didn't find the right  "rings" from v418 Polygon object, but the old version(v411 or earlier) could implement the holes.

 

0 Kudos
ruikang
Emerging Contributor

I solved the problem with a geoprocessing service,thank you.

 

0 Kudos
JohnGrayson
Esri Regular Contributor

Not sure what the question is, but you should be able to find the interior ring by using the isClockwise(...) method.

0 Kudos
ruikang
Emerging Contributor

Thank you for your answer! I found that two rings in the opposite direction can form holes.

0 Kudos