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

如何获取Bursa-Wolf参数(towgs84),而无需将数据转换为WKT字符串并手动解析?

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]]

最佳答案

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);

10-04 20:07