Hello,<div>Thank you for your reply.</div><div><br></div><div>I have added a geometry column to my existing table.</div><div>But i am facing problems in updating that column.</div><div>since i have thousands of row, it would not be feasible to update each row at a time. </div>
<div>what should i do to update all geometries at once? <br></div><br><div class="gmail_quote">On Mon, Oct 8, 2012 at 6:32 PM, Tom van Tilburg <span dir="ltr"><<a href="mailto:tom.van.tilburg@gmail.com" target="_blank">tom.van.tilburg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi Tasneem,<br>
<br>
You will have to create a geometry first before you can use
postgis functions. Just 2 columns with coordinates are not enough
(you're very close though). <br>
I would recommend to do some reading in the manual, especially
here:<br>
<a href="http://postgis.refractions.net/documentation/manual-2.0/PostGIS_FAQ.html#id605751" target="_blank">http://postgis.refractions.net/documentation/manual-2.0/PostGIS_FAQ.html#id605751</a><br>
<br>
It boils down to adding a column with <br>
<pre> SELECT AddGeometryColumn('', 'yourtable','geom',-1,'POINT',2);</pre>
and then filling the column with <br>
UPDATE yourtable SET geom = ST_SetSrid(ST_MakePoint(xcolumn,
ycolumn),4326)<br>
(see:
<a href="http://postgis.refractions.net/documentation/manual-2.0/ST_MakePoint.html" target="_blank">http://postgis.refractions.net/documentation/manual-2.0/ST_MakePoint.html</a>)<br>
<br>
Besides that: most likely you want to use ST_DWithin, it's
supposed to be faster than ST_Within.<br>
<br>
Cheers,<br>
Tom<div><div class="h5"><br>
<br>
On 8-10-2012 14:40, tasneem dewaswala wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">Hello,
<div><br>
</div>
<div>I am developing an application to find whether two cars are
in each other communication range or not.</div>
<div>I have two tables like receiver and transmitter. i would like
to know if receiver is in 100 meters range of transmitter or
not.</div>
<div>Since i am using PostgreSQL first time, i donno much about
its functions and commands, but i have found that there is
ST_Within(), which can be used for my work. I tried but it gives
me lot of errors, probably because of data types of my latitude
and longitude. they are in two different columns with datatype
as double precision.</div>
<div><br>
</div>
<div>please tell me what is wrong, and how should i use ST_WITHIN
for my work. Or tell me any other way of knowing if two objects
are in range of each other.</div>
<br>
<fieldset></fieldset>
<br>
</div></div><div class="im"><pre>_______________________________________________
postgis-users mailing list
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
</pre>
</div></blockquote>
<br>
</div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a 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>