Commit b86107ce authored by Claude Paroz's avatar Claude Paroz
Browse files

Fixed #24114 -- Improved error message in GEOSGeometry constructor

parent 07988744
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -71,8 +71,10 @@ class GEOSGeometry(GEOSBase, ListMixin):
            elif hex_regex.match(geo_input):
                # Handling HEXEWKB input.
                g = wkb_r().read(force_bytes(geo_input))
            elif gdal.HAS_GDAL and json_regex.match(geo_input):
            elif json_regex.match(geo_input):
                # Handling GeoJSON input.
                if not gdal.HAS_GDAL:
                    raise ValueError('Initializing geometry from JSON input requires GDAL.')
                g = wkb_r().read(gdal.OGRGeometry(geo_input).wkb)
            else:
                raise ValueError('String or unicode input unrecognized as WKT EWKT, and HEXEWKB.')