VeinsOfTheEarth/RivGraph

Prune nodes produces error from processing inlet nodes

Lvulis opened this issue · 1 comments

When running prune_network in the default configuration, find_inlet_nodes from delta_utils produces an error. It arises from:

inlets_epsg = int(inlets_gpd.crs['init'].split(':')[1])  
#this returns TypeError: 'CRS' object is not subscriptable

I use an inlet nodes file with projection EPSG 32603 - the same one I used in a much older version. I replaced the line with this code below which worked, outputted 32603 and the section ran. I was also given a warning that 'init' is being deprecated, may be a result of that.

inlets_epsg = inlets_gpd.crs.to_epsg()

Data found here
Yukon_inlet_nodes.zip

I get no errors or warnings for this. What version of geopandas do you have?
import geopandas
print(geopandas.__version__)

It appears that geopandas (pyproj, actually) is transitioning away from the {'init':'epsg:XXXX'} format. .crs will return an 'CRS' object as indicated by your TypeError.

You can either downgrade to geopandas 0.5 or use your workaround for now. I'll put it on the todo list.