Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shapely::geos.py issue #524

Open
msl3v opened this issue Sep 1, 2022 · 0 comments
Open

shapely::geos.py issue #524

msl3v opened this issue Sep 1, 2022 · 0 comments

Comments

@msl3v
Copy link

msl3v commented Sep 1, 2022

Dear OCGIS,

Thank you for this tool. It seems it's been some time since any updates have been made. I've been trying several ways to get it to work in my current linux environment. So far, I haven't found any that work. The simplest version of an error I can reliably reproduce is a type error when trying to access *geom.has_z. The error occurs in shapely::geos.py

I've tried with several versions of Python (2.7, 3.6). I'm currently working through shapely versions. I say 'simplest' error, above, since other errors seem to be deeper in the system and don't appear to be resolvable within ocgis.

Any recommendations? I'm not quite able to trace what the code is trying to do.

Thank you.

Dataset:
https://gdex.ucar.edu/dataset/camels/file/basin_set_full_res.zip

Commands & error:
import ocgis
rd = ocgis.RequestDataset('./HCDN_nhru_final_671.shp', driver=DriverKey.VECTOR)
field = rd.get()
field.geom.has_z
Traceback (most recent call last):
File "", line 1, in
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/variable/geom.py", line 294, in has_z
ret = self.get_masked_value().compressed()[0].has_z
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/variable/base.py", line 942, in get_masked_value
ret = np.ma.array(self.get_value(), mask=self.get_mask(), dtype=dtype, fill_value=self.fill_value)
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/variable/base.py", line 1311, in get_value
self._value = self.get_value()
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/variable/base.py", line 1693, in get_value
self._request_dataset.driver.init_variable_value(self)
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/driver/vector.py", line 35, in init_variable_value
value = self.get_variable_value(variable)
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/driver/vector.py", line 135, in get_variable_value
for idx, row in enumerate(g):
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/spatial/geom_cabinet.py", line 348, in iter
for row in self.sc.iter_geoms(key=self.key, select_uid=self.select_uid, path=self.path,
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/ocgis/spatial/geom_cabinet.py", line 157, in iter_geoms
yld = {'geom': wkb.loads(feature.geometry().ExportToWkb())}
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/shapely/wkb.py", line 23, in loads
return reader.read(data)
File "/home/ilcentro/.conda/envs/env1/lib/python3.9/site-packages/shapely/geos.py", line 427, in read
self._reader, c_char_p(data), c_size_t(len(data)))
TypeError: bytes or integer address expected instead of bytearray instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant