Some mesh or point cloud datasets do not contain any georeference. There may be several reasons for that, for example:

  • They were modeled in a CAD tool that does not deal with geospatial data.

  • They were scanned with a LIDAR sensor, and there was no GPS signal available at the time of recording.

In these cases, you can position and orient the dataset on the map yourself:

ogc3dtiles geolocate
Figure 1. Example of geolocating a CAD model that does not have a geospatial reference

We call this process geolocalizing a dataset to a geolocation.

We use the terms geolocation and geolocalization to indicate that this process is not equivalent to fully fledged georeferencing. During the geolocalization, we generate an Affine3DTransformation. The resulting dataset is not warped to follow the curvature of the earth. For this reason, we do not recommend geolocalizing anything larger than a building or landmark.

When to geolocalize a 3D Tiles layer?

To verify whether you need to geolocalize a TileSet3DLayer, have a look at the reference of its model. If the reference of the model is a CoordinateReference with a CoordinateType.CARTESIAN, it is by definition a non-spatial reference.

If you do not create a transformation for such a dataset, your application will throw an error when it tries to add it to a map.

How to geolocalize a 3D Tiles layer?

The TileSet3DLayer class has a transformation parameter that you can set either at construction time, or during the lifetime of the object.

The transformation property allows you to configure a transformation that will be applied to the model coordinates of the model of the layer. As a result, the non-georeferenced TileSet3DLayer is re-positioned, oriented, and scaled.

It is recommended to use Affine3DTransformation, which allows you to generate an affine transformation and apply it to a TileSet3DLayer. The Affine3DTransformation class has a few static constructor functions. You can use the createFromGeoLocation function for geolocalization purposes.

Applying a geolocation affine transformation to a non-geospatial dataset to display it on a map
//Create geolocation point at longitude 50, latitude 5 degrees.
const geolocation = createPoint(getReference("CRS:84"), [5, 50]);

//Create Affine3DTransformation with the previously created geolocation, and an azimuth of 90 degrees.
const affine3DTransformation = createTransformationFromGeoLocation(geolocation, {azimuth: 90});

//Apply the affine3DTransformation to the layer
const tileSet3DLayer = new TileSet3DLayer(model, {
  transformation: affine3DTransformation,
  isPartOfTerrain: false
});

An Affine3DTransformation has a sourceReference and a destinationReference.

The default source reference is a non-spatial Cartesian reference, with the X-axis pointing to the east, the Y-axis pointing to the north, and the Z-axis pointing upwards. This default is also used as the reference if an OGC 3D Tiles dataset does not have a spatial reference.

The default destination reference for the Affine3DTransformation.createFromGeoLocation factory function is a geocentric reference. This is the default reference used by OGC 3D Tiles. Therefore, you should also use it for the purpose of geolocalizing an OGC 3D Tiles dataset.

For a demonstration of geolocalization, see the Geolocate OGC 3D Tiles sample.