<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
It seems very complicated for what I need...no other ways to do:<br>
<br>
" give me the feature ID which contains this point"?!<br>
<br>
I was trying using something like:<br>
<br>
SELECT gid,the_geom FROM salzburg WHERE ST_Contains(the_geom,
ST_PointFromText('POINT(47.7 13.01)', 900913));<br>
<br>
but the result is 0 rows.<br>
<br>
Is this approach correct?<br>
<br>
<blockquote
cite="mid:CAHu0G+EdwNdoVLq0UcJhnSJ9vPW5eex5XLTsXCcEPLsDpB5TQQ@mail.gmail.com"
type="cite">Yap, as i said it only works for points. If you have
lines or polygons you may build the bounding box of them and try
it with st_xmin etc.<br>
It did it this way:<br>
<br>
SELECT id,tags,linestring<br>
FROM ( SELECT id,tags,linestring,(each(tags)).key AS key FROM ways
) sub <br>
WHERE st_xmin(st_box2d(linestring)) >=9.362383 AND
st_xmax(st_box2d(linestring)) <=9.417143<br>
AND st_ymin(st_box2d(linestring)) >= 51.478924 AND
st_ymax(st_box2d(linestring)) <=51.511413;<br>
<br>
<br>
<br>
<div class="gmail_quote">
2011/12/27 Alessandro Candini <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:candini@meeo.it">candini@meeo.it</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> It dosn't work sayng to
me the following:<br>
ERROR: Argument to X() must be a point
<div>
<div class="h5"><br>
<blockquote type="cite">Maybe you want to try it this
way:<br>
<br>
SELECT gid,geom FROM mytable <br>
WHERE st_x(geom) >=45.19 AND st_x(geom) <=45.21<br>
AND st_y(geom) >=23.29 AND st_y(geom) <=23.31 <br>
<br>
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.<br>
<br>
Hope that helps although.<br>
<br>
Cheers.<br>
<br>
<br>
2011/12/27 Alessandro Candini <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:candini@meeo.it" target="_blank">candini@meeo.it</a>></span><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi list.<br>
I'm new to Postgis world and I have a probable
dumb question:<br>
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.<br>
Something like "SELECT gid from mytable WHERE
point_is_into(45.2, 23.3);"<br>
How can I achieve this?<br>
<br>
Thanks in advance.<br>
<br>
-- <br>
Alessandro Candini<br>
MEEO S.r.l.<br>
Via Saragat 9<br>
I-44122 Ferrara, Italy<br>
Tel: <a moz-do-not-send="true"
href="tel:%2B39%200532%201861501"
value="+3905321861501" target="_blank">+39 0532
1861501</a><br>
Fax: <a moz-do-not-send="true"
href="tel:%2B39%200532%201861637"
value="+3905321861637" target="_blank">+39 0532
1861637</a><br>
<a moz-do-not-send="true"
href="http://www.meeo.it" target="_blank">http://www.meeo.it</a><br>
<br>
========================================<br>
"ATTENZIONE:le informazioni contenute in questo
messaggio sono<br>
da considerarsi confidenziali ed il loro utilizzo
è riservato unicamente<br>
al destinatario sopra indicato. Chi dovesse
ricevere questo messaggio<br>
per errore è tenuto ad informare il mittente ed a
rimuoverlo<br>
definitivamente da ogni supporto elettronico o
cartaceo."<br>
<br>
"WARNING:This message contains confidential and/or
proprietary<br>
information which may be subject to privilege or
immunity and which<br>
is intended for use of its addressee only. Should
you receive this<br>
message in error, you are kindly requested to
inform the sender and<br>
to definitively remove it from any paper or
electronic format."<br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:postgis-users@postgis.refractions.net"
target="_blank">postgis-users@postgis.refractions.net</a><br>
<a moz-do-not-send="true"
href="http://postgis.refractions.net/mailman/listinfo/postgis-users"
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote>
</div>
<br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
postgis-users mailing list
<a moz-do-not-send="true" href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a>
<a moz-do-not-send="true" href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
<br>
<pre cols="72">--
Alessandro Candini
MEEO S.r.l.
Via Saragat 9
I-44122 Ferrara, Italy
Tel: <a moz-do-not-send="true" href="tel:%2B39%200532%201861501" value="+3905321861501" target="_blank">+39 0532 1861501</a>
Fax: <a moz-do-not-send="true" href="tel:%2B39%200532%201861637" value="+3905321861637" target="_blank">+39 0532 1861637</a>
<a moz-do-not-send="true" href="http://www.meeo.it" target="_blank">http://www.meeo.it</a>
========================================
"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."</pre>
</div>
</div>
</div>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a moz-do-not-send="true"
href="http://postgis.refractions.net/mailman/listinfo/postgis-users"
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Alessandro Candini
MEEO S.r.l.
Via Saragat 9
I-44122 Ferrara, Italy
Tel: +39 0532 1861501
Fax: +39 0532 1861637
<a class="moz-txt-link-freetext" href="http://www.meeo.it">http://www.meeo.it</a>
========================================
"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."</pre>
</body>
</html>