[postgis-users] Simple question: How to get projected distance?

Lance Arlaus lance.nospam.1 at codeberet.com
Wed Aug 10 08:03:59 PDT 2005


I know this is a simple question, but I'm just getting started with PostGIS
and I can't seem to perform a simple calculation.

I just need to calculate the distance between two points.  What am I doing
wrong?

 

Query:

    SELECT distance(PointFromText('POINT(40.8117 -74.218)', 32617),
PointFromText('POINT(40.8272 -74.1242)', 32617))

Returns:

    0.095.

Of course if I do the following, I get a reasonable answer (about 10km), but
it's not exactly what I want

    SELECT distance_sphere(PointFromText('POINT(40.8117 -74.218)', 32617),
PointFromText('POINT(40.8272 -74.1242)', 32617))

Even constructing a line and taking the length doesn't work and I've tried
all SRIDs.

 

Sorry to ask such a simple question.

Also, is there a document that describes the well known SRIDs?  I'm not sure
which one to use.  For example, the data I've got references WGS 84, but
there's a ton of SRIDs defined.  I've found docs describing the format of
the specification, but how are the SRIDs created (who serves as the
clearinghouse for this info)?

 

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050810/b3724fe6/attachment.html>


More information about the postgis-users mailing list