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

Kyle Wilcox kyle at axiomalaska.com
Mon Mar 3 14:49:14 PST 2014


Unfortunately, the entire FES suite is not included in the owslib.fes
module.

I've opened an issue for this:
https://github.com/geopython/OWSLib/issues/128

In the meantime, you can create the XML object yourself and pass it to the
'getrecords2' method.  It should look something like this:

<...>
<fes:Filter>
<fes:Intersects>
<fes:PropertyName>{{ your property }}</fes:PropertyName>
    <gml:Envelope ... />
</fes:Intersects>
</fes:Filter>
</...>

On a side note, the GeoPortal documentation says ogc:BBOX and
ogc:Intersects queries should both return "Overlaps" (I'm not sure if that
helps):
http://sourceforge.net/apps/mediawiki/geoportal/index.php?title=Catalog_Service#Spatial_Queries

That document could also be out of date... it was last edited in 2010!





On Mon, Mar 3, 2014 at 1:30 PM, Signell, Richard <rsignell at usgs.gov> wrote:

> On closer inspection, it appears that fes.BBox(bbox) is returning
> datasets that are (1) completely within or (2) overlapping, but not
> datasets where the bbox of interest is itself completely contained
> within the dataset bounding box.
>
> So it's not finding my dataset that is the whole US East Coast when I
> specify New York Harbor because the the bounding box for New York
> Harbor is completely within the bounding box for the US East Coast.
>
> So I'm will wondering how to find my US East Coast model result with
> my New York Harbor bbox, and more generally, how to specify these
> different behaviors with OWSLib fes.
>
> On Mon, Mar 3, 2014 at 1:21 PM, Signell, Richard <rsignell at usgs.gov>
> wrote:
> > 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
>
>
>
> --
> Dr. Richard P. Signell   (508) 457-2229
> USGS, 384 Woods Hole Rd.
> Woods Hole, MA 02543-1598
> _______________________________________________
> OWSLib-users mailing list
> OWSLib-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/owslib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-users/attachments/20140303/b7090bae/attachment.html>


More information about the OWSLib-users mailing list