Hallo,

> zanke mich gerade mit Koordinatenumrechnungen rum. Ich will Distanzen in
> meinen Fahrradroutenzusammenklicker http://www.pifpafpuf.de/cycleroute/
> einbauen

Das

    <script
      src="http://dev.openlayers.org/nightly/OpenLayers.js";></script>

floesst mir ein bisschen Angst ein. Ich sehe auch nur eine weisse
Flaeche statt einer Karte. Hab mich mit dem Openlayers nicht so
beschaeftig, aber die Rechts- und Hochwerte, die die
Mercator-Projektion da ausspuckt, sollten eigentlich schon Meter sein!
Oder arbeitet das inzwischen mit richtigen lat/lon-Werten? Dann musst
Du Dir irgendwo eine "great circle distance"-Formel klauen. In Java
geht das so:

  /**
   * Computes the distance between this lat/lon and another point on the earth.
   * Uses spherical law of cosines formula, not Haversine.
   * @param other the other point.
   * @return distance in metres.
   */
  public double greatCircleDistance(LatLon other) {
          return (Math.acos(
                  Math.sin(Math.toRadians(lat())) * 
Math.sin(Math.toRadians(other.lat())) + 
              
Math.cos(Math.toRadians(lat()))*Math.cos(Math.toRadians(other.lat())) *
                            Math.cos(Math.toRadians(other.lon()-lon()))) * 
6378135);
  }

Bye
Frederik

-- 
Frederik Ramm  ##  eMail [EMAIL PROTECTED]  ##  N49°00'09" E008°23'33"


_______________________________________________
Talk-de mailing list
[email protected]
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/talk-de

Antwort per Email an