Skip to content

Manage CRS from new geopandas release #71

@PyMap

Description

@PyMap

Hi all! With new gepandas release, the pyproj.CRS object has been enriched and the old way (pyproj4) to specify projection as parameter (`crs') seems to have changed considerably.

When you try to plot a gd over a a layer with display method:

# 1. Plot data:
ax = gdf.plot()

# 2. Display dinamic map
mplleaflet.display(fig=ax.figure, crs=ax.crs)

The following error is returned:

TypeError: type object argument after ** must be a mapping, not CRS

This is seems to be explained because CRS with new geopandas release has a new obtect type.

Passing the crs with the .to_dict() this error doesn't appears again, but as I'm still getting some warnings like this one:

UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See: https://proj.org/faq.html#what-is-the-best-format-for-describing-coordinate-reference-systems
  proj_string = self.to_proj4()

I would like to know if this is the correct way to pass the gdf.crs as parameter in the display method.

Great work wit this library, much thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions