Producing m6m files using GDAL/OGR

From Maria GDK Wiki
Jump to navigation Jump to search

OGR is part of the well known open source library GDAL. For general documentation on OGR go to gdal.org.

Translating map data to m6m-format using the OGR set of tools is accomplished using a Teleplan Globe developed plugin. It is used to output spatial data as MARIA m6m-files from all the input formats supported by OGR. Teleplan Globe also provides a small executable for converting m6m-files to Vector Tiles.

Setup

The OGR plugin consists of a single file, ogr_M6M.dll. To make use of the plugin you have to complete the following install procedure.

  1. In the folder of all OGR executables create a directory called gdalplugins (if it does not already exist).
  2. Copy ogr_M6M.dll to gdalplugins.
  3. Check the installation by running the command under should show the M6M as a supported format.
ogrinfo.exe --formats
...
-> "M6M" (read/write)
...
The plugin is compiled against a specific version of GDAL, and will not work if versions do not match.

Translation

To translate data from a OGR supported format to the m6m format we use the ogr2ogr.exe utility of OGR. The result of running ogr2ogr.exe will be a .m6m file for each dataset given to as the source dataset. The complete reference of ogr2ogr.exe can be found at ogr2ogr reference.
The following example translates a Shape file to the M6M format.

ogr2ogr.exe -f M6M MyDestinationDataDirectory\ MyShape.shp

Note that MyDestinationDataDirectory has to exists before running the command. Also note the backslash after the destination data directory declaration.

MyDestinationDataDirectory should now have one or more .m6m files. These are the input to the last step in the conversion pipeline, Vector Tiles.