[OWSLib-devel] how to restrict csw query to service only
Jachym Cepicky
jachym.cepicky at gmail.com
Sun Dec 14 02:43:14 PST 2014
Hi,
I'm really new to the csw topic, so please be patient with me. Also, as far
as I understand, INSPIRE discovery service is not specified well in some
points, which can lead to bad result's I might get from the server I'm
trying to work with.
The server is national INSPIRE catalogue of Czech republic running at
http://geoportal.gov.cz/php/micka/csw/index.php
>From OWSLib/csw documentation it's quite clear, how to use "AnyText" and
"BoundingBox" restriction.
Questions:
1. It is not quite clear to me, how to restrict query to particular record
type ("Data" or "Service"), how to specify ServiceType ('WMS' or 'view')?
2. When I try to restrict the query to particular organisation, seems that
OWSLib is not counting with special characters ?
>>> aopk_query = PropertyIsEqualTo('csw:MetadataContact', 'Agentura ochrany
přírody a krajiny České republiky')
>>> cenia.getrecords2([aopk_query])
I get following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/owslib/csw.py", line 341, in
getrecords2
node2.append(flt.setConstraintList(constraints))
File "/usr/local/lib/python2.7/dist-packages/owslib/fes.py", line 143, in
setConstraintList
return self.setConstraint(constraints[0])
File "/usr/local/lib/python2.7/dist-packages/owslib/fes.py", line 117, in
setConstraint
self._root.append(constraint.toXML())
File "/usr/local/lib/python2.7/dist-packages/owslib/fes.py", line 264, in
toXML
etree.SubElement(node0, util.nspath_eval('ogc:Literal',
namespaces)).text = self.literal
File "lxml.etree.pyx", line 953, in lxml.etree._Element.text.__set__
(src/lxml/lxml.etree.c:45142)
File "apihelpers.pxi", line 684, in lxml.etree._setNodeText
(src/lxml/lxml.etree.c:20505)
File "apihelpers.pxi", line 1393, in lxml.etree._utf8
(src/lxml/lxml.etree.c:26656)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL
bytes or control characters
Any hints?
Thank you
Jachym
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-devel/attachments/20141214/c1594851/attachment.html>
More information about the OWSLib-devel
mailing list