Hello,<div><br></div><div>I tried with geography query for test purpose</div><div><br></div><div><div>SELECT ST_Distance(</div><div>  ST_GeographyFromText('POINT(19.246 72.969)'), </div><div>  ST_GeographyFromText('POINT(19.164 72.926)')  </div>
<div>  );</div></div><div><br></div><div>and it gives me the value 5498.79189851193</div><div><br></div><div>while according to google maps distance is 10 km.</div><div>I don't know how to get the approximate answer as in google maps.</div>
<div>Please suggest whats wrong.</div><div><br></div><div><br><div class="gmail_quote">On Thu, Dec 6, 2012 at 11:13 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@opengeo.org" target="_blank">pramsey@opengeo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ah. Geography is version 1.5+<br>
You can put st_distance_spheroid in place of st_distance for a metric answer.<br>
p<br>
<br>
On Thu, Dec 6, 2012 at 9:40 AM, tasneem dewaswala<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:tasneem.europe@gmail.com">tasneem.europe@gmail.com</a>> wrote:<br>
> Thank you for the suggestion<br>
><br>
> i tried to use ST_GeographyFromText and ST_GeogFromText<br>
> but it gives an error as the function does not exist.<br>
><br>
> is this because of version problem.<br>
><br>
> My postgre version is<br>
> "PostgreSQL 8.4.14, compiled by Visual C++ build 1400, 32-bit"<br>
><br>
> and postgis version is<br>
> "POSTGIS="1.4.2" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August 2008"<br>
> USE_STATS"<br>
><br>
><br>
> On Thu, Dec 6, 2012 at 10:29 PM, Paul Ramsey <<a href="mailto:pramsey@opengeo.org">pramsey@opengeo.org</a>> wrote:<br>
>><br>
>> If you want to use angular units (lon/lat) but get back metric<br>
>> results, use the geography type, not the geometry type.<br>
>> ST_GeogFromText<br>
>><br>
>> On Thu, Dec 6, 2012 at 8:56 AM, tasneem dewaswala<br>
>> <<a href="mailto:tasneem.europe@gmail.com">tasneem.europe@gmail.com</a>> wrote:<br>
>> > When i locate this two co-ordinates on google map.<br>
>> >  one lat/lon (19.235308 72.977955) is in India while<br>
>> > another (56.6647756667,12.877464) is in Sweden,<br>
>> > so how can the distance between both of them be 70 meters ?<br>
>> ><br>
>> ><br>
>> > On Thu, Dec 6, 2012 at 9:30 PM, Duncan Golicher <<a href="mailto:dgolicher@gmail.com">dgolicher@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> The points look about 70m apart to me.<br>
>> >><br>
>> >> Duncan<br>
>> >><br>
>> >><br>
>> >><br>
>> >> On Thu, Dec 6, 2012 at 8:47 AM, tasneem dewaswala<br>
>> >> <<a href="mailto:tasneem.europe@gmail.com">tasneem.europe@gmail.com</a>> wrote:<br>
>> >> > Hello,<br>
>> >> ><br>
>> >> > i want to know whether two location's are within 100 meters range of<br>
>> >> > each<br>
>> >> > other or not.<br>
>> >> > i tried using ST_DWITHIN, but its not giving me appropriate answers.<br>
>> >> ><br>
>> >> > my query is "<br>
>> >> ><br>
>> >> > select st_dwithin(ST_GeomFromText('POINT(19.235308<br>
>> >> > 72.977955)',2163),ST_GeomFromText('POINT(56.6647756667<br>
>> >> > 12.877464)',2163),100) as "result";<br>
>> >> ><br>
>> >> > the result that i get is "t" i.e true, which is logically not<br>
>> >> > correct,<br>
>> >> > the<br>
>> >> > answer i should get is false, since two locations are far beyond 100<br>
>> >> > meters<br>
>> >> > range.<br>
>> >> ><br>
>> >> > Please help me forming an exact query for this.<br>
>> >> ><br>
>> >> > Regards<br>
>> >> > Tasha<br>
>> >> ><br>
>> >> ><br>
>> >> > _______________________________________________<br>
>> >> > postgis-users mailing list<br>
>> >> > <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> >> > <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>> >> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Dr Duncan Golicher<br>
>> >> Investigador Titular,<br>
>> >> El Colegio de la Frontera Sur, Chiapas,Mexico<br>
>> >> Mexico tel <a href="tel:%2B52%201%20967%20137%2094%2020" value="+5219671379420">+52 1 967 137 94 20</a><br>
>> >> Skype name duncangolicher<br>
>> >><br>
>> >> Publications: <a href="http://www.mendeley.com/profiles/duncan-golicher" target="_blank">http://www.mendeley.com/profiles/duncan-golicher</a><br>
>> >><br>
>> >> Senior lecturer, Bournemouth University, UK<br>
>> >> Centre for Conservation Ecology & Environmental Change<br>
>> >> School of Applied Sciences<br>
>> >> Christchurch House rm C218a<br>
>> >> Bournemouth University<br>
>> >> Fern Barrow<br>
>> >> Poole (Dorset) BH12 5BB UK<br>
>> >> Tel. <a href="tel:%2B44%20%280%291202%20961682" value="+441202961682">+44 (0)1202 961682</a><br>
>> >><br>
>> >> For list of publications see Researcher ID:<br>
>> >> <a href="http://www.researcherid.com/rid/B-4240-2009" target="_blank">http://www.researcherid.com/rid/B-4240-2009</a><br>
>> >><br>
>> >> <a href="mailto:dgolicher@bournemouth.ac.uk">dgolicher@bournemouth.ac.uk</a><br>
>> >> <a href="mailto:dgoliche@ecosur.mx">dgoliche@ecosur.mx</a><br>
>> >><br>
>> >> Researcher ID:<br>
>> >> <a href="http://www.researcherid.com/rid/B-4240-2009" target="_blank">http://www.researcherid.com/rid/B-4240-2009</a><br>
>> >> _______________________________________________<br>
>> >> postgis-users mailing list<br>
>> >> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> >> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > postgis-users mailing list<br>
>> > <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>> ><br>
>> _______________________________________________<br>
>> postgis-users mailing list<br>
>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>