Distance function is not in meters

View: New views
5 Messages — Rating Filter:   Alert me  

Distance function is not in meters

by davidj2k :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to find the distance from a point to a polygon object and when I use the distance(geometry,geometry) function it returns something that is not in meters, I have been doing searches and all the examples of using this function shows it in meters but that is not what I am seeing for example if I use

distance(GeometryFromText('POINT(10 10)',4326), GeometryFromText('POINT(11 11)',4326))

I get

1.4142135623731

How can I get this in meters? I need to do
distance < 1000 meters

Re: Distance function is not in meters

by Paul Ramsey-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

distance_sphere(GeometryFromText('POINT(10 10)',4326),
GeometryFromText('POINT(11 11)',4326))

On 3/18/08, davidj2k <davidj2k@...> wrote:

>
>  I am trying to find the distance from a point to a polygon object and when I
>  use the distance(geometry,geometry) function it returns something that is
>  not in meters, I have been doing searches and all the examples of using this
>  function shows it in meters but that is not what I am seeing for example if
>  I use
>
>  distance(GeometryFromText('POINT(10 10)',4326), GeometryFromText('POINT(11
>  11)',4326))
>
>  I get
>
>  1.4142135623731
>
>  How can I get this in meters? I need to do
>  distance < 1000 meters
>
> --
>  View this message in context: http://www.nabble.com/Distance-function-is-not-in-meters-tp16127891p16127891.html
>  Sent from the PostGIS - User mailing list archive at Nabble.com.
>
>  _______________________________________________
>  postgis-users mailing list
>  postgis-users@...
>  http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

Re: Distance function is not in meters

by davidj2k :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If I use sphere they have to both be points, the actual search I am doing is
distance(the_geom, GeometryFromText('POINT(10 10)',4326))
 
the_geom field is a polygon or a multipolygon

Paul Ramsey <pramsey@...> wrote:
distance_sphere(GeometryFromText('POINT(10 10)',4326),
GeometryFromText('POINT(11 11)',4326))

On 3/18/08, davidj2k wrote:

>
> I am trying to find the distance from a point to a polygon object and when I
> use the distance(geometry,geometry) function it returns something that is
> not in meters, I have been doing searches and all the examples of using this
> function shows it in meters but that is not what I am seeing for example if
> I use
>
> distance(GeometryFromText('POINT(10 10)',4326), GeometryFromText('POINT(11
> 11)',4326))
>
> I get
>
> 1.4142135623731
>
> How can I get this in meters? I need to do
> distance < 1000 meters
>
> --
> View this message in context: http://www.nabble.com/Distance-function-is-not-in-meters-tp16127891p16127891.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@...
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users


Looking for last minute shopping deals? Find them fast with Yahoo! Search.
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

Re: Distance function is not in meters

by Nicolas Ribot :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> If I use sphere they have to both be points, the actual search I am doing is
> distance(the_geom, GeometryFromText('POINT(10 10)',4326))
>
> the_geom field is a polygon or a multipolygon
>

Then you will have to transform (reproject) your data into a metric
projection system where distance between geometries will return the
exact result.
You can choose a suitable UTM zone to transform to, then computes the distance.

Keep in mind that except for distance_sphere and distance_spheroid,
PostGIS computes in a cartesian planar surface and returns results in
object's units (degrees if you store lon-lat coordinates).

HTH
Nicolas
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

RE: Distance function is not in meters

by brindahl :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How about:
distance(the_geom, transform(GeometryFromText('POINT(10 10)',4326),
srid(the_geom)))

-----Original Message-----
From: postgis-users-bounces@...
[mailto:postgis-users-bounces@...] On Behalf Of David
Jordan
Sent: Tuesday, March 18, 2008 1:01 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Distance function is not in meters

If I use sphere they have to both be points, the actual search I am doing is

distance(the_geom, GeometryFromText('POINT(10 10)',4326))
 
the_geom field is a polygon or a multipolygon

Paul Ramsey <pramsey@...> wrote:

        distance_sphere(GeometryFromText('POINT(10 10)',4326),
        GeometryFromText('POINT(11 11)',4326))
       
        On 3/18/08, davidj2k wrote:
        >
        > I am trying to find the distance from a point to a polygon object
and when I
        > use the distance(geometry,geometry) function it returns something
that is
        > not in meters, I have been doing searches and all the examples of
using this
        > function shows it in meters but that is not what I am seeing for
example if
        > I use
        >
        > distance(GeometryFromText('POINT(10 10)',4326),
GeometryFromText('POINT(11
        > 11)',4326))
        >
        > I get
        >
        > 1.4142135623731
        >
        > How can I get this in meters? I need to do
        > distance < 1000 meters
        >
        > --
        > View this message in context:
http://www.nabble.com/Distance-function-is-not-in-meters-tp16127891p16127891
.html
        > Sent from the PostGIS - User mailing list archive at Nabble.com.
        >
        > _______________________________________________
        > postgis-users mailing list
        > postgis-users@...
        > http://postgis.refractions.net/mailman/listinfo/postgis-users
        >
        _______________________________________________
        postgis-users mailing list
        postgis-users@...
        http://postgis.refractions.net/mailman/listinfo/postgis-users
       


________________________________

Looking for last minute shopping deals? Find them fast with Yahoo! Search.
<http://us.rd.yahoo.com/evt=51734/*http://tools.search.yahoo.com/newsearch/c
ategory.php?category=shopping>


_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users