<p dir="ltr">Concordo Paolo. Andrebbe proposto a chi mantiene owslib. </p>
<p dir="ltr">giovanni</p>
<div class="gmail_quote">Il 17/mar/2014 23:35 "Paolo Corti" <<a href="mailto:pcorti@gmail.com">pcorti@gmail.com</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ciao<br>
<br>
2014-03-17 18:08 GMT+01:00 Antonio Rotundo <<a href="mailto:anto.rotundo@gmail.com">anto.rotundo@gmail.com</a>>:<br>
> Premesso che, forse, sarebbe utile che nel plugin si desse la possibilitą<br>
> all'utente di poter scegliere anche il metodo tra GET e POST, apporteremo le<br>
> necessarie modifiche per superare il problema e consentire a QGis di poter<br>
> interrogare correttamente il CSW del RNDT.<br>
> Saluti,<br>
> Antonio<br>
><br>
<br>
Il problema risiede nella libreria OWSLib utilizzata da MetaSearch.<br>
Il metodo incriminato e' getrecords [1], dovrebbe essere abbastanza<br>
triviale fare in modo che venga fatta una GET invece di una POST, cosi<br>
come e' stato recentemente fatto per getrecordsbyid.<br>
<br>
Piuttosto, mi chiedo, da profano dei cataloghi, se non sia<br>
penalizzante il limite di 2048 caratteri nelle GET?<br>
Voglio dire, basta mettere qualche filtro qui e li, e si supera facilmente...<br>
Gia' con l'esempio della documentazione di OWSLib ci si arriva quasi,<br>
e con un semplice filtrino sulle keywords (1425 solo i caratteri dei<br>
dati in GET):<br>
<br>
>>> from owslib.csw import CatalogueServiceWeb<br>
>>> csw = CatalogueServiceWeb('<a href="http://geodiscover.cgdi.ca/wes/serviceManagerCSW/csw" target="_blank">http://geodiscover.cgdi.ca/wes/serviceManagerCSW/csw</a>')<br>
>>> csw.getrecords(keywords=['birds'], maxrecords=20)<br>
>>>len(csw.request)<br>
1425<br>
>>> print csw.request<br>
 '<?xml version="1.0" encoding="ISO-8859-1"<br>
standalone="no"?>\n<csw:GetRecords<br>
xmlns:xs2="<a href="http://www.w3.org/XML/Schema" target="_blank">http://www.w3.org/XML/Schema</a>"<br>
xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>"<br>
xmlns:dif="<a href="http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/" target="_blank">http://gcmd.gsfc.nasa.gov/Aboutus/xml/dif/</a>"<br>
xmlns:rdf="<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" target="_blank">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>"<br>
xmlns:dc="<a href="http://purl.org/dc/elements/1.1/" target="_blank">http://purl.org/dc/elements/1.1/</a>"<br>
xmlns:gco="<a href="http://www.isotc211.org/2005/gco" target="_blank">http://www.isotc211.org/2005/gco</a>"<br>
xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd" target="_blank">http://www.isotc211.org/2005/gmd</a>"<br>
xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0"<br>
xmlns:ows="<a href="http://www.opengis.net/ows" target="_blank">http://www.opengis.net/ows</a>"<br>
xmlns:fgdc="<a href="http://www.opengis.net/cat/csw/csdgm" target="_blank">http://www.opengis.net/cat/csw/csdgm</a>"<br>
xmlns:atom="<a href="http://www.w3.org/2005/Atom" target="_blank">http://www.w3.org/2005/Atom</a>"<br>
xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema" target="_blank">http://www.w3.org/2001/XMLSchema</a>"<br>
xmlns:csw="<a href="http://www.opengis.net/cat/csw/2.0.2" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xmlns:dct="<a href="http://purl.org/dc/terms/" target="_blank">http://purl.org/dc/terms/</a>"<br>
xmlns:ogc="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>"<br>
outputSchema="<a href="http://www.opengis.net/cat/csw/2.0.2" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a>"<br>
outputFormat="application/xml" version="2.0.2" resultType="results"<br>
service="CSW" maxRecords="20"<br>
xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2" target="_blank">http://www.opengis.net/cat/csw/2.0.2</a><br>
<a href="http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd" target="_blank">http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd</a>"><csw:Query<br>
typeNames="csw:Record"><csw:ElementSetName>summary</csw:ElementSetName><csw:Constraint<br>
version="1.1.0"><ogc:Filter><ogc:PropertyIsLike wildCard="%"<br>
singleChar="_" escapeChar="\\"><ogc:PropertyName>csw:AnyText</ogc:PropertyName><ogc:Literal>%birds%</ogc:Literal></ogc:PropertyIsLike></ogc:Filter></csw:Constraint></csw:Query></csw:GetRecords>'<br>

<br>
Insomma, non sarebbe sempre preferibile che il POST sia sempre disponibile?<br>
<br>
p<br>
<br>
[1] <a href="https://github.com/geopython/OWSLib/blob/master/owslib/csw.py#L165" target="_blank">https://github.com/geopython/OWSLib/blob/master/owslib/csw.py#L165</a><br>
<br>
<br>
--<br>
Paolo Corti<br>
Geospatial software developer<br>
web: <a href="http://www.paolocorti.net" target="_blank">http://www.paolocorti.net</a><br>
twitter: @capooti<br>
skype: capooti<br>
_______________________________________________<br>
<a href="mailto:Gfoss@lists.gfoss.it">Gfoss@lists.gfoss.it</a><br>
<a href="http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss" target="_blank">http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss</a><br>
Questa e' una lista di discussione pubblica aperta a tutti.<br>
I messaggi di questa lista non hanno relazione diretta con le posizioni dell'Associazione GFOSS.it.<br>
666 iscritti al 22.7.2013</blockquote></div>