Re: [OpenMap Users] Getting a distance in pixels between 2 points on a specified proj ection

From: David Ward <synriga_at_yahoo.com>
Date: Fri, 19 Aug 2005 07:24:28 -0700 (PDT)

Laura,

Here is a starting point:

  Point p1 = projection.forward(loc1);
  Point p2 = projection.forward(loc2);
  int width = (int)java.lang.Math.hypot(p1.x-p2.x, p1.y-p2.y);

Cheers,
David
--- Laura Paterson <laura.paterson_at_generaldynamics.uk.com> wrote:

> Hi,
>
> I am trying to calculate a distance between two coordinates at a specified
> scale.
> I have created a projection based on a polygon at a certain scale, I
> recalculate the scale based on what mapping I have available at that
> location, then I want to get the width in pixels between the two coords at
> the new scale.
>
> I'm sure I have seem something on this before, but for some reason all my
> searches on the archives are returning empty...
>
> If anyone can point me in the right direction on this I would be very
> grateful!
>
> - Laura
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>


----
David Ward
ROLANDS & ASSOCIATES Corporation
500 Sloat Avenue
Monterey, CA 93940
USA
Tel: 1.831.373.2025
Fax: 1.831.373.2841
Email: synriga_at_yahoo.com
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Aug 19 2005 - 10:32:22 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT