GeoTools:如何从GeodeticDatum实例获取Bursa-Wolf参数

时间:2017-07-31 16:50:46

标签: java geotools

我有一个GeodeticDatum类型的实例。我可以使用方法datum.getEllipsoid()getName()getInverseFlattening()等获得椭球名称,展平,轴等。

如何在不将数据转换为WKT字符串并手动解析的情况下获取Bursa-Wolf参数(towgs84)?

DATUM["New Zealand Geodetic Datum 1949", 
  SPHEROID["International 1924", 6378388.0, 297.0], 
  TOWGS84[59.47, -5.04, 187.44, 0.47, -0.1, 1.024, -4.5993]]

1 个答案:

答案 0 :(得分:1)

ProjectedCRS crsFromWkt = (ProjectedCRS) CRS.parseWKT(/*OGC WKT of your projected coordinate system*/):
DefaultGeodeticDatum defaultGeodeticDatum = new DefaultGeodeticDatum(crsFromWkt.getDatum());
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].dx);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].dy);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].dz);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].ex);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].ey);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].ez);
        System.out.println(defaultGeodeticDatum.getBursaWolfParameters()[0].ppm);