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
This probably has to do with an inconsistency between shapely and geopandas. Did you use geopandas 0.8.2 and shapely 1.8.0? If not update (or downdate) to that combination. Note that delft3dfmpy is deprecated; you can now use dhydamo in hydrolib 0.2.0.
I got the following error while trying to load branches from the example data::
TypeError Traceback (most recent call last)
Cell In[15], line 5
2 gpkg_file = "C:/Users/ngra/Documents/Python Scripts/Dhydro_Model/delft3dfmpy-master/data/gpkg/Example_model.gpkg"
4 # branches
----> 5 hydamo.branches.read_gpkg_layer(gpkg_file, layer_name="hydroobject", index_col="code")
File ~\Anaconda3\lib\site-packages\delft3dfmpy\datamodels\common.py:235, in ExtendedGeoDataFrame.read_gpkg_layer(self, gpkg_path, layer_name, index_col, groupby_column, order_column, id_col, column_mapping, check_columns, check_geotype, clip)
233 pattern = "^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$"
234 for i,f in enumerate(features):
--> 235 geometry = wkb.loads(georefs[i].ExportToWkb())
236 if(geometry.type=='MultiPolygon')|(geometry.type=='MultiPoint'):
237 new_geoms = list(geometry)
File ~\AppData\Roaming\Python\Python39\site-packages\shapely\wkb.py:23, in loads(data, hex)
21 return reader.read_hex(data)
22 else:
---> 23 return reader.read(data)
File ~\AppData\Roaming\Python\Python39\site-packages\shapely\geos.py:418, in WKBReader.read(self, data)
415 def read(self, data):
416 """Returns geometry from WKB"""
417 geom = self._lgeos.GEOSWKBReader_read(
--> 418 self._reader, c_char_p(data), c_size_t(len(data)))
419 if not geom:
420 raise WKBReadingError(
421 "Could not create geometry because of errors "
422 "while reading input.")
TypeError: bytes or integer address expected instead of bytearray instance
The text was updated successfully, but these errors were encountered: