[josm-dev] Meters to Pixels

Irene Pucci ipucci at navionics.it
Thu Oct 28 11:19:03 BST 2010


Thank you so much!
But, for example, if I have the value (in meters) of the distance between two nodes (n.getCoor().distance(n1.getCoor())), can I convert this value in pixels?

Cheers,
Irene

-----Original Message-----
From: dieterdreist at gmail.com [mailto:dieterdreist at gmail.com] 
Sent: giovedì 28 ottobre 2010 12.11
To: Irene Pucci
Cc: josm-dev at openstreetmap.org
Subject: Re: [josm-dev] Meters to Pixels


2010/10/28 Irene Pucci <ipucci at navionics.it>:
> Hi!
> Another question..
> There is a method that converts meters in pixels?


this depends on the resolution and aspect ratio of the pixels. If you print at 300dpi and pixels/dots are 1:1 (height:width) you can easily calculate that 1 pixel measures 1/300inch = 0,0033333333333333333333333333 inches (rounded). So one pixel is around 0,000084667 metres at 300 dpi. Screen resolutions vary.

cheers,
Martin



More information about the josm-dev mailing list