【发布时间】:2016-10-08 02:26:04
【问题描述】:
我从雷达获得了许多坐标,这些坐标的格式与谷歌地图坐标几乎相同,我不太确定,但我问了公司,他们告诉我为了获得阿尔伯投影上的坐标,我需要执行以下操作:
然后您将能够创建 2 个 CoordinateReferenceSystem(即 坐标系),将其设置为默认值(经度/纬度),然后设置 另一个带有 WKT 字符串(将被投影为 x/y)。然后你 可以轻松创建 2 MathTransform 以在两者中转换 方向。
这是 Alber 投影的 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"]]]
因此,据我所知,我需要从 long/lat 转换为 WKT 投影以显示在 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)
现在,可能是因为 source 坐标系统错误,但他默认的 long/lat 系统是什么意思?
即使我解决了这个问题,我怎样才能让它在我的地图图像上显示这些点?我的意思是它必须知道图像的宽度/高度不是吗?
【问题讨论】: