tomalrussell / snkit

spatial networks toolkit (python)
MIT License
31 stars 10 forks source link

Network.set_CRS method with init is deprecated #48

Closed thomas-fred closed 1 year ago

thomas-fred commented 2 years ago

FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 in_crs_string = _prepare_from_proj_string(in_crs_string)

This means you can't do things like network.edges.crs.to_epsg() (you just get None back). If you set the CRS on the edges manually with network.edges.set_crs(epsg=<epsg_code>) then to_epsg() does work.

I've experienced difficulty retrieving a CRS set with Network.set_crs when round tripping a network to disk as GPKG.

See: https://pyproj4.github.io/pyproj/stable/gotchas.html#min-confidence

Suggest Network.set_crs simply delegates to geopandas to set the CRS of nodes and edges.

tomalrussell commented 1 year ago

Closed by e7bcc26