Code a web service with python/postgis

Burak Arslan burak.arslan at arskom.com.tr
Wed May 21 05:08:18 EDT 2014


On 05/20/14 21:10, lcelati at latitude-geosystems.com wrote:
> Dear all,
>
> I would like code a web service with python. I have already imported
> several vector data
> (land cover) and one Digital Elevation Model (raster layer) into my
> postgresql/postgis
> database (server side).
>
> I succeed in connecting to my pg db via psycopg2.
>
> Client side, operators use a client application (Developed with PHP /
> javascript /
> openlayers).
>
> Objectives :  Client side, once the layer would be selected,and once
> the operators have
> clicked on the map  , they would like that usefull informations appear
> on the interface
> of the client application(kind of land cover, z of the DEM).
>
>
> => Regarding my python script, i have to type a SQL query in order to
> select usefull
> informations of the db layers. And, of course, the information must 
> depend on geographic
> coordinates (Latitude Y/Longitute X).
> In a 2nd time, my script must  produce a result(JSon type) for the
> client side.


Hi,

Spyne supports Point, Line, Polygon and their Multi* variants. e.g.:
http://spyne.io/docs/2.10/reference/model/primitive.html#spyne.model.primitive.Line

This means it can validate WKT input and produce WKT output.

It also includes SQLAlchemy adapters for these types. This means you
don't need to use  GeoAlchemy if you have Spyne.

Finally, Spyne can return your data in Soap, Xml, Json, Yaml, MsgPack,
html table, html microformat, etc. etc. or you can implement your
protocols if you don't like the ones already provided.

Spyne web site: http://spyne.io
If you have further questions you can use Spyne tag in stackoverflow or
http://lists.spyne.io/listinfo/people

Disclaimer: I'm the author of Spyne. I already have GIS projects based
on Spyne in production.

Best regards,
Burak




More information about the Python-list mailing list