1
Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m +no_defs ";

Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";

alert(feature.geometry.getVertices()[0].x);
alert(feature.geometry.getVertices()[0].y);
var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);


//Define the source Coord Sys 
var src = new Proj4js.Proj("EPSG:4326");
//Define the destination Coord Sys   
var dst = new Proj4js.Proj("EPSG:2322");

var gk=  Proj4js.transform(src, dst, point);
alert(gk);

i can get x and y cordinates but when i convert them to epsg 2322. x will change but y is always zero.

i found thats code but it is not converting correct


  Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m +no_defs";
        Proj4js.defs["EPSG:4326"] = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
        Proj4js.defs["GOOGLE"] = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";
        Proj4js.defs["EPSG:900913"] = Proj4js.defs["GOOGLE"];





        //Define the source Coord Sys 
        var src = new Proj4js.Proj("EPSG:900913");
        //Define the destination Coord Sys   
        var dst = new Proj4js.Proj("EPSG:2322");
        var point = new Proj4js.Point(feature.geometry.getVertices()[0].x, feature.geometry.getVertices()[0].y);
        Proj4js.transform(src, dst, point);
3

I'd add the +towgs84 parameters in EPSG:2322 definition in order to have a quite correct transformation (accuracy: 2 meters), as reported here (EPSG Geodetic Parameter Dataset):

Proj4js.defs["EPSG:2322"] = "+proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=intl +units=m +towgs84=-84.1,-101.8,-129.7,0,0,0.468,1.05 +no_defs";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.