Hey- Christopher Schmidt wrote: > On Wed, Mar 19, 2008 at 08:44:42AM +0100, Gérald Quintana wrote: >> Hi, >> >> Once I saw an example of Control to measure the length of a path >> (rubber), but I can't find it anymore. Where is it? >> >> I managed to do my own using the DrawFeature control and the >> Curve.getLength() method but I miss the conversion factor to get the >> distance in meters or kilometers, how can I do it?
Note that it is not as simple as saying you want to measure distance in meters. You have to specify whether you want to measure planar distances in the same projection as your data (this is what line.getLength() * unitConversion will get you) or whether you want to measure geodesic distances (shortest path on a spheroid). The distVincenty function that Chris mentions below is *not* about converting units of the planar measurement. It is about measuring geodesic distances. If you want to measure the perimeter of Africa or you're planning a trip from NYC to London and you want to know how much fuel you'll need, by all means use geodesic distances. If you're measuring distances around the block or to the grocery store, you'll find that planar distances in your projected system work well. Tim > > No measurement tool in OpenLayers has ever done this. Hoever, the > OpenLayers.Util.distVincenty function might help you. > > Regards, _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
