[gdal-dev] Polygon intersection failure

Jon Morris Jon.Morris at jbarisk.com
Tue Jul 17 07:33:42 PDT 2018


Hello all,

I'm having a problem with layer intersection and am not sure if I'm using the options correctly or if there is some functionality missing. I'm using GDAL 2.2.0 with Python 2.7.

I've got a layer of UK postcodes and a layer of UK buildings; when I run postcode_lyr.Intersection(building_lyr, out_lyr), I get RuntimeError: Attempt to write non-polygon (POINT) geometry to POLYGON type shapefile. With the option SKIP_FAILURES=YES, the intersection completes, but one postcode is left out. I get the same result when running the other way round - building_lyr.Intersection(postcode_lyr).

Is there a way of getting GDAL to only skip the bad geometry, but still add the remaining geometries for that feature? There should be three polygons in the result layer for that particular postcode. Or is there a way to find out which features have been skipped so I can go back and try and perform the intersection manually for just those features?

Thanks,

Jon

Jon Morris
Software Developer

Skype<sip:jon.morris at jbarisk.com>


T +44 (0) 1756 799919
www.jbarisk.com<http://www.jbarisk.com>

[Visit our website]<http://www.jbarisk.com> [http://www.jbagroup.co.uk/imgstore/JBA-Email-Sig-Icons-LINKEDIN.png] <https://www.linkedin.com/in/jon-morris-a2897b4/>  [Follow us on Twitter] <https://twitter.com/jbarisk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180717/78cec77e/attachment.html>


More information about the gdal-dev mailing list