-
-
Notifications
You must be signed in to change notification settings - Fork 935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: to_crs returns inf on first call. second call correct #3433
Comments
This is certainly related to some behaviour of pyproj, so it should be likely reported there. We're just calling the same code twice from within geopandas. Maybe @snowman2 has a clue what is happening? |
Ah, my bad. Is there a way I could move the issue over or should I leave it open here? |
Keep it open, we can link from here to the issue in pyproj and close it once resolved there. |
Based on pull request #2259 in the azavea/raster-vision repository, the code attempts to download transformation grids from the internet. If the download fails, it returns infinity (inf, inf) for the coordinates and avoids further attempts to download the same transformation grids. This suggests there might be an issue with the server hosting the grids, making them temporarily unavailable, or the specific transformation grids may not exist. To resolve the issue upgrade the pyproj >= 3.7.0 |
I'm going to re-open this for now, we can close when it trickles down into a pyproj release |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of geopandas.
(optional) I have confirmed this bug exists on the main branch of geopandas.
Code Sample
Output:
Problem description
Sorry if this is a duplicate, I've just experienced the same issue and thought I'd raise it here. Hope I've done this correctly.
See:
I run to_crs() once, and it returns inf geometry. I run it a second time, and it works. (?)
Original question: when I run geopandas' .to_crs() function twice in a row on the same inputs, I get two different results.
I also explicitly set:
Following the recommendations of the second source, but this didn't fix the issue.
Expected Output
Should be the same with each run.
SYSTEM INFO
python : 3.12.6 | packaged by conda-forge | (main, Sep 30 2024, 17:48:58) [MSC v.1941 64 bit (AMD64)]
executable : c:\Users\User\AppData\Local\miniforge3\envs\otp\python.exe
machine : Windows-11-10.0.22631-SP0
GEOS, GDAL, PROJ INFO
GEOS : 3.13.0
GEOS lib : None
GDAL : 3.9.2
GDAL data dir: C:\Users\User\AppData\Local\miniforge3\envs\otp\Library\share\gdal
PROJ : 9.5.0
PROJ data dir: C:\Users\User\AppData\Local\miniforge3\envs\otp\Library\share\proj
PYTHON DEPENDENCIES
geopandas : 1.0.1
numpy : 2.1.1
pandas : 2.2.3
pyproj : 3.6.1
shapely : 2.0.6
pyogrio : 0.10.0
geoalchemy2: None
geopy : None
matplotlib : 3.9.2
mapclassify: 2.8.1
fiona : None
psycopg : None
psycopg2 : None
pyarrow : None
The text was updated successfully, but these errors were encountered: