[Zoo-discuss] service with wfs:featurecollection

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Thu Dec 18 06:06:46 PST 2014


Hello
I created a python service that receives a wfs:FeatureCollection as input
In the .cfg I have
<ComplexData>
    <Default>
     mimeType = text/xml
     encoding = UTF-8
     schema = http://fooa/gml/3.1.0/polygon.xsd
    </Default>
   <Supported>
     mimeType = text/xml
     encoding = UTF-8
     schema = http://fooa/gml/3.1.0/polygon.xsd
    </Supported>
   </ComplexData>

I would like your opinion on how I do things in my python script to make 
sure it is optimized because I have many other services to create

First I create a temporrary file and write the result of the WFS query
tmp_file = 
tempfile.NamedTemporaryFile(dir=conf["main"]["tmpPath"],prefix="zoo", 
delete=False)
tmp_file.write(inputs["InputEntity1"]["value"])
tmp_file.close()

then I fetch the file to do stuff needed
wfs_ds = ogr.Open(tmp_file.name)
layer = wfs_ds.GetLayerByName(layername)
 feat = layer.GetNextFeature()
      while feat is not None: .....


Is it the appropriate way to parse the WFS response?
Many thanks
steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20141218/72c90d65/attachment.html>


More information about the Zoo-discuss mailing list