[Openstreetmap-dev] WGS84/UTM/Lambda... Projection library

Immanuel Scholz immanuel.scholz at gmx.de
Mon Sep 19 08:27:27 BST 2005


Hi,

The last days, I was searching for a good java library for coordinate
projection from WGA84 to UTM, Lamda, Gauß/Krüger.. maybe even with
differenc reference ellipsoids. I found some not very promising links
and ended up porting the osm-editor Jeeps wgs->utm projection code.

Does anyone know a good (and GPL-compatible) library to use for this
stuff?

I'll take a look at http://freegis.org/ this evening, but maybe some of
you have experience alright? ;-)



I tried the following libraries:

geotools http://www.geotools.org
Too big to use as whole, too deep involved to exctract.

geoconv http://www.i3s.unice.fr/~johan/gps
Poorly written. Not really usable as a library. Even when modified, it
seems to just calculate wrong (London looks very stretched this way..)

geotransform http://www.geovrml.org/geotransform
Excellent performance, agreeable interface. But terrible license (I
asked the authors to give me a gpl-like license... you should never stop
hoping.. ;).

JEEPS (no url, code extracted and ported from osm-editor)
Can someone give me a working url? The code I found used the Airy1830
ellipsoid and can transform GdC<->UTM, which is just the basic need ;).
But I would be pleased to include some more projections in my code, for
people who have background maps of different systems (here in germany,
we usually have Gauß/Krüger maps with either Krassowski or GR80)

OSM - Java applet uses it's own projection code (Mercator projection)
I looked at the java applet and it looks, like they use some very simple
mapping on a sphere instead of a ellipsoid. Since the applet can map on
background images, this code has to work... a bit...

But then...

  public double kilometersPerPixel() {
    return (40008.0 / 360.0) * degrees_per_pixel;
  }

40008? Remembers me of: "This mummy is 2003 years old" - "Why can you
calculate it this precise?" - "Well, I can't. But I startet to work as a
museum guide 3 years ago and I was told, the mummy is 2000 years
old." :-D

(Ok, I'm sorry for the ranting. Earth is either 40.076,592 km perimeter
on aquator or 40.009,153 km perimeter through the pol. Mercator
projection is longitude-correct, so it should use the bigger perimeter,
right? ;)


Ciao, Imi.

PS: Feel free to correct me, I am a coder, not a geodesist ;)






More information about the dev mailing list