[postgis-users] Retrieve a feature having point coordinates

Michel Seuthe m.seuthe at googlemail.com
Tue Dec 27 01:48:22 PST 2011


Maybe you want to try it this way:

SELECT gid,geom FROM mytable
WHERE st_x(geom) >=45.19 AND st_x(geom) <=45.21
AND st_y(geom) >=23.29 AND st_y(geom) <=23.31

It finds all points in the given bounding box. But you cannot specify
exactly one point, because there could be more than one at this point.

Hope that helps although.

Cheers.


2011/12/27 Alessandro Candini <candini at meeo.it>

> Hi list.
> I'm new to Postgis world and I have a probable dumb question:
> I have a shape file inserted into a postgis database through shp2pgsql
> utility and I would like to retrieve a feature ID giving as input a pair of
> lat/lon coordinates.
> Something like "SELECT gid from mytable WHERE point_is_into(45.2, 23.3);"
> How can I achieve this?
>
> Thanks in advance.
>
> --
> Alessandro Candini
> MEEO S.r.l.
> Via Saragat 9
> I-44122 Ferrara, Italy
> Tel: +39 0532 1861501
> Fax: +39 0532 1861637
> http://www.meeo.it
>
> ==============================**==========
> "ATTENZIONE:le informazioni contenute in questo messaggio sono
> da considerarsi confidenziali ed il loro utilizzo è riservato unicamente
> al destinatario sopra indicato. Chi dovesse ricevere questo messaggio
> per errore è tenuto ad informare il mittente ed a rimuoverlo
> definitivamente da ogni supporto elettronico o cartaceo."
>
> "WARNING:This message contains confidential and/or proprietary
> information which may be subject to privilege or immunity and which
> is intended for use of its addressee only. Should you receive this
> message in error, you are kindly requested to inform the sender and
> to definitively remove it from any paper or electronic format."
>
> ______________________________**_________________
> postgis-users mailing list
> postgis-users at postgis.**refractions.net<postgis-users at postgis.refractions.net>
> http://postgis.refractions.**net/mailman/listinfo/postgis-**users<http://postgis.refractions.net/mailman/listinfo/postgis-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111227/3f7b0546/attachment.html>


More information about the postgis-users mailing list