[postgis-users] Distance between two points...

Chris Jewell c.jewell at lancaster.ac.uk
Mon Sep 10 15:42:47 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

So, I need to find the distance between two point referred to by unique IDs.  I was
trying to do something like:

SELECT distance((SELECT location FROM points_tbl WHERE id=1000),(SELECT location FROM
points_tbl WHERE id=3029));

However, it appears that you cannot supply a query result as the argument to a
function.  I rather suspected this before I started ;-).  Is there another way to
return such a distance without having to write a function that copies the relevant
location geometries into variables, and then uses the distance function?

Many thanks,

Chris
- --
Chris Jewell, BSc(Hons), BVSc, MRCVS
Dept of Maths and Statistics
Fylde College
Lancaster University
Lancaster
Lancs
LA1 4YF
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG5chZtbYC54ephxMRAhSuAKCvu+Kf3+RWf/L1A6mibRWYsg38sACglPWj
xE8OkX+CabnqZaH/tX/SgSo=
=jgof
-----END PGP SIGNATURE-----



More information about the postgis-users mailing list