Skip to content

Instantly share code, notes, and snippets.

@snowman2
Last active July 9, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snowman2/2142fc217c983c42a4ed440007438b13 to your computer and use it in GitHub Desktop.
Save snowman2/2142fc217c983c42a4ed440007438b13 to your computer and use it in GitHub Desktop.
Reproject geopandas dataframe using fiona.transform.transform_geom to manage antimeridian cutting
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mazzma12
Copy link

mazzma12 commented Jul 9, 2021

Hello ! What is the version of fiona you use for this example ? I have an error with fiona=='1.8.13.post1' and GDAL 3.0.4, released 2020/01/28
Many thanks

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
AttributeError: 'CRS' object has no attribute 'encode'

Exception ignored in: 'fiona._transform._crs_from_crs'
AttributeError: 'CRS' object has no attribute 'encode'
ERROR:fiona._env:Pointer 'hSRS' is NULL in 'OSRRelease'.

@snowman2
Copy link
Author

snowman2 commented Jul 9, 2021

You will likely need to change:

src_crs=src_crs.to_wkt(),

@snowman2
Copy link
Author

snowman2 commented Jul 9, 2021

Actually, even better:

src_crs=gdf.crs.to_wkt()

@mazzma12
Copy link

mazzma12 commented Jul 9, 2021

Working ! Wornderful 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment