[postgis-users] Distance function is not in meters

Nicolas Ribot nicky666 at gmail.com
Tue Mar 18 12:22:37 PDT 2008


> 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



More information about the postgis-users mailing list