[OSRS-PROJ] java port of proj4j

James Macgill j.macgill at geography.leeds.ac.uk
Sat Feb 23 12:18:01 EST 2002


(apologies if this reaches the list twice.  I am sending again as I think 
my first post was blocked by the new anti-spam filter - my address has 
changed slightly since I subscribed)

Hi all.

I suggested on this list a LONG time ago that I would look at porting PROJ 
into java, well at long last I have finally got round to doing it!

Prepare for the world's most unexciting screen grab....

 >java org.geotools.proj4j.Proj +proj=tmerc
20 20
2126263.9063724605      2343041.817143553
20d30'15"N 30d40'25"
1984927.1813686488      3580979.7594292453
20d30'15"N 30d40'25"S
1984927.1813686488      -3580979.7594292453

 >java org.geotools.proj4j.Proj +proj=tmerc +es=0.2
20 20
2159170.7410709434      1937461.6825210112

OK, so its not all there yet by a long shot, but the core architecture has 
been replicated, though with some moves to take advantage of OO.

It's been a bit of a balancing act to keep a structure that is similar 
enough to PROJ to be familiar and easy to update as PROJ develops whilst 
not producing awkward Java but I think I have it about right for now, 
though I may well do a little more OO design over time.

So far I have only implemented tmerc and utm (ok so not hard) but I will be 
moving through the others quite rapidly I hope, though support from others 
at this stage would be excellent.  (Not much is involved if you understand 
a little Java as the structure is almost identical to the PJ_* files.)

What I could really do with is a good set of test files and typical 
settings (and pathological cases) for each projection so that I can 
continue to build up the library of unit tests I have created alongside the 
port to ensure it is as faithful to PROJ as possible.

The brave can access the code from the geotools.org cvs repository:
cvs -z3 -d:pserver:anonymous at cvs.geotools.org:/cvsroot/geotools co proj4j

In addition to a java compiler you will need ant (a java make tool) and 
junit (a testing suite) if you want to replicate the build and test process 
that I am using.

Eventually proj4j will be available as a stand alone .jar file together 
with .sh and .bat files to make running it almost identical to proj.

I would very much welcome comments on the approach I have taken with this port.

There is a long list of things still to do, as a taster:
lots of testing
grid shifts
formatting control (input and output)
rtodms (dmstor is done)
input from files (binary and ascii)
full replication of public api (transform is done but is untested)
lots more testing

-- 
James Macgill
Center for Computational Geography
Spell Checker (c) Creative Spelling inc (aka my dyslexic brain)
http://www.geotools.org  the open source java mapping toolkit.



----------------------------------------
PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.



More information about the Proj mailing list