[postgis-users] errors while using st_dwithin

tasneem dewaswala tasneem.europe at gmail.com
Thu Dec 6 12:09:30 PST 2012


Hello,

I tried with geography query for test purpose

SELECT ST_Distance(
  ST_GeographyFromText('POINT(19.246 72.969)'),
  ST_GeographyFromText('POINT(19.164 72.926)')
  );

and it gives me the value 5498.79189851193

while according to google maps distance is 10 km.
I don't know how to get the approximate answer as in google maps.
Please suggest whats wrong.


On Thu, Dec 6, 2012 at 11:13 PM, Paul Ramsey <pramsey at opengeo.org> wrote:

> Ah. Geography is version 1.5+
> You can put st_distance_spheroid in place of st_distance for a metric
> answer.
> p
>
> On Thu, Dec 6, 2012 at 9:40 AM, tasneem dewaswala
> <tasneem.europe at gmail.com> wrote:
> > Thank you for the suggestion
> >
> > i tried to use ST_GeographyFromText and ST_GeogFromText
> > but it gives an error as the function does not exist.
> >
> > is this because of version problem.
> >
> > My postgre version is
> > "PostgreSQL 8.4.14, compiled by Visual C++ build 1400, 32-bit"
> >
> > and postgis version is
> > "POSTGIS="1.4.2" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.6.1, 21 August
> 2008"
> > USE_STATS"
> >
> >
> > On Thu, Dec 6, 2012 at 10:29 PM, Paul Ramsey <pramsey at opengeo.org>
> wrote:
> >>
> >> If you want to use angular units (lon/lat) but get back metric
> >> results, use the geography type, not the geometry type.
> >> ST_GeogFromText
> >>
> >> On Thu, Dec 6, 2012 at 8:56 AM, tasneem dewaswala
> >> <tasneem.europe at gmail.com> wrote:
> >> > When i locate this two co-ordinates on google map.
> >> >  one lat/lon (19.235308 72.977955) is in India while
> >> > another (56.6647756667,12.877464) is in Sweden,
> >> > so how can the distance between both of them be 70 meters ?
> >> >
> >> >
> >> > On Thu, Dec 6, 2012 at 9:30 PM, Duncan Golicher <dgolicher at gmail.com>
> >> > wrote:
> >> >>
> >> >> The points look about 70m apart to me.
> >> >>
> >> >> Duncan
> >> >>
> >> >>
> >> >>
> >> >> On Thu, Dec 6, 2012 at 8:47 AM, tasneem dewaswala
> >> >> <tasneem.europe at gmail.com> wrote:
> >> >> > Hello,
> >> >> >
> >> >> > i want to know whether two location's are within 100 meters range
> of
> >> >> > each
> >> >> > other or not.
> >> >> > i tried using ST_DWITHIN, but its not giving me appropriate
> answers.
> >> >> >
> >> >> > my query is "
> >> >> >
> >> >> > select st_dwithin(ST_GeomFromText('POINT(19.235308
> >> >> > 72.977955)',2163),ST_GeomFromText('POINT(56.6647756667
> >> >> > 12.877464)',2163),100) as "result";
> >> >> >
> >> >> > the result that i get is "t" i.e true, which is logically not
> >> >> > correct,
> >> >> > the
> >> >> > answer i should get is false, since two locations are far beyond
> 100
> >> >> > meters
> >> >> > range.
> >> >> >
> >> >> > Please help me forming an exact query for this.
> >> >> >
> >> >> > Regards
> >> >> > Tasha
> >> >> >
> >> >> >
> >> >> > _______________________________________________
> >> >> > postgis-users mailing list
> >> >> > postgis-users at lists.osgeo.org
> >> >> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Dr Duncan Golicher
> >> >> Investigador Titular,
> >> >> El Colegio de la Frontera Sur, Chiapas,Mexico
> >> >> Mexico tel +52 1 967 137 94 20
> >> >> Skype name duncangolicher
> >> >>
> >> >> Publications: http://www.mendeley.com/profiles/duncan-golicher
> >> >>
> >> >> Senior lecturer, Bournemouth University, UK
> >> >> Centre for Conservation Ecology & Environmental Change
> >> >> School of Applied Sciences
> >> >> Christchurch House rm C218a
> >> >> Bournemouth University
> >> >> Fern Barrow
> >> >> Poole (Dorset) BH12 5BB UK
> >> >> Tel. +44 (0)1202 961682
> >> >>
> >> >> For list of publications see Researcher ID:
> >> >> http://www.researcherid.com/rid/B-4240-2009
> >> >>
> >> >> dgolicher at bournemouth.ac.uk
> >> >> dgoliche at ecosur.mx
> >> >>
> >> >> Researcher ID:
> >> >> http://www.researcherid.com/rid/B-4240-2009
> >> >> _______________________________________________
> >> >> postgis-users mailing list
> >> >> postgis-users at lists.osgeo.org
> >> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > postgis-users mailing list
> >> > postgis-users at lists.osgeo.org
> >> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >> >
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20121207/fe02bf02/attachment.html>


More information about the postgis-users mailing list