Closed Ariana-B closed 3 months ago
@Ariana-B that sounds like broken python environment to me, pyproj
shipped libs clashing with rasterio
maybe? This creates all sorts of nasty import order dependent issues. Could also be missing proj database or proj config pointing to wrong proj data dir.
Those points are nowhere near any discontinuities. So there is an error in code: we should check that enough points survive transform from one projection to another before attempting to reconstruct original shape class in .dropna()
method, BUT equally, this should not be happening for this data and suggests an issue with pyproj
in your environment.
Real issue is: .dropna()/.filter(..)
should return empty geometry when not enough points are finite for geometry type being processed.
You're right, it seems to have been a pyproj
issue; upgrading to 3.6.1 appears to have resolved the error. Perhaps it would be worth updating the requirements, as they list pyproj>=3.0.0
.
We are not using any new features of pyproj
, most likely it's pyproj
vs PROJ lib version that got fixed in the update.
Calling
lonlat_bounds
on a valid Polygon sometimes correctly outputs a BoundingBox, but other times causes shapely to error:ValueError: A linearring requires at least 4 coordinates
. Running with python 3.11, odc-geo 0.4.5But on second and subsequent tries (no change to
p
), it works: