在使用ReprojectingFeatureCollection
进行坐标系转换时,出现
Error occured transforming MULTIPOLYGON;
Caused by: org.geotools.referencing.operation.projection.ProjectionException: Latitude 90°00.0'N is too close to a pole.
这样的错误
内部debug时,发现transform
时,出现了经纬度坐标翻转的问题.
解决: ReprojectingFeatureCollection
参数的CRS必须强制第一位为经度.
例如:
ReprojectingFeatureCollection features3857 = new ReprojectingFeatureCollection(featureCollection,
CRS.decode("epsg:4490"