question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New pyproj.CRS based interface for the .crs in GeoPandas

See original GitHub issue

There has been some discussion lately about pyproj / the projection library dependency, eg https://github.com/geopandas/geopandas/pull/885 (which proposed to remove pyproj dependency in favor of fiona, which also relates to https://github.com/geopandas/geopandas/issues/315) and https://github.com/geopandas/geopandas/issues/965 about pyproj 2 compatibility.

~Short term~: we need to guarantee compatibility with the new proj 6 / pyproj 2. This already has been done in https://github.com/geopandas/geopandas/pull/962. I think this should fully guarantee backwards compatibility in user behaviour, given that we still use proj4 strings internally to store the CRS.

Long term:

  • We should at least update the internal representation of the CRS, to no longer use the sub-optimal proj4 strings. Similarly to what rasterio has done (and fiona will do), we could use the WKT instead as the canonical format (https://github.com/mapbox/rasterio/pull/1597).

  • In addition, we could also more fully adopt the new pyproj.CRS (pyproj >= 2) class as the internal and user facing representation of the CRS: gdf.crs would return a pyproj.CRS class. This would give a more complete user experience: instead of a “dumb” string, we get access to a rich CRS class that can be inspected (eg is it projected?) or converted to other formats

@snowman2 started a PR for this: https://github.com/geopandas/geopandas/pull/998. But let’s use this issue for the general discussion.

cc @geopandas/collaborators

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:26 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
martinfleiscommented, Oct 2, 2019

Update on the state of geo stack.

Doing conda create -n test-geo geopandas cartopy rasterio using default channel will get pyproj1.9.6 (and also Geopandas 0.4.1), while conda create -n test-geo geopandas cartopy rasterio -c conda-forge will give pyproj 2.3.1.

So it seems to me that we are ready to roll out CRS class as there should not be dependency clash anymore (using conda-forge).

1reaction
snowman2commented, Aug 14, 2019

Update on cartopy/rasterio:

  • cartopy currently supports PROJ 6+ on the conda-forge channel and merged in the change to support PROJ 6 here.
  • rasterio just released a version compatible with GDAL 3+ & PROJ 6+ (1.0.25) release notes. Currently the rasterio build is in progress on conda-forge here.
Read more comments on GitHub >

github_iconTop Results From Across the Web

GeoPandas now uses pyproj.CRS and catches up with PROJ 6
CRS to represent the Coordinate Reference System of a GeoDataFrame. This brings along a better user interface, many changes and improvements ...
Read more >
Managing Projections — GeoPandas 0.12.2+0.gefcb367.dirty ...
The Coordinate Reference System (CRS) is important because the geometric shapes in a GeoSeries or GeoDataFrame object are simply a collection of coordinates...
Read more >
Use pyproj new projection initialization method when setting a ...
Question. Is it already possible to write some GeoPandas code that corresponds to the new* pyproj projection initialization method using < ...
Read more >
GeoPandas on Twitter: "GeoPandas 0.7.0 is released! The most ...
The most important change is that the .crs attribute no longer gives a proj4 ... CRS gives a nicer user interface, but might...
Read more >
Geopandas' "to_crs" function won't work with Orthographic ...
geopandas depends on pyproj for CRS projections. (It is installed when you install geopandas); pyproj installs a database of CRS when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found