我正在尝试使用geotools在地球上画一条线,但是绘制画线时,它并没有考虑两点之间的最短距离,而是在地球上走了很长的路,并提供了错误的结果。谷歌地图上的一条线正确绘制了生成的路线。黑白地图正在使用geotools,另一幅是从google maps。有人可以指出我我要去哪里了PS:坐标在对数中,lat
Coordinate[] myLineString = new Coordinate[]{
new Coordinate( -110.0,20.0),
new Coordinate( 143.41666666666666,41.583333333333336 ),
new Coordinate( 140.8,41.65)
};
Hints hints = new Hints(Hints.CRS, DefaultGeographicCRS.WGS84);
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(hints);
LineString lineString = geometryFactory.createLineString(coordinates);
简单的答案是因为您使用的EPSG:4326具有+/- 180度的不连续性。因此,您的行以“显而易见”的方式表示。