verify=True
default in owslib.util.openURL
verify=None
and test for the value being set, and then True or False, this might be a short term solution?diff --git a/owslib/util.py b/owslib/util.py
index 24e7af6..704dfce 100644
--- a/owslib/util.py
+++ b/owslib/util.py
@@ -143,7 +143,7 @@ class ResponseWrapper(object):
def openURL(url_base, data=None, method='Get', cookies=None, username=None, password=None, timeout=30, headers=None,
- verify=True, cert=None, auth=None):
+ verify=None, cert=None, auth=None):
"""
Function to open URLs.
@@ -170,7 +170,7 @@ def openURL(url_base, data=None, method='Get', cookies=None, username=None, pass
auth.password = password
if cert:
auth.cert = cert
- if verify and not auth.verify:
+ if verify is not None and verify and not auth.verify:
auth.verify = verify
else:
auth = Authentication(username, password, cert, verify)
@tomkralidis I have a question about the catalog service csw. Is it possible to search for updated/new records? We harvest records from a CSW service and after the initial full request we would like to search only for updated and new records. This is a behaviour supported by OAI services … using the from
parameter:
https://sickle.readthedocs.io/en/latest/tutorial.html?highlight=from#using-the-from-parameter
The current dev code for harvesting with CSW looks like this:
https://github.com/cehbrecht/md-ingestion/blob/pingudev/mdingestion/ng/harvester/csw.py
dct:modified
, which is CSW core (see Subclause 10.2.5.3.2 and Table 53 of http://portal.opengeospatial.org/files/?artifact_id=20555)
Hi folks. Some of my WCS notebooks stopped working with time outs. The services reply correctly to direct requests, but GetCoverage requests through OWSLib fail. Here is an example:
from owslib.wcs import WebCoverageService
wcs = WebCoverageService('http://maps.isric.org/mapserv?map=/map/phh2o.map',
version='2.0.1')
cov_id = 'phh2o_0-5cm_mean'
ph_0_5 = wcs.contents[cov_id]
subsets = [('X', -1784000, -1140000), ('Y', 1356000, 1863000)]
crs = "http://www.opengis.net/def/crs/EPSG/0/152160"
response = wcs.getCoverage(
identifier=[cov_id],
crs=crs,
subsets=subsets,
resx=250, resy=250,
format=ph_0_5.supportedFormats[0])
But the equivalent request directly sent through HTTP is successful:
https://maps.isric.org/mapserv?map=/map/phh2o.map&
SERVICE=WCS&
VERSION=2.0.1&
REQUEST=GetCoverage&
COVERAGEID=phh2o_0-5cm_mean&
FORMAT=GEOTIFF_INT16&
SUBSET=X(-1784000,-1140000)&
SUBSET=Y(1356000,1863000)&
SUBSETTINGCRS=http://www.opengis.net/def/crs/EPSG/0/152160&
OUTPUTCRS=http://www.opengis.net/def/crs/EPSG/0/152160
Any clues?
hey @cehbrecht FYI for the OSGeo AGM, given OWSLib is a community project, any chance you/others can update the AGM deck at https://docs.google.com/presentation/d/1C6llSnWZ28c2aWQgttPiOnoo6dttdqKg07ugU_yr6Uc/edit#slide=id.g9401e4b2da_178_10 (currently slide 75).
FYI AGM is this Thursday.
Thanks
woudc-total-ozone.xml
, the following works for me :from owslib.csw import CatalogueServiceWeb
f = 'woudc-total-ozone.xml'
csw = CatalogueServiceWeb('http://localhost:8000')
csw.transaction(ttype='insert', typename='gmd:MD_Metadata', record=open(f).read())
pycsw
) endpoint using owslib
- following the docs I tried the following query (which works):from owslib.csw import CatalogueServiceWeb
from owslib.fes import PropertyIsEqualTo, PropertyIsLike, BBox
endpoint = 'https://csw.epinux.com/'
csw = CatalogueServiceWeb(endpoint,timeout=30)
csw.version
# prints out:
# '2.0.2'
[op.name for op in csw.operations]
# prints out:
"""
['GetCapabilities',
'DescribeRecord',
'GetDomain',
'GetRecords',
'GetRecordById',
'GetRepositoryItem',
'Transaction',
'Harvest']
"""
csw.getdomain('GetRecords.resultType')
csw.results
# prints out:
"""
{'type': 'csw:Record',
'parameter': 'GetRecords.resultType',
'values': ['hits', 'results', 'validate']}
"""
sentinel_query = PropertyIsEqualTo('csw:AnyText', 'sentinel')
csw.getrecords2(constraints=[sentinel_query], maxrecords=20)
csw.results
# prints out:
"""
{'matches': 442291, 'returned': 10, 'nextrecord': 11}
"""