[Zoo-discuss] WFS Input

Fenoy Gerald gerald.fenoy at geolabs.fr
Sun Jul 20 03:00:21 PDT 2014


Hello Jerome,
first of all thanks a lot for having registered on the list.

My answers inline below.

Le 16 juil. 2014 à 20:12, Jerome Villeneuve Larouche <jlarouche at mapgears.com> a écrit :

> Hello,
> 
> I'm currently trying to use Zoo to create services using WFS as input. I started from the "ogr_sp.py" service. Modified it a bit and now I can use the WFS input.

Hopefully, you do not have to change one line of code in any service for being able to use WFS as input. Indeed, all this is happening behind the scene, in the ZOO-Kernel and you don’t have to do anything in service to use any WFS or any ressource accessible through http or ftp protocol. So maybe the angle you view ZOO-Service is not correct. 

> 
> Problem I have is that even if the features I receive from the WFS have many attributes, what I get in the ouput has like only a name attribute which is the same for every feature. I looked into it and since ogr only creates the geometry from the GML, features are being created from scratch and them the geometry is set. Same in the OutputResult function after that. There doesn't seem to be an OGR function to create a feature from GML, so I would have to parse the GML and add every attributes myself when creating the feature.

I noticed that in the source code of base-vect-ops-py service there is no attributes which come if you are using GeoJSON. I do not know why I limited the capability here but anyway if you change to another format it will work.

Thanks to the WPS Benchmarking, there were many enhancements and new services made available in the C version and I would like to invite you to try this new one which should work whatever is the format you may want to use. 

> 
> So is there a better way to get the input feature's attributes into the output?

Well, you know …. something seems to be there already in the source code [1], please have a quick look at the outputResult function. More precisely from line 132 to 140, there are the fields creation.

Hope this helps and make you understand that there is no reason to modify anything in the service source code to use references as inputs.

I hope you will have good time using ZOO-Project :)

Best regards,

[1] http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-services/ogr/base-vect-ops-py/cgi-env/ogr_sp.py


Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140720/61d35d24/attachment.pgp>


More information about the Zoo-discuss mailing list