[Zoo-discuss] valid GML string
Steve.Toutant at inspq.qc.ca
Steve.Toutant at inspq.qc.ca
Tue Jul 22 08:50:06 PDT 2014
Thanks for your comment Gerald it helps a lot.
I Attached the new XML people who might have this problem
I removed <![CDATA]> and I'll see on Openlayers list where this come form.
Also, from your XML I had to remove some tags
<gml:featureMember xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/gml
http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd"><feature:feature
xmlns:feature="http://example.com/feature"><feature:geometry>
so I only have the geometry fragment
<gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>-78.8818359375
40.374755859375 -76.0693359375 60.062255859375 -57.0849609375
48.109130859375 -78.8818359375
40.374755859375</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>
I get the output But I still have errors related to namespace prefix gml
and some osgeo.ogr stuff. Is there something I can do about it?
[error] namespace error : Namespace prefix gml on Polygon is not defined
[error] centroid</ows:Title><wps:Data><wps:ComplexData
mimeType="text/xml"><gml:Polygon
[error] ^
[error] namespace error : Namespace prefix gml on exterior is not defined
[error] :Title><wps:Data><wps:ComplexData
mimeType="text/xml"><gml:Polygon><gml:exterior
[error] ^
[error] namespace error : Namespace prefix gml on LinearRing is not
defined
[error] ><wps:ComplexData
mimeType="text/xml"><gml:Polygon><gml:exterior><gml:LinearRing
[error] ^
[error] namespace error : Namespace prefix gml on posList is not defined
[error] Data
mimeType="text/xml"><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList
[error] ^
[error] namespace error : Namespace prefix gml on Polygon is not defined
[error] centroid</ows:Title><wps:Data><wps:ComplexData
mimeType="text/xml"><gml:Polygon
[error] ^
[error] namespace error : Namespace prefix gml on exterior is not defined
[error] :Title><wps:Data><wps:ComplexData
mimeType="text/xml"><gml:Polygon><gml:exterior
[error] ^
[error] namespace error : Namespace prefix gml on LinearRing is not
defined
[error] ><wps:ComplexData
mimeType="text/xml"><gml:Polygon><gml:exterior><gml:LinearRing
[error] ^
[error] namespace error : Namespace prefix gml on posList is not defined
[error] Data
mimeType="text/xml"><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList
[error] ^
[error] False
[error] <osgeo.ogr.Driver; proxy of <Swig Object of type 'OGRDriverShadow
*' at 0x287aba0> >
[error] <osgeo.ogr.DataSource; proxy of <Swig Object of type
'OGRDataSourceShadow *' at 0x287ab40> >
[error] <osgeo.ogr.Layer; proxy of <Swig Object of type 'OGRLayerShadow *'
at 0x287ab10> >
[error] GML
[error] ['.xml', '.xsd']
Thanks again!
Steve
Fenoy Gerald <gerald.fenoy at geolabs.fr>
2014-07-22 10:57
A
Steve.Toutant at inspq.qc.ca
cc
ZOO-discuss <zoo-discuss at lists.osgeo.org>
Objet
Re: [Zoo-discuss] valid GML string
Hi Steve,
nice to hear from you.
I?m sorry that I cannot run the CentroidPy by now, nevertheless when I saw
your request I noticed something strange: ComplexeData contains a XML
content, which sounds good but there is also a <![CDATA[XML]]> which looks
odd.
So I tried to remove it, just to make sure this request will then work
correctly. Hopefully it was working, note that I used the latest
ZOO-Kernel version available on ZOO-Project.org web site.
So that was the way I tried your request with success:
curl -H "Content-Type: text/xml"
-d@/Users/djay/MapMint/zoo-project-1.4.0/zoo-project/testing/demo1.xml "
http://zoo-project.org/cgi-2014/zoo_loader.fcgi"
You can find attached to this email the XML POST request I used to run my
request. I guess you may have better result by adapting this file to your
need.
I hope to hear back from you,
Best regards,
Le 22 juil. 2014 à 16:13, Steve.Toutant at inspq.qc.ca a écrit :
>
> I'm still unable to use the services provided in zoo trunk.
> Someone on this list succesfully send a GML to the centroidPy?
>
> I'm trying to use CentroidPy with a GML as input. Sorry for the long
post...below is the config and request
>
> I always get the error
> [error] ERROR 1: GML Geometry is empty in OGR_G_CreateFromGML().,
referer: http://10.2.198.132/geo/igo/wps/client/ol/
> [error] True, referer: http://10.2.198.132/geo/igo/wps/client/ol/
> [error] /vsimem//temp10, referer:
http://10.2.198.132/geo/igo/wps/client/ol/
> [error] 'NoneType' object has no attribute 'GetLayer', referer:
http://10.2.198.132/geo/igo/wps/client/ol/
> [error] <osgeo.ogr.Driver; proxy of <Swig Object of type
'OGRDriverShadow *' at 0x7f22685b6b70> >, referer:
http://10.2.198.132/geo/igo/wps/client/ol/
> [error] <osgeo.ogr.DataSource; proxy of <Swig Object of type
'OGRDataSourceShadow *' at 0x7f22685b6c30> >, referer:
http://10.2.198.132/geo/igo/wps/client/ol/
> [error] <osgeo.ogr.Layer; proxy of <Swig Object of type 'OGRLayerShadow
*' at 0x7f22685b6c60> >, referer:
http://10.2.198.132/geo/igo/wps/client/ol/
> [error] GML, referer: http://10.2.198.132/geo/igo/wps/client/ol/
> [error] ['.xml', '.xsd'], referer:
http://10.2.198.132/geo/igo/wps/client/ol/
>
> Here is the GML v3. It is valid since I use it in other applications
> <gml:featureMember xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.opengis.net/gml
http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd
"><feature:feature xmlns:feature="http://example.com/feature
"><feature:geometry><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>-78.8818359375
40.374755859375 -76.0693359375 60.062255859375 -57.0849609375
48.109130859375 -78.8818359375
40.374755859375</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></feature:geometry></feature:feature></gml:featureMember>
>
> I have tried with a GMML fragment for the geometry also, I get the same
error
> <gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>-78.8818359375
40.374755859375 -76.0693359375 60.062255859375 -57.0849609375
48.109130859375 -78.8818359375
40.374755859375</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>
>
> Here is the config CentroidPY
> [CentroidPy]
> Title = Extract the feature that have a valid geometry field.
> Abstract = Extract the feature that have a valid geometry field.
> processVersion = 1
> storeSupported = true
> statusSupported = true
> serviceProvider = ogr_sp
> serviceType = Python
> <DataInputs>
> [InputPolygon]
> Title = Polygon to get the centroid
> Abstract = The centroid which is not necessarily within the geometry.
> minOccurs = 1
> maxOccurs = 1
> <ComplexData>
> <Default>
> mimeType = text/xml
> encoding = UTF-8
> schema = http://schemas.opengis.net/gml/3.1.1/base/gml.xsd
> </Default>
> <Supported>
> mimeType = text/xml
> encoding = UTF-8
> schema = http://schemas.opengis.net/gml/3.1.1/base/gml.xsd
> </Supported>
> </ComplexData>
> </DataInputs>
> <DataOutputs>
> [Result]
> Title = The Centroid
> Abstract = JSON String / GML Entity of the centroid
> <ComplexData>
> <Default>
> mimeType = text/xml
> encoding = UTF-8
> </Default>
> <Supported>
> mimeType = application/json
> encoding = UTF-8
> </Supported>
> </ComplexData>
> </DataOutputs>
>
> Here is the Execute request
> <wps:Execute xmlns:wps="http://www.opengis.net/wps/1.0.0"
version="1.0.0" service="WPS" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.opengis.net/wps/1.0.0
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"><ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1
">CentroidPy</ows:Identifier><wps:DataInputs><wps:Input><ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1
">InputPolygon</ows:Identifier><ows:Title xmlns:ows="
http://www.opengis.net/ows/1.1">Polygon to get the
centroid</ows:Title><wps:Data><wps:ComplexData
mimeType="text/xml"><![CDATA[<gml:featureMember xmlns:gml="
http://www.opengis.net/gml" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.opengis.net/gml
http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd
"><feature:feature xmlns:feature="http://example.com/feature
"><feature:geometry><gml:Polygon><gml:exterior><gml:LinearRing><gml:posList>-78.8818359375
40.374755859375 -76.0693359375 60.062255859375 -57.0849609375
48.109130859375 -78.8818359375
40.374755859375</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon></feature:geometry></feature:feature></gml:featureMember>]]></wps:ComplexData></wps:Data></wps:Input></wps:DataInputs><wps:ResponseForm><wps:RawDataOutput><ows:Identifier
xmlns:ows="http://www.opengis.net/ows/1.1
">Result</ows:Identifier></wps:RawDataOutput></wps:ResponseForm></wps:Execute>
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss
>
Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140722/b005dfbf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo1.xml
Type: application/octet-stream
Size: 1420 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140722/b005dfbf/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/octet-stream
Size: 211 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140722/b005dfbf/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo1.xml
Type: application/octet-stream
Size: 1420 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140722/b005dfbf/attachment-0005.obj>
More information about the Zoo-discuss
mailing list