FME Version
Files
Introduction
Measuring volumes is slightly more complex than measuring distances and areas - in real-life as well as in FME.
Volume calculations in FME are carried out using the VolumeCalculator transformer. However, this transformer only operates on true three-dimensional objects (such as solids and blocks) and not psuedo-3D (or 2.5D) features such as vector line features with a Z coordinate.
For this reason, it's common to need to use other transformers besides the VolumeCalculator, to transform the source data into a geometry type on which volume measurements can be carried out.
Video
Source Data
The first source dataset for this example is a set of polygons (in an AutoCAD DWG dataset) representing the outline of a sports stadium that we wish to calculate the volume of.
The second dataset (in GML format) is a point cloud dataset that define buildings.
The datasets look like this in the FME Data Inspector:
The scenario here is that we wish to calculate the volume of the stadium. To do so we need to convert the building footprint into solid elements and extrude them to their true height. Rather than make a guess at their height, we'll get that information from the point cloud.
The plan is to:
- Cut the point cloud into several point clouds using the building footprints as a clip boundary
- Calculate the median height of each new point cloud
- Restore the building footprint geometry
- Extrude the building footprints to 3D blocks set to the median height
- Calculate the volume of the building blocks
As you can see, the actual volume calculation is the least complex step of the entire process. And here the data has already been filtered - the point cloud only contains buildings, for instance - to make this example simpler!
Step-By-Step Instructions
1. Start FME Workbench and begin with an empty canvas.
Select Readers > Add Reader from the menubar.
Set the data format to Autodesk AutoCAD DWG/DXF. Select the attached dwg file as the source dataset.
2. Again, select Readers > Add Reader from the menubar.
This time set the data format to ASPRS Lidar Data Exchange Format (LAS). Select the attached LAS dataset as the source.
3. Add a GeometryExtractor transformer connected to the building footprints feature type. Open the parameters dialog and set the Geometry Encoding to FME Binary:
What this does is store a copy of the building footprint geometry as an attribute value (_geometry), which will be used to restore the geometry after the data has passed through the clip process.
4. Add a Clipper transformer. Connect the GeometryExtractor:Output to the Clipper:Clipper port. Connect the point cloud feature type to the Clipper:Clippee port:
Open the parameters dialog and check the Clipper Type parameter is set to "Multiple Clippers" and that the Merge Attributes checkbox is turned ON.
5. Add a PointCloudStatisticsCalculator transformer connected to the Clipper:Inside port. Open the parameters dialog and set a checkmark in the box for Median Z component:
This transformer will provide the height of each building by calculating the median height of each building-shaped point cloud.
6. Now we can rebuild the polygon geometry, extrude it, and calculate the volume. Firstly place a GeometryReplacer transformer attached to the PointCloudStatisticsCalculator:Output port. Open the parameters dialog and set the Encoding to "FME Binary" and the Geometry Source to the _geometry attribute that we created earlier.
7. Add a 3DForcer transformer connected to the GeometryReplacer:Output port. Open the parameters dialog and set an elevation of zero (0). This will cause the base of the building to have a zero elevation.
The workspace will now look like this:
8. Add an Extruder transformer connected to the 3DForcer:Output port. Open the parameters dialog and set the Extrusion Direction parameter to "Vertical" and the Extrusion Height parameter to z.median, the attribute calculated by the PointCloudStatisticsCalculator transformer:
9. Now we have solid features of the correct elevation, add the VolumeCalculator transformer, connected to the Extruder:Output port.
10. Finally add a StatisticsCalculator transformer and connect an Inspector transformer to its Complete output port. The workspace will now look like this:
Open the StatisticsCalculator parameters. Set it to analyze the _volume attribute and write the Sum to an attribute called _TotalVolume:
11. Now save and run the workspace. The translation will be carried out and the result (total volume of all extruded buildings) provided as an attribute.
Comments
0 comments
Please sign in to leave a comment.