使用 Geotools 绘制的 LineString 不正确

Incorrect LineString is being drawn using Geotools

我正在尝试使用地理工具在地球上画一条线,但在画线时没有考虑两点之间的最短距离,绘制的 lineString 绕地球走了很长的路并提供了错误 results.When 我在 google 地图上画了相同的线正在绘制结果路线 correctly.The 黑白地图正在使用 geotools,另一张来自 google maps.Can 任何人请指点我我哪里错了 PS: 坐标为log,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 度处有不连续性。因此,您的行以 "obvious" 方式表示。

解决方案是在另一个投影中绘制您的地图,例如 PDC Mercator (EPSG:3832),这将为您提供如下地图:

如您所见,背景地图存在一些问题,因为格陵兰岛和南极洲穿过地图边缘的新断裂。