-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
libgeos/geos
#1345Description
What is the bug?
An empty geometry has a Distance to another geometry of 0; it would be better to raise an error, as this calculation is essentially undefined. For example, Python would would raise a TypeError if a user entered something like 1 > None .
Steps to reproduce the issue
Using the Python bindings:
line1=ogr.CreateGeometryFromWkt("LINESTRING EMPTY")
line2=ogr.CreateGeometryFromWkt("LINESTRING (0 0,5 5)")
line1.Distance(line2)
>>> 0.0Versions and provenance
Reproduced on Windows 11, GDAL 3.9.0 (OSGeo4W) and Ubuntu 22.04, GDAL 3.8.5 (built from source).
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels