Proj4.jsで投影変換


Proj4.js
https://github.com/proj4js/proj4js/releases

2.1.2を使用、こんな感じか。
地理院的には緯度方向=Xなので注意。

WKTは下記

https://jpusergis.wordpress.com/2014/05/28/空間参照-wkt/

//JGD2000
proj4.defs['EPSG:4612'] = proj4.Proj('GEOGCS["JGD2000",DATUM["Japanese_Geodetic_Datum_2000",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6612"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4612"]]');
//9系
proj4.defs['EPSG:2451'] = proj4.Proj('PROJCS["JGD2000 / Japan Plane Rectangular CS IX",GEOGCS["JGD2000",DATUM["Japanese_Geodetic_Datum_2000",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6612"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4612"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",36],PARAMETER["central_meridian",139.8333333333333],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","2451"]]');

var p = proj4('EPSG:4612', 'EPSG:2451', [140, 36]);
var txt = document.getElementById('txt');
txt.value = "";
txt.value += "140,36 ⇒ " + p[1] + "," + p[0];
txt.value += "\n";
txt.value += "答え\n";
txt.value += "12.846,15025.785\n";
txt.value += "http://surveycalc.gsi.go.jp/sokuchi/surveycalc/bl2xyf.html より";
カテゴリー: 開発 タグ: パーマリンク