[ckan-dev] Spatial search for datasets with dataset collection
Fawcett, David (MNIT)
David.Fawcett at state.mn.us
Mon Jul 22 16:20:45 UTC 2013
I am not convinced that API spatial queries work with CKAN v2.0 (API v3). I would love to have someone demonstrate a working bbox query under API v3.
Here is a challenge to the list: Please provide a simple example that confirms that spatial queries work via APIv3 and shows the correct syntax for using a spatial query to select packages/datasets. This example can be written against data.gov or any of the other public CKAN instances out there.
Here is a little more information on my similar issue:
I have a CKAN instance with the spatial extension installed.
We have some datasets the include the 'spatial' metadata element
Using the spatial extension gui, I can correctly find/select datasets based on their bbox
I haven't been able to produce an API request that selects the correct datasets.
I put a question out to this list last week and haven't received any responses. In trying to come up with a proper API request, I looked at the tests in ckanext-spatial. The tests are still written against version 2 of the API. This didn't seem like a great sign to me...
Thanks,
David.
From: ckan-dev-bounces at lists.okfn.org [mailto:ckan-dev-bounces at lists.okfn.org] On Behalf Of Tracy Harton
Sent: Monday, July 22, 2013 12:32 AM
To: ckan-dev at lists.okfn.org
Subject: [ckan-dev] Spatial search for datasets with dataset collection
I'm trying to search for datasets from a dataset collection, given an area of interest. This works interactively and the following returns 6 datasets as expected:
http://catalog.data.gov/dataset?q=&collection_package_id=b64c5a49-80bf-4fd2-ac7f-c2f7fe474ae6&ext_bbox=-121,45,-120,46
If I try to do an API call to retrieve the data as JSON, the following always returns 0 results, but no error, regardless of bbox:
http://catalog.data.gov/api/search/dataset?q=&collection_package_id=b64c5a49-80bf-4fd2-ac7f-c2f7fe474ae6&ext_bbox=-121,45,-120,46
Leaving off the bbox returns the entire collection as expected:
http://catalog.data.gov/api/search/dataset?q=&collection_package_id=b64c5a49-80bf-4fd2-ac7f-c2f7fe474ae6
For a package_search, which does work for ext_bbox, I am not able to filter by collection_package_id, only "q"
So, is ext_bbox supported for this API search? Or is this a data.gov<http://data.gov> issue? Any help would be appreciated...
/tracy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130722/5eea9d4c/attachment-0001.html>
More information about the ckan-dev
mailing list