[OWSLib-users] finding the ISO queryables for CSW

Tom Kralidis tomkralidis at gmail.com
Mon Feb 10 08:03:46 PST 2014



On Mon, 10 Feb 2014, Signell, Richard wrote:

> Date: Mon, 10 Feb 2014 10:26:52 -0500
> From: "Signell, Richard" <rsignell at usgs.gov>
> To: owslib-users at lists.osgeo.org
> Subject: [OWSLib-users] finding the ISO queryables for CSW
> 
> What's the best way to use OWSlib to find the list of ISO queryables
> contained in a getCaps, for example:
>
> https://edg.epa.gov/metadata/csw?Request=GetCapabilities&Service=CSW&Version=2.0.2

Something like:

from owslib.csw import CatalogueServiceWeb

csw = CatalogueServiceWeb('https://edg.epa.gov/metadata/csw')

for oper in csw.operations:
     if oper.name == 'GetRecords':
         print oper.constraints['SupportedISOQueryables']

Having said this, we could add a convenience function like
owslib.csw.get_operation_by_name to save clients from looping themselves,
which would make the above look something like:

with csw.get_operation_by_name('GetRecords') as gr_ops:
     print gr_ops.constraints['SupportedISOQueryables']

This exists in other OWSLib APIs.  If you open a GitHub issue, I'll
implement the enhancement.


More information about the OWSLib-users mailing list