You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The advantage of using Path-lib is that it comes with some handy and very frequently used methods. Common packages ((geo)pandas, rasterio, etc) support Path-objects.
E.g.
from pathlib import Path
delft3dfmpy_path = Path(r'd:\repositories\delft3dfmpy')
data_path = delft3dfmpy_path.joinpath('data')
If you supply a Path-object to the read_gml method one gets the following error as ogr.Open(gml_path) does not accept Path-objects.
The advantage of using Path-lib is that it comes with some handy and very frequently used methods. Common packages ((geo)pandas, rasterio, etc) support Path-objects.
E.g.
from pathlib import Path
delft3dfmpy_path = Path(r'd:\repositories\delft3dfmpy')
data_path = delft3dfmpy_path.joinpath('data')
If you supply a Path-object to the read_gml method one gets the following error as ogr.Open(gml_path) does not accept Path-objects.
suggested edit: ogr.Open(str(gml_path))
Current error:
RuntimeError Traceback (most recent call last)
in
3
4 # Branches
----> 5 hydamo.branches.read_gml(data_path.joinpath('gml/hydroobject.gml'), index_col='code', clip=hydamo.clipgeo)
6 hydamo.branches['ruwheidstypecode'] = 4
7
C:\Anaconda3\envs\delft3dfmpy\lib\site-packages\delft3dfmpy\datamodels\common.py in read_gml(self, gml_path, index_col, groupby_column, order_column, column_mapping, check_columns, check_geotype, clip)
177
178 ogr.UseExceptions()
--> 179 gml = ogr.Open(gml_path)
180 layer = gml.GetLayer()
181 layerDefinition = layer.GetLayerDefn()
C:\Anaconda3\envs\delft3dfmpy\lib\site-packages\osgeo\ogr.py in Open(*args, **kwargs)
7798 def Open(*args, **kwargs):
7799 """Open(char const * utf8_path, int update=0) -> DataSource"""
-> 7800 return _ogr.Open(*args, **kwargs)
7801
7802 def OpenShared(*args, **kwargs):
RuntimeError: not a string
The text was updated successfully, but these errors were encountered: