我從雷達獲得很多座標,這些座標格式與Google地圖座標幾乎相同,但我不確定,但我問了公司,他們告訴我們我爲了得到艾伯的投影座標,我需要做到以下幾點:將經度和緯度轉換成圖像Alber投影上的X,Y像素座標
然後,您將可以創建2 CoordinateReferenceSystem(即 座標系),其中一個設爲默認值(LON/LAT ),並設置 另一個與WKT字符串(將投影X/Y)。那麼你可以很容易地創建2個MathTransform,以便在兩個方向上都進行轉換。
這是OGC WKT的艾伯的預測:
PROJCS["unnamed",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235629972,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Albers_Conic_Equal_Area"],
PARAMETER["standard_parallel_1",31.996308],
PARAMETER["standard_parallel_2",33.996308],
PARAMETER["latitude_of_center",32.996308],
PARAMETER["longitude_of_center",35.415901],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
所以,從我得到的是,我需要從長/轉換緯度到高鐵總站投影上顯示的Alber的投影地圖圖像。
所以在GeoTools我用下面的代碼:
CoordinateReferenceSystem source = CRS.decode("EPSG:4326");
CoordinateReferenceSystem target = CRS.parseWKT("PROJCS[\"unnamed\", GEOGCS[\"WGS 84\", DATUM[\"WGS_1984\", SPHEROID[\"WGS 84\",6378137,298.2572235629972, AUTHORITY[\"EPSG\",\"7030\"]], AUTHORITY[\"EPSG\",\"6326\"]], PRIMEM[\"Greenwich\",0], UNIT[\"degree\",0.0174532925199433], AUTHORITY[\"EPSG\",\"4326\"]], PROJECTION[\"Albers_Conic_Equal_Area\"], PARAMETER[\"standard_parallel_1\",31.996308], PARAMETER[\"standard_parallel_2\",33.996308], PARAMETER[\"latitude_of_center\",32.996308], PARAMETER[\"longitude_of_center\",35.415901], PARAMETER[\"false_easting\",0], PARAMETER[\"false_northing\",0], UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]]");
MathTransform transform = CRS.findMathTransform(source, target, true);
Coordinate c = JTS.transform(new Coordinate(34, 35), new Coordinate(), transform);
System.out.println(c.toString());
這就是輸出我得到:
(-38422.86847540497, 111410.0483012808, NaN)
現在,這可能是因爲錯誤的源座標系,但是他默認的long/lat系統是什麼意思?
即使我解決了這個問題,我該如何在地圖上顯示這些點?我的意思是它必須知道圖像的寬度/高度是不是?