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

Issue running Python Example from OS Data Hub Explorer #85

Open
mikey-heatgeek opened this issue May 11, 2023 · 1 comment
Open

Issue running Python Example from OS Data Hub Explorer #85

mikey-heatgeek opened this issue May 11, 2023 · 1 comment

Comments

@mikey-heatgeek
Copy link

I am trying to run a code snipped from https://labs.os.uk/prototyping/data-hub-explorer/

from osdatahub import NGD, Extent

key = "INSERT_API_KEY_HERE"
bbox = (-1.5017, 50.9946, -1.5001, 50.9955)
extent = Extent.from_bbox(bbox, "EPSG:4326")

collection = "bld-fts-buildingpart"
ngd = NGD(key, collection)
result = ngd.query(extent=extent)

When running in Python I get:

ERROR:root:{
    "code": 400,
    "description": "Intersection geometry 'POLYGON ((-1.5001 50.9946, -1.5001 50.9955, -1.5017 50.9955, -1.5017 50.9946, -1.5001 50.9946))' is outside the spatial extent of collection 'Building Part v1'. If the given geometry is within a supported CRS, please use the filter-crs parameter. The following coordinate reference systems are supported: http://www.opengis.net/def/crs/OGC/1.3/CRS84, http://www.opengis.net/def/crs/EPSG/0/27700, http://www.opengis.net/def/crs/EPSG/0/4326, http://www.opengis.net/def/crs/EPSG/0/3857",
    "help": "https://osdatahub.os.uk/docs/ofa/technicalSpecification"
}

I have osdatahub-1.2.4 installed

@mikey-heatgeek
Copy link
Author

This was resolved changing the argument of the CRS:


bbox = (-1.5017, 50.9946, -1.5001, 50.9955)
extent = Extent.from_bbox(bbox, "CRS84")

collection = "bld-fts-buildingpart"
ngd = NGD(key, collection)
result = ngd.query(extent=extent)

But still hopefully that can be updated in the defaults of the app :)

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