[postgis-users] Retrieve a feature having point coordinates

Alessandro Candini candini at meeo.it
Tue Dec 27 02:11:34 PST 2011


It dosn't work sayng to me the following:
ERROR:  Argument to X() must be a point
> 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 <mailto: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 <tel:%2B39%200532%201861501>
>     Fax: +39 0532 1861637 <tel:%2B39%200532%201861637>
>     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
>     <mailto:postgis-users at postgis.refractions.net>
>     http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 
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."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111227/93737ee6/attachment.html>


More information about the postgis-users mailing list