[postgis-users] psycopg : web service

Åsmund Tokheim asmundto at gmail.com
Fri May 23 14:20:03 PDT 2014


Hi

I read through your first email a bit fast, and didn't notice the raster
layer, but I'm glad you got some help out of my response anyways. Your
proposal is susceptible to sql injections and MUST be changed.  Instead of
doing string-formatting you should use psycopg when passing parameters, see
http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries.

Also, it seems like you your SQL query is missing a part. I'm guessing it
should start something like
WITH points2d AS (
SELECT st_point(%s, %s) AS geom
)
If your raster layer uses a SRID you will have to specify it for your point
as well, but other than that the query looks fine.

I'm not sure I understand what you want to do with your pixel-to-point
table. Your example should already extract the elevation data for a given
coordinate. Unless you need that table for some other functionality, it
will only deteriorate your db's performance.


On Fri, May 23, 2014 at 11:49 AM, dandrigo
<lcelati at latitude-geosystems.com>wrote:

> Hello,
>
> Thank you for your proposal.
>
> Currently in my database, I have no point layer. In addition mnt, I have 2
> layers surface (regarding land cover).
>
> In addition to your proposal, what do you think of this new proposal ,
> below, which is the intersection between a point and the DTM?
>
> temp.py <http://postgis.17.x6.nabble.com/file/n5006394/temp.py>
>
>
> Let's say I opted for this latter proposal. Would it be judicious to
> generate centroid 2Dpoints for each pixel from my dem raster ( a new table
> postgis table centroid 2D points in order to do the intersection with the
> dem).
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://postgis.17.x6.nabble.com/psycopg-web-service-tp5006366p5006394.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140523/2c86e491/attachment.html>


More information about the postgis-users mailing list