This open source project wants to make Building Information Model (BIM) data available for OpenStreetMap (OSM).

Questions about the development? - Check the Development section

Want to contribute? - Have a look at our Contribution guidelines

See also

Usage


Quickstart


Add BIMtoOSM to your Gradle build
             
             dependencies {
               implementation(WIP)
             }
            
          
Configurate and run the parser
            
              // Setup default configuration
              val defaultConfig = Configuration()

              // Init parser
              val parser = BIMtoOSMParser(defaultConfig)

              // Parse BIM file
              val osmData: BIMtoOSMParser = parser.parse("path-to-file.ifc")
            
              // Access the data: see section 'Full Setup & Configuration' below
            
          

API

Class BIMtoOSMParser
            
              /**
               * Configure the parser
               * @param config parser configuration
               */
              fun configure(config: Configuration)

              /**
               * Parse BIM file placed at [filepath] to OSM data
               * @param filepath BIM file
               */
              fun parse(filepath: String): OSMDataSet

              /**
               * Gives information about current parser status
               */
              fun status(): String

              /**
               * Export data to .osm file located at [filepath]
               * @param filepath to export location
               * @param data [OSMDataSet] to export
               */
              fun export(filepath: String, data: OSMDataSet)
            
          

Use with JOSM

The parser is integrated into JOSMs IndoorHelper plugin. To use the GUI you need to install JOSM and download the IndoorHelper plugin via EditPreferencesPlugins. Import example:

See also fullscreen demo

Full Setup & Configuration

            
              // Setup configuration (description see below):
              // costumized
              val config = Configuration(
                solution = GeometrySolution.BOUNDING_BODY,
                optimizeInput_RBC = true,
                optimizeInput_RBL = true,
                optimizeOutput_DS = true,
                optimizeOutput_DSMD  = 0.05
              )

              // or default
              val defaultConfig = Configuration()

              // Init parser
              val parser = BIMtoOSMParser(config)

              // Parse BIM file
              val osmData: BIMtoOSMParser = parser.parse("path-to-file.ifc")

              // Export OSM data
              Exporter.exportOSM("bim-to-osm.osm", osmData, true)
            
          

Configuration

  • solution:
  • Set to GeometrySolution.BODY for more detailed or to GeometrySolution.BOUNDING_BOX for less detailed transformation to OSM. If a solution type cannot be applied GeometrySolution.BOUNDING_BOX will always be the default
  • optimizeInput_RBC
  • Optimize the input by removing all block comments (RBC) from input file. Block comments might cause errors while deserializing. Set true or false. It's highly recommended to use this optimization
  • optimizeInput_RBL
  • Optimize the input by removing all blank lines (RBL) from input file. Blank lines might cause errors while deserializing. Set true or false. It's highly recommended to use this optimization
  • optimizeOutput_DS
  • Reduce the complexity of OSM output data by merging close nodes and overlapping areas. This will reduce the OSM data set size (DS). Set true or false
  • optimizeOutput_DSMD
  • Set merge distance (MD) for [optimizeOutput_DS] optimization - used only if [optimizeOutput_DS] set true. Set distance value in meter, greater than 0.0
Default configuration
  • solution: GeometrySolution.BOUNDING_BOX
  • optimizeInput_RBC: false
  • optimizeInput_RBL: false
  • optimizeOutput_DS: false
  • optimizeOutput_DSMD: -

How to access the data

            
              // Data
              val osmData: OSMDataSet

              // Access data

              // Example: get all nodes of data set
              val nodes: ArrayList<OSMNode> = osmData.nodes

              // Example: get all information about OSMNode
              val firstNode: OSMNode = nodes[0]
              val nodeId: Long = firstNode.id
              val nodeX: Double = firstNode.x   // longitude
              val nodeY: Double = firstNode.y   // latitude
              val nodeTags: ArrayList<OSMTag> = firstNode.tags

              // Example: get information about OSMTag
              val firstTag: OSMTag = nodesTags[0]
              val key: String = firstTag.k
              val value: String = firstTag.v

              // Example: get all ways of data set
              val ways: ArrayList<OSMWay> = osmData.ways

              // Example: get information about OSMWay
              val firstWay: OSMWay = ways[0]
              val wayId: Long = firstWay.id
              val wayPoints: ArrayList<OSMNode> = firstWay.points
              val wayTags: ArrayList<OSMTag> = firstWay.tags
            
          

Supported IFC Schema


The parser currently supports the IFC4 and IFC2x3 TC1 schema


Development


IFC to OSM translation

To transfrom IFC to OSM data we'll need to filter a lot of information by reducing object dimensions from 3D to 2D. The following basic IFC entities will be translated:

IFC Geometry information

Area - indoor=area
  • IfcSlab, IfcSlabStandardCase, IfcSlabElementedCase
  • IfcColumn
Wall - indoor=wall
  • IfcWall, IfcWallStandardCase, IfcWallElementedCase
Door - door=yes
  • IfcDoor, IfcDoorStandardCase
Stair - highway=steps
  • IfcStair
Window - WIP
  • WIP

IFC Material information

Not supported right now

More infos see section BIM & OSM

Workflow - parsing data


The following steps are performed during transformation:

Pre-processing

1. Optimize ICF file: Block comments and blank lines will be removed from .ifc file. This step is optional and can be set by configuration

Loading

2. Extract IFC environment variables: Environment variables like length, area, volume or angle units and level tags will be extracted

3. Filter and pack data: Filter the IFC data following the translation schema as described above (use basic IFC entities only)

Parsing

4. Transform to BIM objects: Transform deserialized entities to internal BIM objects with resolved geometry information. For this step the configuration can be set to two different solution engines: BODY or BOUNDING_BOX. The BODY engine will resolve entity geometry more detailed. The BOUNDING_BOX engine resolves a less detailed geometry representation. The BOUNDING_BOX solution is default option and will be used if no other is available

5. Transform to WCS: Transform coordinates of geometry information to World Coordinate System if possible

6. Transform BIM to OSM objects: Transform internal BIM objects into OSM objects

Post-processing

7. Optimize OSM data: Optimize the data complexity. Merge close nodes or overlapping areas. This step is optional and can be set by configuration

Test data

Test data for development is placed at repository IfcTestFiles. The repository includes ifc test files and already resolved geometry data.


BIM & OSM


This open source project wants to make Building Information Model (BIM) data available for OpenStreetMap (OSM).

OSM & indoor data

With OSM you can handle not only outdoor data. A large number of projects focus on the representation of indoor data in OSM. These data might be used for indoor localization and navigation.

How to create and view indoor data in OSM?

There are several OSM editors. To handle indoor data JOSM might be a good choice. Note: To use JOSM, a JDK needs to be installed.

For more information about OSM indoor data see indoorhelper#About_OSM_indoor_data or indoorhelper#How_to_start

Transfer BIM into OSM

To transfrom IFC to OSM data we'll need to filter a lot of information by reducing object dimensions from 3D to 2D. This parser transforms BIM to OSM data using the OSM Simple Infoor Tagging schema. At OSM Building Information Modeling you can find the translation between BIM and OSM data.