CityGML XFM Application Template Documentation Bentley Map V8i (SELECTseries 2)
Table of Contents Introduction to CityGML 1 CityGML XFM Application Template 2 Requirements 2 Finding Documentation 2 To open a CityGML Workspace 3 Using the Command Manager 5 Importing/Exporting CityGML with FME 6 Using Macros 7 Macros from the Command Manager 7 Macros from the Project Manager 7 Promote_from_2D_Shape Macro 9 To run the Promote_from_2D_Shape Macro 9 Promote_from_3D_Solid Macro 13 To run the Promote_from_3D_Solid Macro 13 ii Table of Contents
Introduction to CityGML CityGML is a standard that is getting more and more popularity for 3D urban models. Here is how it is described on the CityGML official website: CityGML is a common information model for the representation of 3D urban objects. It defines the classes and relations for the most relevant topographic objects in cities and regional models with respect to their geometrical, topological, semantical and appearance properties. Included are generalization hierarchies between thematic classes, aggregations, relations between objects, and spatial properties. This thematic information go beyond graphic exchange formats and allow to employ virtual 3D city models for sophisticated analysis tasks in different application domains like simulations, urban data mining, facility management, and thematic inquiries. CityGML is realized as an open data model and XML-based format for the storage and exchange of virtual 3D city models. It is implemented as an application schema for the Geography Markup Language 3 (GML3), the extendible international standard for spatial data exchange issued by the Open Geospatial Consortium (OGC) and the ISO TC211. CityGML is intended to become an open standard and therefore can be used free of charge. More information and resources can be found on the CityGML official website: http://www.citygml.org/ The OGC official website also contains information on this standard: http://www.opengeospatial.org/standards/citygml 1 Introduction to CityGML
CityGML XFM Application Template The CityGML XFM application template was designed to let Bentley Map users quickly get up and running to start creating intelligent 3D objects (features) compliant to the OGC CityGML standard. Requirements The minimum and maximum installation requirements for this application template are as follows: Prerequisite Product Version Language Bentley Map 08.11.07.xxx English Finding Documentation The present document provides information on how to use the CityGML XFM application template. It is available from the Windows start menu, by clicking Start > Bentley > Bentley Map V8i > Documentation > Bentley Map V8i CityGML, as shown below. 2 CityGML XFM Application Template
You can also refer to the Bentley Map product documentation: http://docs.bentley.com/en/map/microstationmaphelp0.html To open a CityGML Workspace After installing the CityGML XFM application template, there are two ways to start working with this template: A. From the Windows start menu. 1. Click Start > Bentley > Bentley Map V8i > Samples > Bentley Map V8i CityGML. A Bentley Map session will start with the user workspace set to CityGML. 2. Open a DGN file or create a new one. 3 CityGML XFM Application Template
B. From Bentley Map File Open dialog. 1. Start Bentley Map. 2. In the File Open dialog, select the appropriate user for the CityGML application template as shown below. 3. Open a DGN file or create a new one. After opening a file, the Bentley Map Command Manager initializes with CityGML features. You are now ready to start using Bentley Map to create CityGML compliant data. 4 CityGML XFM Application Template
Using the Command Manager The Command Manager contains methods to easily create CityGML features. You can either create new features with Place methods, or create features from existing elements with Promote methods. To do so, double-click on the tool and follow the instructions. If you need more information on how to use the standard Command Manager tools the Bentley Map product documentation:, refer to http://docs.bentley.com/en/map/microstationmaphelp15.html 5 CityGML XFM Application Template
Importing/Exporting CityGML with FME The FME plug-in allows you to import or export CityGML data directly from Bentley Map. To do so, use the tools available in the File menu. For more information on how to use the FME plug-in, refer to the Bentley Map product documentation: http://docs.bentley.com/en/map/microstationmaphelp76.html Note: While importing or exporting CityGML data, ensure to select only features and properties that are defined in the CityGML format. For example, it is possible to import into a DGN file features that are not defined in the CityGML format. However, trying to export these features into CityGML will result in schema mapping conflicts. To solve such conflicts, uncheck the problematic features in the FME dialog so that they will not be exported. 6 CityGML XFM Application Template
Using Macros Macros from the Command Manager Two MVBA macros have been created to make it even easier to work with the CityGML application template. One of them can promote 3D solids to XFM Building features. The other one takes 2D shapes, extrudes them and then promotes the resulting solids to XFM Building features. The following sections of the present document provide the detailed procedures of how to use the macros. The macros can be used as any other tool in the Command Manager. Macros from the Project Manager When the macros have been used at least once, they are automatically loaded in the VBA Project Manager. Use the VBA Project Manager to run macros, or to start the Visual Basic Editor for adapting the macros to your specific needs. Note that you can get the location of the macros on your computer from the VBA Project Manager. It is recommended to make a copy of the macro before changing it. 7 Using Macros
To access the VBA Project Manager, use the Utilities menu. For more information on how to work with macros, refer to the MicroStation product documentation: http://docs.bentley.com/en/microstation/ustnhelp1652.html#nowhere 8 Using Macros
Promote_from_2D_Shape Macro Use this macro to easily create 3D XFM buildings from 2D footprints. If these footprints are 2D XFM features, the macro will use values from a property specified by the user to vertically extrude the selected shapes. It will then promote these new solids to XFM Building instances and initialize the gml_id and citygml_level_of_detail properties. A random unique value is created for the ID, while the level of detail is set to 1. To run the Promote_from_2D_Shape Macro 1. In the Promote from 2D Shape Macro dialog, choose a Selection mode. 2. Select each 2D shape to process, or place a fence around the feature(s) to process. 3. In the Promote from 2D Shape Macro dialog, click the Process button. The Choose Feature and Extrusion Property dialog displays. Note: To be valid, 2D shapes must be XFM features. If no valid features are found in the selection set or in the fence, an error message will display after clicking the Process button. This message invites you to try another selection. 4. In the Choose Feature and Extrusion Property dialog, select a valid feature. If there are several features in the selection set or in the fence, only one of them must be selected. As the feature is selected, the property field is initialized with the feature s properties. 9 Promote_from_2D_Shape Macro
Note: If many features need to be processed, using a fence presents an advantage, since it is not deleted during the process. This way, the macro can be used several times, with the same fence, to promote multiple features. 5. Choose which property contains the building heights that are required for the extrusion. Note: Any property of any type can be chosen. However, values which are not numbers will be treated as 0. Strings are converted into numbers, but if the conversion fails, they are treated as 0 too. With strings, be careful with the decimal symbol (, or. ). By default, the property is considered to designate the building height. However, it is possible to choose a property upon the number of floors of the buildings. In this case, turn on the Number of floors option. This will enable the next part of the dialog and allow you to define the floor height. 6. (Optional) Choose the floor height. The floor height is a value that is multiplied to the extrusion height value when this latest is a number of floors. If the floor height varies from one building to another, you can choose the feature s property in which these values are stored. On the other hand, you can enter a constant value that will be used for every building. 10 Promote_from_2D_Shape Macro
Note: Invalid values for the floor height property are treated exactly the same way as for the extrusion height property. 7. (Optional) Select the Manually merge several features into buildings option to merge several solids together during the process. By default, each feature instance is a distinct building and each selected shape is individually promoted to a building. By turning on this option, the macro s process will be interrupted to allow you to manually merge solids together before being promoted. Unfortunately, the macro cannot do the merge automatically since it does not know which solid has to be merged with which other solids. 8. In the Choose Feature and Extrusion Property dialog, click OK. The Unite Solids Step dialog will open. 11 Promote_from_2D_Shape Macro
9. Put the Unite Solids Step dialog aside and proceed to merge solids together by using the Unite Solids tool in the Solids Modeling taskbar. For more information on how to use this tool, refer to the MicroStation product documentation: http://docs.bentley.com/en/microstation/ustnhelp1045.html#f29792 Note: Only solids on the specified level will be promoted in the later part of the process. Any work on other levels will not affect the macro. Also note that closing the Unite Solids Step dialog with the X button will interrupt the process and cancel anything that has been done. 10. When you are done with the Solids Modeling tool, click Continue in the Unite Solids Step dialog to finish the process. 12 Promote_from_2D_Shape Macro
Promote_from_3D_Solid Macro Use this macro to easily create 3D XFM Buildings from 3D solids. These buildings are assigned a random unique ID and their citygml_level_of_detail property is set to 1. If the selected solids are of LoD1 type, they can simply be promoted to XFM Buildings. If they are of LoD2 type, it is possible with this macro to create LoD1 buildings from their footprints. The original solids are then promoted to XFM Wall, Ground and Roof features. These features receive a random unique ID, their parent s ID (ID of the LoD1 building) and their citygml_level_of_detail property is set to 2. To run the Promote_from_3D_Solid Macro 1. In the Promote from 3D Solid Macro dialog, choose a selection mode. 2. Select each 3D solid to process, or place a fence around them. Note: Valid entry element types for this macro are solid, smartsolid or mesh. Elements with a non planar face are invalid since only planar shapes can be promoted to XFM features. 13 Promote_from_3D_Solid Macro
3. In the Feature creation mode section, specify which feature type to create. a. Turn on the Create only LoD1 features option to promote the selected solids to XFM Buildings as they are. A random unique ID is entered in the gml_id property and the citygml_level_of_detail property is set to 1 for each new building instance. b. Turn on the Create LoD1 and LoD2 features option to create simpler solids based on the original solids footprints and heights. These new solids are then promoted to XFM Buildings the same way as for the Create only LoD1 features option. The second part of the process is to determine the orientation of the shapes constituting the original solids. Depending on their orientation, shapes are promoted to XFM roof, wall or ground features. Note: In order to correctly distinguish each feature, the condition stated at the bottom of the dialog must be respected. 4. In the Promote from 3D Solid Macro dialog, click the Process button to start the process. 14 Promote_from_3D_Solid Macro