In [1]:
from owslib.csw import CatalogueServiceWeb
from owslib import fes
In [ ]:
endpoints = {'geoportal(nodc)': 'http://www.nodc.noaa.gov/geoportal/csw',
'geoportal(ngdc)': 'http://www.ngdc.noaa.gov/geoportal/csw',
'geoportal(epa)': 'https://edg.epa.gov/metadata/csw',
'geonetwork(cmg)': 'http://cmgds.marine.usgs.gov/geonetwork/srv/en/csw',
'geonetwork(cida-gdp)':'http://cida.usgs.gov/gdp/geonetwork/srv/en/csw',
'geonetwork(cida-glri)': 'http://cida.usgs.gov/glri/geonetwork/srv/en/csw',
'pycsw(pacioos)': 'http://oos.soest.hawaii.edu/pacioos/ogc/csw.py',
'pycsw(data.gov)': 'http://catalog.data.gov/csw-all',
'compusult(cgdi)': 'http://geodiscover.cgdi.ca/wes/serviceManagerCSW/csw',
'gi-cat(ispra)': 'http://193.206.192.216:8080/gi%2Dcat/services/cswiso'}
In [ ]:
def test_bbox(endpoints,bbox):
for title,url in endpoints.iteritems():
try:
csw = CatalogueServiceWeb(url, timeout=40)
if "BBOX" in csw.filters.spatial_operators:
filter_list = [fes.BBox(bbox)]
try:
csw.getrecords2(constraints=filter_list, maxrecords=1000)
print("%s : Datasets = %d" % (title,len(csw.records.keys())))
except Exception:
print "%s : BBOX Query FAILS" % title
else:
print "%s - BBOX Query NOT supported" % title
except Exception:
print "%s - Timed out" % title
In [ ]:
bbox = [-158.4, 20.7, -157.2, 21.6]
test_bbox(endpoints,bbox)
In [ ]:
bbox = [20.7, -158.4, 21.6, -157.2]
test_bbox(endpoints,bbox)
In [ ]:
In [ ]:
In [ ]:
In [ ]: