AnsweredAssumed Answered

Remove doughnut polygons

Question asked by jamesfreddyc on Sep 10, 2018
Latest reply on Sep 12, 2018 by jamesfreddyc

My code is expecting a single ring of coordinates that will convert into arcpy.Polygon(<polyArray>, <desired spatial ref>) and has worked just fine.  However, there some instances where multiple rings are encountered (doughnut polys) and I now need to handle appropriately.

 

Dissolve, exterior ring/poly, etc. any ideas or assistance to convert the following JSON into a SINGLE arcpy.Polygon()???

 

Thanks!

 

{
  "features": [
    {
      "geometry": {
        "rings": [
          [
            [
              -9101613.3137,
              3036108.4844999984
            ],
            [
              -9101624.0627,
              3036107.2901999988
            ],
            [
              -9101637.9523,
              3036107.067400001
            ],
            [
              -9101702.9795,
              3036105.580600001
            ],
            [
              -9101714.2895,
              3036105.3200999983
            ],
            [
              -9101716.2594,
              3036335.3596
            ],
            [
              -9101603.4394,
              3036337.8596
            ],
            [
              -9101604.4099,
              3036452.850299999
            ],
            [
              -9101605.0145,
              3036567.2518999986
            ],
            [
              -9101593.5307,
              3036568.089899998
            ],
            [
              -9101492.4093,
              3036570.249499999
            ],
            [
              -9101379.5599,
              3036572.659699999
            ],
            [
              -9101378.65,
              3036457.8000999987
            ],
            [
              -9101153.0394,
              3036462.66
            ],
            [
              -9101152.4496,
              3036393.209899999
            ],
            [
              -9101152.0695,
              3036347.8797999993
            ],
            [
              -9101377.6404,
              3036342.839400001
            ],
            [
              -9101374.448,
              3036230.3060000017
            ],
            [
              -9101373.2537,
              3035998.6063
            ],
            [
              -9101601.3704,
              3035993.828899998
            ],
            [
              -9101600.1761,
              3036107.2901999988
            ],
            [
              -9101600.445,
              3036118.136
            ],
            [
              -9101613.3137,
              3036108.4844999984
            ]
          ],
          [
            [
              -9101602.5648,
              3036201.642099999
            ],
            [
              -9101603.7591,
              3036165.8123000003
            ],
            [
              -9101601.3704,
              3036139.5370000005
            ],
            [
              -9101600.8702,
              3036135.285100002
            ],
            [
              -9101602.5248,
              3036202.0218
            ],
            [
              -9101602.5648,
              3036201.642099999
            ]
          ],
          [
            [
              -9101600.7696,
              3036290.5020999983
            ],
            [
              -9101600.6783,
              3036280.322900001
            ],
            [
              -9101600.1761,
              3036281.6620999984
            ],
            [
              -9101600.7696,
              3036290.5020999983
            ]
          ]
        ]
      }
    }
  ]
}

Outcomes