[Geoserver-users] How to get the distance between two points

Hello everyone!

I am getting the distance between two points, I have the coordinates of the points(longitude and latitude), and SRS is 4326. But I dont know how to calculate.

Who can give me some helps? Thanks a lot!

Youni.

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£ http://www.hotmail.com

悠 妮 ha scritto:

Hello everyone!

I am getting the distance between two points, I have the coordinates of
the points(longitude and latitude), and SRS is 4326. But I dont know how
to calculate.

Who can give me some helps? Thanks a lot!

Well, Geoserver does not do that. Geotools has the GeodeticCalculator
that has been designed to do this very job.
Thought, if you want a simple solution just for 4326, you may want
to google for "great circle distance", if I remember properly there
are simple expressions for that.

Cheers
Andrea

hmm, I'm not a projection expert but I can give you some hints.
4326 (lat/long) is measured in degrees. So distance is meaningless
there. You will have to reproject your data into a projection that has
an equal scale I think, maybe equal area. I can't remember. This page
will teach you a bit about it:
http://www.colorado.edu/geography/gcraft/notes/mapproj/mapproj_f.html

Brent Owens
(The Open Planning Project)

ÓÆ ÄÝ wrote:

Hello everyone!

I am getting the distance between two points, I have the coordinates
of the points(longitude and latitude), and SRS is 4326. But I dont
know how to calculate.

Who can give me some helps? Thanks a lot!

Youni.

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£ http://www.hotmail.com

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  

Brent Owens ha scritto:

hmm, I'm not a projection expert but I can give you some hints.
4326 (lat/long) is measured in degrees. So distance is meaningless
there. You will have to reproject your data into a projection that has
an equal scale I think, maybe equal area. I can't remember. This page
will teach you a bit about it:
http://www.colorado.edu/geography/gcraft/notes/mapproj/mapproj_f.html

Brent, reprojection usually means distance distortion too.
There are equations to compute the real distance given lat/lon
of the two points. For example the great circle distance
(http://en.wikipedia.org/wiki/Great-circle_distance) is one, that
assumes earth is spherical, and guardantees at most 0.5% error,
usually better than distance computed on projected maps,
especially if the points are far apart.

Cheers
Andrea

Hi Brent, Hi Andrea,

Thank you very much first!

I cant get the page that Andrea suggested(http://en.wikipedia.org/wiki/Great-circle_distance), but when I search with google, I get another page about Great Circle Calculator(http://williams.best.vwh.net/gccalc.htm). It does by javascript, and we can get the script in the page.

I have validated the veracity of the distance result through comparing with the result of GoogleEarth. I think this page is worth being recommended.:slight_smile:

Regards,
Youni

From: Andrea Aime <aaime@anonymised.com>
To: Brent Owens <brentowens@anonymised.com>
CC: ÓÆ ÄÝ <youni_9@anonymised.com>, geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] How to get the distance between two points
Date: Tue, 21 Nov 2006 17:27:04 +0100

Brent Owens ha scritto:
> hmm, I'm not a projection expert but I can give you some hints.
> 4326 (lat/long) is measured in degrees. So distance is meaningless
> there. You will have to reproject your data into a projection that has
> an equal scale I think, maybe equal area. I can't remember. This page
> will teach you a bit about it:
> http://www.colorado.edu/geography/gcraft/notes/mapproj/mapproj_f.html

Brent, reprojection usually means distance distortion too.
There are equations to compute the real distance given lat/lon
of the two points. For example the great circle distance
(http://en.wikipedia.org/wiki/Great-circle_distance) is one, that
assumes earth is spherical, and guardantees at most 0.5% error,
usually better than distance computed on projected maps,
especially if the points are far apart.

Cheers
Andrea

_________________________________________________________________
ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger: http://messenger.msn.com/cn