<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Richard: thanks for the info. The owslib.csw.getrecords is relatively limited to a few use cases for discovery which cover one comparison operator this way. It would be valuable to enhance this so any enhancements/pull requests are welcomed.<br><br>Having said this, you could just use owslib.csw.getrecords xml argument, which allows you to pass the actual XML POST as a string, which overrides other arguments. It's not pretty, but useful in cases like this, given the codebase curently.<br><br>Hope this helps.<br><br>..Tom<br><br><br><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Thu, 25 Apr 2013 16:16:28 -0400<br>> From: rsignell@usgs.gov<br>> To: owslib-users@lists.osgeo.org<br>> Subject: [OWSLib-users] How to mimic this CSW XML Post Query using OWSlib<br>> <br>> I have a CSW endpoint:<br>> <br>> endpoint = 'http://www.ngdc.noaa.gov/geoportal/csw' # NGDC Geoportal<br>> csw = CatalogueServiceWeb(endpoint, lang='en-US', version='2.0.2', timeout=30)<br>> <br>> and I have a sample POST query:<br>> <br>> xml_string='''<br>> <?xml version="1.0"?><br>> <csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"<br>> version="2.0.2" service="CSW" resultType="results"<br>> outputSchema="http://www.isotc211.org/2005/gmd" startPosition="1"<br>> maxRecords="1000"><br>> <csw:Query typeNames="csw:Record"<br>> xmlns:ogc="http://www.opengis.net/ogc"<br>> xmlns:gml="http://www.opengis.net/gml"><br>> <csw:ElementSetName>full</csw:ElementSetName><br>> <csw:Constraint version="1.1.0"><br>> <ogc:Filter><br>> <ogc:And><br>> <ogc:PropertyIsEqualTo><br>> <ogc:PropertyName>sys.siteuuid</ogc:PropertyName><br>> <ogc:Literal>{78C0463E-2FCE-4AB2-A9C9-6A34BF261F52}</ogc:Literal><br>> </ogc:PropertyIsEqualTo><br>> <ogc:PropertyIsLike wildCard="*" escape="\" singleChar="?"><br>> <ogc:PropertyName>apiso:ServiceType</ogc:PropertyName><br>> <ogc:Literal>*opendap*</ogc:Literal><br>> </ogc:PropertyIsLike><br>> </ogc:And><br>> </ogc:Filter><br>> </csw:Constraint><br>> </csw:Query><br>> </csw:GetRecords><br>> '''<br>> Is there a way to do this same query using the OWSlib methods?<br>> <br>> I know how to do things like:<br>> <br>> bbox=[-71.5, 39.5, -63.0, 46]<br>> csw.getrecords(keywords=['sea_water_temperature'],bbox=bbox,maxrecords=10)<br>> csw.results<br>> <br>> But I don't know how to do the above query that is supposed to find<br>> records with OPeNDAP responses.<br>> <br>> Here is an Ipython Notebook that shows my testing of the CSW response<br>> with OWSlib:<br>> http://nbviewer.ipython.org/5462676<br>> <br>> Thanks,<br>> Rich<br>> -<br>> Dr. Richard P. Signell (508) 457-2229<br>> USGS, 384 Woods Hole Rd.<br>> Woods Hole, MA 02543-1598<br>> _______________________________________________<br>> OWSLib-users mailing list<br>> OWSLib-users@lists.osgeo.org<br>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/owslib-users<br></div> </div></body>
</html>