我正在使用vaadin插件的v-leaflet(0.61)在地图上显示一些图层。如何将经简化后的经纬度转换为EPSG:4326
点击地图,我创建一个wms查询geoserver。 查询需要一些参数,其中之一是bbox。 我想,默认情况下,由地图返回的bbox位于CRS.Simple中,是一个神秘的传单坐标系统。
即使我已经设置属性
leafletMap.setCrs(Crs.EPSG3857);
myoverlayer.setCrs(Crs.EPSG3857);
既地图和层。
我学会了here使用JTS拓扑套件从EPSG转换到另一个的方法。
但我找不到从leafltet使用的Crs.Simple转换为EPSG(4326更好)的方法。
如果我设置EPSG3857,无论是地图和图层,它返回我是这样的边框:
约束:6.0919189453125,45.11617660357484,11.134643554687498, 46.50217348354072
如果我设置EPSG4326,用了同样的观点:
约束:6.0919189453125,44.81597900390625,11.1346435546875,
46.80450439453125
似乎只有纬度值已被改变。
我tryed使用也JTSTool(JTS拓扑套房)从EPSG3857转换为EPSG4326和值:
BBOX = 4.0528551003362907E-4,5.4724638981914947E-5,4.1773613184440224E -4,1.0002420488398699E-4
这听起来太奇怪了....
有人可以帮助我了解CRS用于定义BBOX?或者任何方式来改变它们?
"
CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:4326");
CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:3857");
MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, false);
GeometryFactory geometryFactory = new GeometryFactory(new PrecisionModel(), 4326);
com.vividsolutions.jts.geom.Point point = geometryFactory.createPoint(new Coordinate(bbb.getSouthWestLon(),bbb.getSouthWestLat()));
com.vividsolutions.jts.geom.Point point2 = geometryFactory.createPoint(new Coordinate(bbb.getNorthEastLon(),bbb.getNorthEastLat()));
com.vividsolutions.jts.geom.Point targetPoint = (com.vividsolutions.jts.geom.Point) JTS.transform(point, transform);
com.vividsolutions.jts.geom.Point targetPoint2 = (com.vividsolutions.jts.geom.Point) JTS.transform(point2, transform);"
问题是我可以导入proj4Leaflet无法在vaadin的Leaflet之前加载它。 所以不可能使用。 –