DOV-Vlaanderen / pydov

Python package to retrieve data from Databank Ondergrond Vlaanderen (DOV)

Home Page:https://pydov.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SonderingSearch error when getting the UUID

f-vn opened this issue · comments

commented
  • PyDOV version: 2.2.2
  • Python version: 3.9
  • Operating System: W11 v.22H2 build 22621.819 (x64)

New to python and pyDOV. I am using pyDOV to search CPT measurements (SonderingSearch):
path = r".\input\zone.shp"
shape = gpd.read_file(path)
zone = shape.geometry[0].convex_hull
x_min,y_min,x_max,y_max = zone.bounds
rand = 0
sonderingsearch= SonderingSearch()
df_sondering=sonderingsearch.search(location= Within(Box(x_min-rand,y_min-rand,x_max+rand,y_max+rand)))

However I keep getting an error on line 157 of pydov\util\owsutil.py : len(md_metadata.contentinfo) > 0 else None returning AttributeError: 'NoneType' object has no attribute 'contentinfo'. Even within a larger area (ex. rand = 500) I get the same error.

Code worked previously (last week), so I don't get what I'm doing wrong here. Anyone with the same issue? Any help is much appreciated!

Thank you for your report! There was an issue with the DOV metadata center, causing issues in pydov too. It should be back online now, can you try again?

For your information, you can also search for all objects within a shapefile using the GeometryFilter:

from pydov.search.sondering import SonderingSearch
from pydov.util.location import Within, GeometryFilter

path = "input.shp"
sonderingsearch = SonderingSearch()
df_sondering = sonderingsearch.search(location=GeometryFilter(path, Within))

(This is the same issue as #355 and #364)

commented

Thanks for your help, the code runs fine now! I searched the previously mentioned issues but didn't notice this was the same issue.

No worries, glad it's working now :)