[Proj] map coordinates in different coordinate system

stretch andrew.deklerk at gmail.com
Wed Jul 8 06:32:23 EST 2009


I recently posted this to the openlayers forum, and was recommended to post
the question here:
I am trying to display my map coordinates in a different coordinate system
to what the map is in. I have followed the instructions with using proj4js
and have the following setup:

I am referencing the proj4js combined and compressed js file, and I am
referencing the two additional EPSG2054.js and EPSG4148.js, which contain: 

Proj4js.defs["EPSG:2054"] = "+proj=tmerc +south +ellips=WGS84 +datum=WGS84
+lon_o=31 +k_0=1 +units=m +no_defs"; 
Proj4js.defs["EPSG:4148"]  = "+proj=longlat +ellps=WGS84
+towgs84=0,0,0,0,0,0,0 +no_defs "; 
The openlayers code for reference is:

var options = { scales: [50000, 35000, 25000, 20000,
                            maxExtent: new
                            units:'m' }; 

    map = new OpenLayers.Map( $('map'),options); 

var mp=new OpenLayers.Control.MousePosition({div:$('coordsdd')}); 
    mp.displayProjection = new OpenLayers.Projection("EPSG:4148"); 
The coordinates are changed, but not correctly - i.e they are converted from
metres to metres, where they should be displaying dd. 
The first thing you will notice is that 2054 is not a standard. Would
someone be able to verify the correctness of this format?.

I have successfully translated coordinates previously using just
"+proj=tmerc +ellips=WGS84 +datum=WGS84 +lon_o=31"

Thanks in advance

Thanks in advance 

View this message in context: http://n2.nabble.com/map-coordinates-in-different-coordinate-system-tp3224904p3224904.html
Sent from the PROJ.4 mailing list archive at Nabble.com.

More information about the Proj mailing list