This is an old revision of the document!
How to use real world data road shapefiles from OpenStreetMap (OSM) in ArmA 3.
In this tutorial we download OSM shapefiles from the web, crop them to our terrain size and reproject them to match terrain builder UTM zone.
If not otherwise mentioned, global mapper is assumed.
Geofabrik site has OpenStreetMap (OSM) shapefiles available for download.
Do not try to download “Asia” or “Africa” as those files are huge, click on Asia or africa instead and from there you can find individual country pages like iraq and afghanistan so your downloads are mere few megabytes instead of gigabytes (not to mention the unpacked data is insanely large).
OSM includes roads but also many other features, they even have buildings and vegetation areas. Although no idea how to use the building information with terrain builder or other tools.
OSM Roads Using Global Mapper and QGIS
Yes unfortunately at our current knowledge level we need BOTH of these softwares to achieve OSM roads in terrain builder. If you know how to do this alone in either software please contact us. :(
DOES NOT WORK!:
What does not work? Well the coordinates jump to some crazy large number 3999999999999900 something like that, I have no idea why and what I do wrong in that part. Read below how to transform roads in QGIS instead.
QGIS Transform:
All done!
Enjoy your real world data openstreetmap roads in terrain builder
In global mapper when you have chosen your terrain area by creating user created features grid, you need to export ASCII Grid ASC heightmap file to see the header for coordinates.
Use proper text editor to open this ASC file and check the header for xllcorner and yllcorner values. These values are used to calculate the terrain builder easting 200000 and northing 0 values.
Easting 200000 will be done by calculating 200000 - xllcorner value. And northing is dead simple, you just take yllcorner value as-is.
So now you have these two values, they can me inputted to QGIS to transform your project coordinates into those of arma3 terrain builder.
Here is example heightmap.asc header:
ncols 512 nrows 512 xllcorner 618849.895 yllcorner 3433172.322 cellsize 5
So you would take xllcorner and calculate that like this “200000 - 618849.895” equals to -418849.895 value. Then as terrain builder northing is just 0, we dont have to do any calculations we use it as is.
Result shift / transform would be:
X: -418849.895 Y: -3433172.322
OSM shapefiles come with all kinds of backyard “path” roads etc, you might want if not have to remove some of these.
OSM Road attribute types are described in openstreetmap map features: highway.
Use search → search by attributes. This search vector data dialog you can do all kinds of search & delete operations.
If you click to sort the FCLASS column, you can most likely see “unknown” and “unclassified” types, its up to you to decide which road types to remove (see the above OSM road attribute types list), as you really don't need all in arma3 terrain.
How to delete
Choose attribute/item dropdown for FCLASS, then type your search string to compare value field, then hit new search button.
Now you can click select all and delete selected buttons to delete all these search matches.
You can search more by just typing in new search string to compare value field and clicking new search button.
Once you're done with deleting “bad” roads, simply export your roads by file → export → export vector/lidar format, as usual.
Most likely your OSM downloaded road shapefiles are too complex for terrain builder / arma3, so you need to simplify them. Meaning there are way too many vertices in the polylines which can be reduced.
If you import too complex or “large” road shapefiles to terrain builder it will start to stutter and freezes up.
In global mapper select all your road features, digitizer tool RMB → move / reshape features → simplify reduce vertices of selected line area features.
From enter simplification threshold dialog, use horizontal threshold 10 and vertical threshold elevation (meters) 0.2 for good results.
When you are using OSM road shapefiles there are lot of crap info attributes which are not used by terrain builder, you must delete these and replace with ID and ORDER attributes. If you try to bring OSM shapefiles as-is to arma3, it will crash.
Terrain Builder uses ID and ORDER values for road shapefile database. See further details from PMC Ultimate Terrain Tutorial: Roads - Export.