Skip to content

Unexpected type for model.crs #239

@wraseman

Description

@wraseman

When working with GeoDataFrames, the coordinate reference system (CRS) is stored as a pyproj.CRS object: geopandas.GeoDataFrame.crs. So in swmmio, I expected to get the same behavior when calling model.crs and model.links.geodataframe.crs. However, I realized that the first returns a str and the second returns pyproj.CRS.

Example:

from swmmio.examples import philly
import copy

model = copy.deepcopy(philly)

print(f'Data type of model.crs: {type(model.crs)}')
print(f'Data type of model.links.geodataframe.crs: {type(model.links.geodataframe.crs)}')

Output:

Data type of model.crs: <class 'str'>
Data type of model.links.geodataframe.crs: <class 'pyproj.crs.crs.CRS'>

I could see a benefit to aligning model.crs with the GeoPandas convention. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions