I am trying to code a transformation from a local 3D Cartesian (which is attached to a moving platform) to geocentric coordinate reference system (CRS) using the referencing module of Geotools. The geotools user guide mentions a "A contextually local coordinate reference system (for construction projects or moving objects)", which sounds exactly like the CRS I need. However, the guide and documentation of Geotools is unclear on how to define the origin and orientation of such a CRS.
Geotools provides a Constructor for creation of an EngineeringCRS, which requires a EngineeringDatum as a parameter. This Datum can be created using a DatumFactory, however the method does not specify how to define the "AnchorPoint" of the CRS, which I assume is the origin.
I'd like to do something like this
EngineeringDatum bodyFrameOrigin = new DefaultEngineeringDatum(/* specify name, origin, orientation,and baseCRS */)
EngineeringCRS bodyFrame = DefaultEngineeringCRS("bodyFrame", bodyFrameOrigin, DefaultCarthesianCS.GENERIC_3D);
I'd expect the call bodyFrame.getDatum().getAnchorPoint()
to return a string describing the origin. Further I'd expect CRS.getTransform(bodyFrame, WGS84_3D)
to return a valid coordinate transformation between the coordinate systems.