[OWSLib-users] CSW query for datasets intersecting bounding box

Signell, Richard rsignell at usgs.gov
Mon Mar 3 10:21:10 PST 2014


I want to use CSW to find all the datasets that overlap a specified
bounding box (for example, if I specify my bounding box region of
interest to be New York Harbor, I want to find datasets that span the
whole east coast)

The datasets are found correctly if I click "intersects" on the
Geoportal Server GUI, which issues this geoportal rest command:

http://geoport.whoi.edu/geoportal/rest/find/document?rid=local&ridName=Geoportal%20Instance&rids=local&searchText=ROMS%20OR%20ADCIRC%20OR%20POM&start=1&max=10&orderBy=relevance&spatialRel=esriSpatialRelOverlaps&bbox=-74.8738,40.2402,-73.468,41.0993&maxSearchTimeMilliSec=10000&f=searchpageresults&dojo.preventCache=1393870427656

but how do I do this in CSW?

I tried:

from owslib.csw import CatalogueServiceWeb
from owslib import fes
endpoint = 'http://geoport.whoi.edu/geoportal/csw'
csw = CatalogueServiceWeb(endpoint,timeout=60)

bbox = [-74.8738,40.2402,-73.468,41.0993]
filter = fes.BBox(box)
csw.getrecords2(constraints=[filter],maxrecords=5,esn='full')

but it only returned datasets completely *within* the specified bounding box.

Thanks,
-Rich



-- 
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598


More information about the OWSLib-users mailing list