Advertisement

【geotools】ReprojectingFeatureCollection坐标转换异常

阅读量:

在使用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",true),
    			CRS.decode("epsg:3857",true));
    
    
    java
    
    

全部评论 (0)

还没有任何评论哟~