Hi,
I have GeoJson data in the collection loaded as feature with documents mix of type Polygon and MultiPolygon. I want to convert all the MultiPolygon to Polygon geometry.
Please find below sample structure:
MultiPolygon:
{"_id":"tmpolygon","geometry":{"coordinates":[[[[-71.761012,44.407034],[-71.756092,44.406401],[-71.761012,44.407034]]],[[[-68.960075,44.100967],[-68.938785,44.123521],[-68.960075,44.100967]]]],"type":"MultiPolygon"},"properties":{"CODE":"xxx","LABEL":"yyy","NAME":"abc"},"type":"Feature"}
Polygon:
{"_id":"tpolygon","geometry":{"coordinates":[[[-85.945558,41.04287],[-85.926331,41.042594],[-85.945558,41.04287]]],"type":"Polygon"},"properties":{"CODE":"xxxx","LABEL":"yyyy","NAME":"ABC"},"type":"Feature"}
Is there any way using mongo query I can convert multipolygon to polygon? Appreciate in advance for any help.