Why use a topocentric reference?
A 3D model, either a BIM model or a general purpose model, usually doesn’t contain georeferencing information. To work with such models in LuciadFusion and LuciadLightspeed, you must position them on the globe by providing a coordinate reference system.
A topocentric reference is a 3D Cartesian space with the XY-plane tangential to the Earth surface and the origin on a given longitude-latitude-height (LLH) coordinate. In particular:
-
the X-axis points east
-
the Y-axis points north
-
the Z-axis points up
-
One unit corresponds to one meter
With these properties, a topocentric reference is well suited to georeferencing 3D models.
Using a reference file
Like other references, you can describe a topocentric reference in the Well-Known Text (WKT) reference format.
Typically, the reference is stored in a .prj file.
LuciadLightspeed and LuciadFusion automatically use a reference file with the same name as the model.
For example, if the file name of your model is mymodel.glb, you name the reference file mymodel.prj and store this file in the same directory as your model. LuciadLightspeed and LuciadFusion then automatically pick up the
reference file with the model file.
For more information on using reference files, see How to specify the georeference of your data.
Use the Java API to create a topocentric file
The API provides the TLcdTopocentricReference class to represent a topocentric reference.
It also offers the TLcdWKTModelReferenceEncoder to write the reference in WKT format in a .prj file.
This program shows an example of combined use of those classes:
TLcdLonLatHeightPoint origin = new TLcdLonLatHeightPoint(4.669129, 50.865039, 64);
ILcdModelReference llhRef = new TLcdTopocentricReference(new TLcdGeodeticDatum(), origin);
new TLcdWKTModelReferenceEncoder().save(llhRef, "/path/to/myReference.prj");
The result is a new .prj file in WKT format at the specified location.
Create a topocentric reference file by hand
If you only have a few models to georeference, it can be easier to create a reference file manually.
You can use the following WKT template to create a topocentric reference. Replace the values of the latitude, longitude, and height parameters as needed.
myReference.prjENGCRS["Topocentric reference",
GEOGCS["WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137.0,298.257223563],
TOWGS84[0.0,0.0,0.0,0.0,0.0,0.0,0.0]]],
DERIVINGCONVERSION["Origin position",
METHOD["Geographic/topocentric conversions",AUTHORITY["EPSG",9837]],
PARAMETER["Latitude of topocentric origin",50.865039,UNIT["DEGREE",0.017453292519943295]],
PARAMETER["Longitude of topocentric origin",4.669129,UNIT["DEGREE",0.017453292519943295]],
PARAMETER["Ellipsoidal height of topocentric origin",64.0,UNIT["METER",1.0]]],
CS[Cartesian,3],
AXIS["Topocentric East (E)",EAST],
AXIS["Topocentric North (N)",NORTH],
AXIS["Topocentric height (U)",UP],
UNIT["METER",1.0]]