[josm-dev] How do I add a new projection, EPSG:2924?
Dirk Stöcker
openstreetmap at dstoecker.de
Wed Feb 9 17:26:45 GMT 2011
On Wed, 9 Feb 2011, Josh Doe wrote:
> Just wanted to say thank you, and that I've got it working. I decided
> to use the OSGeo Proj4J library [1] since it has support for datum
> transformations and has a huge database of EPSG data. I loaded up the
> county property map using pdfimport and everything lined up to within
> less than a meter (from data I added via GPS and Bing aerial).
>
> It would be trivial to add all projections supported by Proj4J to
> JOSM, all that is required is to change the EPSG code. I'm not sure
> how to implement this as a plugin, though I do see projections can
> have a preference panel so perhaps the EPSG code could be set there,
> but I'm not sure if that will work.
Yes. Please. I waited for a proper PROJ.4 plugin for a long time now.
In the preferences you can build a whole own set of settings, not only
one. Basically you have functions for:
a) display preferences gui and do user based settings
--> To allow user to set projection details
b) get projection-instance from prefs list
--> To instantiate the projection with stored prefs
c) get prefs-list from a given EPSG-code
--> To get a projection matching a certain EPSG code (e.g. for WMS)
The simplest probably would be to collect all EPSG codes and present them
to the user for choosing one. Thought from that point there should be many
possibilities to improve user experience ;-)
The prefs list is a simple list of strings defining you Projection
specific settings. In the simple case above it would be one entry only
containing the EPSG code.
Ciao
--
http://www.dstoecker.eu/ (PGP key available)
More information about the josm-dev
mailing list