A Scalable Terrain Model, or STM for short, is a feature which can be used to create and display a very large terrain model using a multi-resolution technology similar to technology used for raster or point cloud data.
A Scalable Terrain Model is composed of multiples files, some mandatory and some optional. As for raster data managed by Raster Manager or point cloud data manager by the Point Cloud manager the terrain data are saved outside the .dgn file.
DGN File : The DGN file is used to keep the STM element, which is a standard MicroStation element. The STM element doesn't contain any terrain data, only the name of the STM file and other element related data used mainly used to control how the STM is displayed.
STM File : The STM file is mandatory and contains the terrain data at different resolutions and other relevant information (e.g. : geographic coordinate system, terrain data source(s), ...).
Draping Source File(s) : Those files are optional and are only created when some raster source(s) are associated with the STM for draping purpose. The .PSS file contains the description of the various sources and, optionally, different post-processing treatment (brightness, clipping, re-projection, etc...) that should be applied to the different source(s) before being draped on the STM. The .ctiff file is used to optimize the draping when viewing the STM at low resolution like when the STM is fit in a view.
Raster Source(s) : The raster sources from which raster data to drape on the STM are obtained.
A STM can be created from a variety of terrain data sources, from simple linear .dgn element to different type of DTM files (e.g. : DEM raster, InRoads .DTM, GeoPak .TIN, etc...) to 3D points files (e.g. : Point Cloud files, .xyz files, etc...).
An STM can be created from a set of points. There is no predefined maximum number of points that can be imported, though it is worth mentioning that the STM file size is directly related to the number of points added, and that some problems might arise with very big file sizes (e.g. many gigabytes).
When the STM is created some representations of the points at lower resolutions of the added points are created to ensure fast visualisation of the STM at bounded memory usage. Those resolutions are created by removing a given number of points from the previous resolution, starting with the original data at full resolution, using a basic filtering technique.
Here is a video showing the creation of an STM from two DEM raster files :
The filtering algorithm removes a specified number of points chosen randomly. The main advantages of this filtering algorithm is that it is very fast and ensures that the number of points at each resolution is deterministic. While this simple filtering algorithm might not be suitable for a dataset having areas of varied density of points, it gives extremely good results for datasets having uniform or near uniform density like point cloud data or DEM raster data.
An STM can be created from a set of breaklines. Note that at the moment, contrary to how points are treated, sub-resolutions are not created for the breaklines, so adding too many breaklines could lead to performance and memory problems.
While there is no sub-resolution created for breaklines some simple decimation of the breakline points is done at runtime. The purpose of this is to ensure that the number of breakline points displayed in a view is limited at a maximum of around 50,000 breakline points, resulting in fast display of breaklines. Note that displaying the full resolution (i.e. original points) of a specific breakline can be achieved by zooming in enough on that breakline or a region of that breakline.
An STM also supports all the linear features found in Bentley Civil applications (i.e. : InRoads, GEOPAK, MXROAD) such as islands, voids, holes, etc. Those linear features are displayed using the same rules as when displayed in a Bentley Civil application. Note that those linear features are treated internally in the same way that breaklines are, thus the number of linear features that can be added to a single STM is limited.
The display of an STM can be controlled from the Scalable Terrain Model dialog or from the Element Information dialog.
An STM can be represented by triangles or contours. Additionally raster can be draped on the STM.
To achieve high performance the STM display engine selects the points at the best resolution to ensure that the resulting triangles can always be seen on the screen. The STM display engine takes into account the resolution of the user's computer screen, the different resolution representations of the STM generated during its creation, and the perspective setting of the MicroStation view, if any.
The density of points displayed in a view is configurable by the user. When the highest density value is chosen (i.e. 100) the STM display engine selects the points that will result in the display of approximately a little less then one point per computer screen pixel.
When the lowest density value is chosen (i.e. 1) the STM display engine selects the points that will result in approximately 4000 times less points displayed compared to when the highest resolution density is chosen.
To ensure that the viewing of an STM is smooth and seamless previously displayed data are used as an overview before the correct data is available. This allows the user to rapidly rotate, pan and zoom the STM almost independently of the view density chosen, the resolution of the computer screen, the camera configuration of the MicroStation view and the number of points contained in the STM.
Here is a short video showing the display of a STM containing more than 6 billion points in a MicroStation view.
A new scalable raster draping technology has been developed for the Scalable Terrain Model to ensure very high quality, very high performance draping of raster like aerial photographs.
Here is a comparative table of the scalable draping technology versus the DCDrape technology :
Any raster sources that can be attached in Raster Manager can be draped on the STM. In fact, the first step in specifying a raster source to be draped on the STM is to attach it in Raster Manager.
The advantages of using Raster Manager are :
Note that the raster sources don't need to be kept in Raster Manager once they have been selected for draping.
Here is a short video showing the the selection and draping of more then 600 raster files (25+ gigabytes of data) on an STM.
Once you have selected the draping sources it is important to start the Generate functionality to generate a special .ctiff cache file that will be put in the same folder as the .stm folder. This .ctiff cache file contains overview (i.e. : lower resolution thumbnail) of all the draping sources, allowing fast draping of the STM when the STM is view at lower resolution (e.g. : fit operation).
Note that Descartes is able to detect when the draping source cache file needs to be regenerated because one or more draping source has been modified. The detection is done when the Check if up-to-date functionality is run.
The points and the breaklines in an STM cannot be edited directly. But a mechanism has been developed that detects when the STM needs to be regenerated. The steps to follow to edit the breaklines and points of an STM are:
Here is a short video showing the editing of a breakline in a STM.
Note terrain data source change detection mechanism is based on the last modified date of the file. So it is possible that the status of a STM is dirty even though the terrain data hasn't been modified. For example, if you change some data other than terrain data (e.g. : a building, a tree, etc...) in a .dgn file for which one level is used as terrain data source for a STM the last modified date of the .dgn will be changed and the STM status will be dirty, even though the terrain data source has not been modified.So it is best when to use data source containing only terrain data, if possible.
By default the Scalable Terrain Model is tuned in such a way to have smooth, fluid and fast display performance, which is very important when working in a MicroStation view featuring a Scalable Terrain Model. But for some MicroStation operations not requiring real time display performance (e.g. : printing, rendering, animation creation) the visual quality of the STM data (i.e. : resolution) used can be more important than the speed of obtaining those data. Thus the STM has a mode called presentation quality, which can be activated by creating an environment variable called STM_PRESENTATION_QUALITY and setting it to 1.
Currently setting the STM_PRESENTATION_QUALITY environment variable to 1 has two effects :
Note that the presentation quality mode is also affecting the dynamic viewing of the STM, at the cost of decrease display speed and smoothness. In some case this might be useful, for example for previewing some rendering or printing operation requiring higher visual quality. During standard view based operation it is recommended to keep the presentation quality mode off.
A geographic coordinate system (i.e. : GCS) can be specified for a Scalable Terrain Model, which described the geographic coordinate system reference for the terrain data. The specification of a GCS is optional.
Upon creation the different terrain data sources for which a GCS has been specified are automatically reprojected to the GCS of the STM if one has been specified. This allow different terrain data source with different GCS to be merged together or to reprojected the terrain data sources to a GCS better suit for some particular workflow.
Note that when choosing the STM’s GCS it is very important to choose a GCS which is valid for the territory covered by the terrain source data. The latitude and longitude range, which can also be called domain of validity, for which a GCS is valid is available in the standard MicroStation’s Select Geographic Coordinate System dialog as shown below (see the four rows pointed by the green arrow).
It is recommended to select a GCS whose domain of validity encompasses all terrain source data. If not, some terrain source data located outside the domain of validity that need to be reprojected might not be included in the STM during the creation process if those terrain source data cannot be reprojected.
When the GCS of the STM and the GCS of the DGN model the STM is attached to are different the STM engine automatically reprojects the STM to the GCS of the DGN model. This is true only if both the STM and the model have a valid GCS specified (i.e. : no reprojection can be done if the GCS or the STM has no GCS). This ensures that the STM data are correctly aligned with the other DGN elements present in the DGN model.
During the reprojection each point are reprojected precisely to the DGN model’s GCS (i.e. : no approximation of the mathematical function describing the reprojection operation is involved). Also the Delaunay triangulation is recomputed on the reprojected points, ensuring that the Delaunay triangulation is respected when the reprojected STM is displayed.
Currently only the points of the breaklines are reprojected, which gives good result for most STM’s GCS – DGN model GCS’s pairs. But for some reprojection that involves literally twisting the STM data significant errors along very long breakline segment (i.e. : huge distance between two consecutive points being part of a breakline) might occur. To avoid this it is recommended to only include small breakline segments.
It is quite possible and acceptable that the STM covers a region greater than the DGN model GCS’s domain of validity (see Reprojecting Terrain Data Source above for more information on the domain of validity of a GCS). In that case the STM engine might clip out the STM data outside the domain of validity of the DGN model’s GCS when those STM data cannot be mathematically reprojected. This clipping process ensures that no incorrect points (i.e. : inaccurate and possibly infinite) are displayed to the user.
If the GCS of the STM is one whose horizontal coordinates are latitude and longitude values (e.g. : WGS 84) the display of the STM other than from a top or bottom view will most likely look very odd (i.e. : highly vertically stretched). The reason is that a small variation of a latitude or longitude coordinate will most of the time correspond to a huge variation of the vertical coordinate. For example, if a STM covering a region spanning 0,1 degree longitude by 0,1 degree latitude (i.e. : approximately 12 km by 12 km depending the region location) and having elevation range of 300 meters is displayed in a MicroStation view then by default (i.e. : no reprojection involve) the X and Y coordinate of the STM in the MicroStation view will have a 0,1 unit variation in the X and Y direction but a 300 unit variation in the Z variation, even though 0,1 degree represent approximately 12 000 meters. Thus, it is not hard to image that if this particular STM is fit in a front view the result will be some kind a mesh mostly vertical spanning 300 units in the vertical direction and 0,1 unit in the horizontal direction.
This limitation can be easily solved by specifying a projected GCS (e.g. : State Plane, UTM) for the DGN model so that the STM horizontal coordinates be reprojected to horizontal coordinates related to a plane instead of the earth.
It is important to note that the on-the-fly reprojection process almost always reduce the display speed of the STM. So itis important to choose wisely the GCS of the STM during the creation process. If you are planning to use a STM in workflow involving only some GCS then it is better that your STM be also created in that GCS, avoiding on-the-fly reprojection and the display speed penalty.
If you want to create a huge STM covering a large area then you must choose a STM whose domain of validity encompassed the whole area, otherwise some terrain source data might be filtered out during the creation process. Moreover if that STM covering a large area is going to be used in different workflow requiring different localized GCS a latitude/longitude GCS for the STM might be the best choice. Indeed the reprojection from a latitude/longitude GCS to a projected or planar GCS (e.g. : State Plane, UTM) is usually faster than reprojecting a planar GCS to another GCS.