[gdal-dev] python - intersecting linestrings to polygon

DeTracey, Brendan Brendan.DeTracey at dfo-mpo.gc.ca
Wed Jan 13 12:28:08 PST 2021


Hi,

An image of my multiline can be seen in this post (https://gis.stackexchange.com/questions/384213/ogr-buildpolygonfromedges-fails-on-my-multiline). I am trying to extract the largest polygon contained by the lines. As you can see in the figure, one of the linestrings has only 2 points. One of the linestrings has 3 points. The remaining linestrings have many points. What is the suggested workflow to solve this problem?

Both Polygonize and BuildPolygonFromEdges fail, even if I segmentize my multiline.  Must I first trim all linestrings to their intersectional segments? Or break them into all the pieces from all intersections?

Thanks,
Brendan

------------------------------------------
Brendan DeTracey
brendan.detracey at dfo-mpo.gc.ca<mailto:brendan.detracey at dfo-mpo.gc.ca>
(902)426-9727, VS 308-30, Mail Station VS240
Ocean Monitoring and Observation Section / Section de Monitorage et Observation de l'ocean
Ocean and Ecosystem Sciences Division / Division des sciences de la mer et de l'écosystème
Fisheries and Oceans Canada / Pêches et océans Canada
Bedford Institute of Oceanography / Institut océanographique de Bedford
P.O. Box 1006 / C.P. 1006
Dartmouth, NS  B2Y 4A2 / Dartmouth, N.-É.  B2Y 4A2
Government of Canada / Gouvernement du Canada
If you have received this communication by mistake, please notify the sender immediately and delete the communication without printing, copying or forwarding it. Thank you.
Si vous avez reçu cette communication par erreur, veuillez en aviser l'expéditeur immédiatement et la supprimer sans l'imprimer, la copier, ou la faire suivre. Merci.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210113/2c3a2d8f/attachment.html>


More information about the gdal-dev mailing list