FIX: prevent crash on read nonlinear types from WKB/WKT#2160
FIX: prevent crash on read nonlinear types from WKB/WKT#2160mwtoews merged 3 commits intoshapely:mainfrom
Conversation
Pull Request Test Coverage Report for Build 11084401797Details
💛 - Coveralls |
In practice that already happened for conda-forge (the latest shapely release was rebuilt for GEOS 3.13). I don't know if this is worth doing another 2.0.7 release, or otherwise we could also add this patch in the conda-forge recipe to fix those binaries that way (someone manually building shapely with latest GEOS of course still can run in that issue) |
I don't know what is involved there, but that is indeed probably the main place to fix. So long as this goes in before wheels get built with 3.13, that is probably sufficient outside of conda-forge. |
mwtoews
left a comment
There was a problem hiding this comment.
Thanks, this is a good fix for now.
Cherry-picked from 3873635
Resolves #2159
GEOS 3.13 added support for reading nonlinear types (CircularString, CompoundCurve, MultiCurve, CurvePolygon, MultiSurface) from WKB / WKT, but these types do not exist within the shapely geometry type registry, or are they likely handled correctly in various functions where we are using conditional statements on geometry type ID. The crash is due to attempting to look up the type by index in the type registry and hitting an out-of-bounds error.
Until nonlinear types can be added more comprehensively, this prevents constructing nonlinear types after reading from WKB / WKT (when supported by GEOS) so that we don't run into crashes or unexpected behavior elsewhere in the codebase.
This adds WKT / WKB test cases from the GEOS test suite that are known to work with GEOS >= 3.13.
This should get backported to other supported versions of Shapely that would get compiled against GEOS 3.13.