User Tools

Site Tools


arma3:terrain:road-shapefiles-real-world-data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
arma3:terrain:road-shapefiles-real-world-data [2017/03/06 10:32] – added more road shapefile info. snakemanarma3:terrain:road-shapefiles-real-world-data [2024/08/02 19:07] (current) – links added. snakeman
Line 1: Line 1:
-====== Road Shapefiles from Real World Data ======+====== ArmA 3 Road Shapefiles from Real World Data ====== 
 + 
 +[[https://www.pmctactical.org/forum/viewforum.php?f=68|ArmA 3 Forum]], [[:arma3|ArmA 3]], [[arma3:config|ArmA 3 Config]], [[arma3:missions|ArmA 3 Missions]], [[arma3:modeling|ArmA 3 3D Modeling]], [[arma3:scripting|ArmA 3 Scripting]], [[arma3:terrain|ArmA 3 Terrain]], [[arma3:texturing|ArmA 3 Texturing]], [[arma3:tools|ArmA 3 Tools]]
  
 **How to use real world data road shapefiles from OpenStreetMap (OSM) in ArmA 3**. **How to use real world data road shapefiles from OpenStreetMap (OSM) in ArmA 3**.
Line 15: Line 17:
  
 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 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.
 +
 +If you cannot find country from geofabrik, try [[http://extract.bbbike.org/|extract.bbbike.org]] instead.
  
  
Line 21: Line 25:
 **OSM Roads Using Global Mapper and QGIS** **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|contact us]]. :(+We need BOTH of these software'to achieve OSM roads in terrain builder because global mapper v18 does not shift road shapefiles properly (v15 does apparently). If you know how to do this alone in either software please [[:contact|contact us]]. :( 
 + 
 +//You cannot replace OSM road features with arma3 ID/ORDER before you transform them! If you do, QGIS will fail the v.transform process.//
  
   - download road shapefiles from geofabrik as SHP (shapefiles) files for your terrain country(s)   - download road shapefiles from geofabrik as SHP (shapefiles) files for your terrain country(s)
Line 28: Line 34:
   - select digitizer tool (ALT-D) and select / hightlight user created feature grid   - select digitizer tool (ALT-D) and select / hightlight user created feature grid
   - RMB grid -> crop/combine/split functions -> crop loaded features to selected areas (or simply click crop to selected areas button, haha)   - RMB grid -> crop/combine/split functions -> crop loaded features to selected areas (or simply click crop to selected areas button, haha)
-  - setup dialog choose feature layer -> user created features, click ok +  - setup dialog choose feature layer -> <create new layer for feature>click ok 
-  - hide osm road shapefile layer, now you see road shapes inside your terrain user created feature grid, cool!+  - give name to your layer, good name would be cropped_roads for example, on layer projection dialog click ok 
 +  - hide osm road shapefile layer, now you see road shapes inside cropped_roads layer, cool!
   - file -> export -> export vector/lidar format, choose dropdown shapefile, click ok   - file -> export -> export vector/lidar format, choose dropdown shapefile, click ok
   - shapefile export options -> export lines / select file -> give filename click save   - shapefile export options -> export lines / select file -> give filename click save
   - enable "generate projection (prj) file for each exported shp file, untick rest, click ok   - enable "generate projection (prj) file for each exported shp file, untick rest, click ok
  
-**DOES NOT WORK!:**+**DOES NOT WORK IN V18!:**
   - file -> unload all (CTRL-U)   - file -> unload all (CTRL-U)
   - open data files -> select the shp file you just exported   - open data files -> select the shp file you just exported
Line 41: Line 48:
   - specify offset dialog insert the X/longitude and Y/latitude values matching to your terrain coordinates (see below), click ok   - specify offset dialog insert the X/longitude and Y/latitude values matching to your terrain coordinates (see below), click ok
  
-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.+What does not work in v18? 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 (or use older global mapper like v15 which should work).
  
 **QGIS Transform:** **QGIS Transform:**
-  - open your heightmap in UTM 31N, this is just for visual reference. add raster layer -> choose your asc file+  - open your heightmap in UTM 31N, this is just for visual reference. add raster layer -> choose your asc file. this needs to be set to UTM zone 31N.
   - add vector layer -> browse, choose your global mapper cropped and exported road shapefile, click open   - add vector layer -> browse, choose your global mapper cropped and exported road shapefile, click open
   - RMB roads layer -> set layer CRS -> choose WGS 84 / UTM zone 31N, click ok   - RMB roads layer -> set layer CRS -> choose WGS 84 / UTM zone 31N, click ok
Line 54: Line 61:
   - select transformed layer, RMB -> zoom to layer, now you see roads aligning perfectly with your heightmap, congrats!   - select transformed layer, RMB -> zoom to layer, now you see roads aligning perfectly with your heightmap, congrats!
   - transformed layer RMB -> save as -> browse, this is your final road shape file name to be used in terrain builder, click ok   - transformed layer RMB -> save as -> browse, this is your final road shape file name to be used in terrain builder, click ok
 +
 +**Global Mapper ID / ORDER**
 +
 +  - Fix shapefile attributes for ID and ORDER with [[arma3:terrain:road-shapefiles-real-world-data#id_and_order]] tutorial.
 +
 All done! :-) All done! :-)
  
 Enjoy your real world data openstreetmap roads in terrain builder :-) Enjoy your real world data openstreetmap roads in terrain builder :-)
  
-{{ http://pmc.editing.wiki/images/Terrain-Builder-Global-Mapper-QGIS-Shapefile-Roads.png }}+{{ https://pmc.editing.wiki/images/Terrain-Builder-Global-Mapper-QGIS-Shapefile-Roads.png }}
  
  
Line 89: Line 101:
  
 ====== Remove "Bad" Roads ====== ====== Remove "Bad" Roads ======
 +
 +ArmA 3 crashes if you have more than roughly 9000 roads / features in the roads.shp shapefile. This is not precise number as it also depends on your other terrain properties, highest we have had in-game is 9,198 and lowest that caused crash was 4,941 so its not exact science. This is only issue for those large terrains or well, terrains that have large number of roads in the shapefile.
 +
 +Note: for example plain deserts (heightmap) of iraq easily allows OSM road features of 9000 but the rugged mountains (heightmap) of afghanistan crashes for less then 5000. So use your own judgement with all these gazillion variables when you track down the amount of roads your terrain can handle.
 +
 +Mexico juarez 81km terrain had 7469 road features which caused virtual blocks crash. After global mapper 6m combine 4056 it still crashed. Finally after I cleanly reduced the features by deleting FCLASS roads to number I didn't write down (damn) and then 6m combine down to 1139 the crash was avoided.
  
 OSM shapefiles come with all kinds of backyard "path" roads etc, you might want if not have to remove some of these. OSM shapefiles come with all kinds of backyard "path" roads etc, you might want if not have to remove some of these.
Line 104: Line 122:
 Now you can click select all and delete selected buttons to delete all these search matches. 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.+Move the search vector data window away from normal global mapper view and orient the road features so you can see them. For those pimps with triple screen setup this is awesome but its doable even with single screen. 
 + 
 +You can see the selected roads highlighed in yellow. 
 + 
 +While you click to delete roads, monitor the cropped_roads layer for feature count, once it reached 9000 or below you can stop because that is the rough limit arma3 crashes. 
 + 
 +Once you have searched roads, you can search to return all roads, because every search is only searching what is listed currently. 
 + 
 +Check the FCLASS or type, sort it and browse to see all listed there. Sometimes there are really odd types like "yes".
  
 Once you're done with deleting "bad" roads, simply export your roads by file -> export -> export vector/lidar format, as usual. Once you're done with deleting "bad" roads, simply export your roads by file -> export -> export vector/lidar format, as usual.
 +
 +**ArmA 3 Specific Roads Deletion**
 +
 +Delete these roads as they are mostly too excessive for arma3 terrains:
 +<code>
 +bridleway
 +steps
 +foot*
 +cycle*
 +path
 +pedestrian
 +track_grade*
 +*link*
 +living_street
 +service
 +unknown
 +unclassified
 +residential
 +tertiary
 +track
 +secondary
 +</code>
 +track* takes too many roads from ukraine luhansk, from 17k to 380 heh.
 +
 +tertiary has lot of country roads in ukraine.
 +
 +residential has those nice city roads, depends on your terrain if you need to delete these.
 +
 +Anything below 9000 OSM features in roads.shp should work in arma3.
 +
 +List of important features for arma3 gameplay:
 +<code>
 +motorway
 +trunk
 +primary
 +</code>
  
  
 ====== Simplify Road Shapefiles ====== ====== Simplify Road Shapefiles ======
  
-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.+**Simplify Road Polylines** 
 + 
 +Most likely your OSM downloaded road shapefiles are too complex for terrain builder, so you //might// need to simplify them. Meaning there are way too many vertices in the polylines which can be reduced. **Note 2018-03-02 update:** arma3 loads any OSM poly line shape file just fine, there is no need to simplify for arma3's sake, PMC has done hundred terrains with various size and quality OSM road poly lines and all of them have been working great.
  
 If you import too complex or "large" road shapefiles to terrain builder it will start to stutter and freezes up. If you import too complex or "large" road shapefiles to terrain builder it will start to stutter and freezes up.
Line 118: Line 182:
  
 From enter simplification threshold dialog, use horizontal threshold 10 and vertical threshold elevation (meters) 0.2 for good results. From enter simplification threshold dialog, use horizontal threshold 10 and vertical threshold elevation (meters) 0.2 for good results.
 +
 +
 +====== Combine Road Features ======
 +
 +USA Los Angels 40km terrain openstreetmap.org road polylines even after "bad roads" reduction were over 17,000 features which is like ten thousand over the limit. They need to be reduced. Please note that this was some very odd issue on these specific OSM shapes because normal roads / streets were split up to hundreds of small features when it should have been one feature.
 +
 +I have not experienced such splitting up of polylines in other terrains in this scale.
 +
 +Select all roads -> RMB in the viewport -> crop/combine/split functions -> combine. Then use about 6 meter value, should work fine (we used also 20m but that might be too large). In select combine options menu let it be default (combine any overlapping and everything else ticked).
  
  
Line 165: Line 238:
 [[http://www.mapcruzin.com/free-world-country-arcgis-maps-shapefiles.htm|mapcruzin.com]]\\ [[http://www.mapcruzin.com/free-world-country-arcgis-maps-shapefiles.htm|mapcruzin.com]]\\
 [[http://extract.bbbike.org/|extract.bbbike.org]] [[http://extract.bbbike.org/|extract.bbbike.org]]
 +
arma3/terrain/road-shapefiles-real-world-data.1488796377.txt.gz · Last modified: 2017/03/06 10:32 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.