New pyproj.CRS based interface for the .crs in GeoPandas
See original GitHub issueThere 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 apyproj.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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:26 (23 by maintainers)
Top GitHub Comments
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), whileconda 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).
Update on cartopy/rasterio:
cartopy
currently supports PROJ 6+ on theconda-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 therasterio
build is in progress on conda-forge here.