====== ArmA 3 OpenStreetMap Areas for Object Placement ====== [[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]] Howto use OpenStreetMap (OSM) shapefile areas to place objects automatically with [[arma3:tools:terrain-processor|terrain processor]] (TP). //Disclaimer: this method is used basically for vegetation objects, however we will show you how to do buildings as well. Please understand that it looks very ugly when you randomly place city / village buildings to large shapefile area.// ====== FCLASS Attributes ====== For reference: OSM attributes which designate different area coverage. FCLASS Attributes: allotments basin beach brownfield cemetery cliff commercial construction farm farmland forest glacier grass greenfield hamlet heath industrial landfill meadow military nature_reserve orchard park quarry recreation_groun religious residential retail riverbank scrub spring suburb town village vineyard water How would this perhaps translate to ArmA 3, if you have more detailed info [[:contact|please share]] with us. ^ FCLASS / TYPE ^ Description ^ ArmA 3 Object Types ^ | allotments | Vegetables for eating; cabbage, pumpkin etc | ? | | basin | like a farm field in a city? | ? | | beach | ? | ? | | brownfield | brown (heh) area in a city? like abandoned areas, dunno | ? | | cemetary | where bunch of folk is buried, doh | ? | | city | whole city area in mass scale | none | | commercial | City buildings, commercial type | Commercial buildings | | construction | City area under construction | Buildings under construction | | farm | Same as farmland | Bushes? or nothing | | farmland | Farmland, usually you do not place objecs there | Bushes? or nothing | | farmyard | Perhaps tool or vehicle etc sheds next to farm field(s) | Shed or hangar type buildings | | forest | Trees, a lot of trees man... | them trees! | | grass | City grass | Bushes? or nothing | | greenfield | Not sure whats the difference between this, grass and farmland | ? | | industrial | Usually large buildings with sparse placement | Industrial buildings, factories etc | | landfill | Garbage dump | Garbage, trash | | meadow | Not sure whats the difference between this and grass (maybe even farm/farmfield), area without forest type vegetation I guess. Sometimes this is also placed clearly on farmland | ? | | military | Military bases, airbases etc | ? | | orchard | a piece of land planted with fruit trees (man made forest heh?) | Special trees | | park | City special area | ? | | quarry | typically a large, deep pit, from which stone or other materials are or have been extracted | ? | | railway | City buildings? | ? | | recreation_groun | ? | ? | | religious | City buildings? | ? | | reservoir | ? | ? | | residential | City buildings | Generic buildings, depends on the area how dense it is, village, suburbs or downtown of large city | | retail | Shopping malls or other commercial places? | Larger buildings | | riverbank | Surrounding rivers | Trees maybe? | | water | ? | ? | ====== Howto Place Objects ====== This tutorial assumes you know the basics from [[arma3:terrain:road-shapefiles-real-world-data|road shapefiles]] usage so we dont have to repeat the same stuff again. ===== Cropping ===== In global mapper load landuse_a and natural_a shapefiles, the _a designates area, there are ones without but those are just vertices which have no use for us. Crop these areas and export the cropped features to "cropped_areas" shapefile. ===== Transforming ===== Use QGIS to v.transform them. ===== Split Exporting ===== Global mapper load transformed areas. file -> export -> export vector/lidar format -> shapefile, use dropdown on "split export based on:" to choose FCLASS, then export to filename "obj", yes **obj**, nothing more nothing less. //please note: bbbike OSM downloads have different feature attributes, instead of FCLASS you have to use TYPE. But always try to get stuff from geofabrik which is proper SHP downloads.// Now you have bunch of obj_ files in the directory, like below. Good shapefile naming: obj_commercial obj_farm obj_forest obj_grass obj_industrial obj_meadow obj_military obj_orchard obj_quarry obj_residential obj_ prefix is good indication to you that this is object placement shapefile and not a road etc. ===== Merge Similar Areas ===== If you get obj_trees you should merge these into obj_forest. In global mapper just load first one into empty project, then the another one and export everything to obj_forest.shp shapefile. ===== Delete Unused SHPs ===== There are bunch of unused shapefiles along with the stuff we want to use. You can use this simple batch file to delete the unused ones, create TerrainProcessor directory and moving our obj files there. Hey every bit helps when you tweak your tool pipeline :-D **_run_delete_useless_area_shapefiles_and_create_TerrainProcessor_dir.bat** if exist obj_allotments.* del obj_allotments.* if exist obj_beach.* del obj_beach.* if exist obj_cave_entrance.* del obj_cave_entrance.* if exist obj_cemetery.* del obj_cemetery.* if exist obj_cliff.* del obj_cliff.* if exist obj_glacier.* del obj_glacier.* if exist obj_heath.* del obj_heath.* if exist obj_nature_reserve.* del obj_nature_reserve.* if exist obj_park.* del obj_park.* if exist obj_peak.* del obj_peak.* if exist obj_recreation_ground.* del obj_recreation_ground.* if exist obj_retail.* del obj_retail.* if exist obj_scrub.* del obj_scrub.* if exist obj_spring.* del obj_spring.* if exist obj_vineyard.* del obj_vineyard.* md TerrainProcessor move obj_*.* TerrainProcessor ===== Terrain Processor Directory ===== Move the TerrainProcessor directory into your terrain projects NameOfYourTerrain\Source\ directory. Download [[arma3:terrain:terrain-processor-templates|terrain processor templates]] and place these TPP files into the NameOfYourTerrain\Source\TerrainProcessor\ directory. ===== Terrain Processor Tasks ===== Now you are ready to start running the TP TPP projects (tp tpp? haha). Our github TPP files run without editing when using this obj_.shp shapefile naming. If you had the additional task of Mask: Linear, that requires you to browse into the road shapefile, if you fail to do so TP will crash. If you dont want that task, just delete it from the TP GUI. ===== Importing to Terrain Builder ===== Start terrain builder, make sure you have [[arma3:terrain:terrain-builder-templatelibs|proper template libraries]] loaded. Next is to import the TP LBT files, first disable all (yes, **All**) views from terrain builder so the import process is fast. This is essential especially if you have large amounts of objects in the millions. Click import objects icon on the menu header or use file -> import -> objects, then select all the LBT files in NameOfYourTerrain\Source\TerrainProcessor\ directory. Then wait ... depending on the amount of objects this will take a long time. LBT files are exported under layers manager -> objects. ====== Objects and Areas ====== This is basic summary of how arma3 objects suit to different OSM areas. Summary for arma3 shapefiles: ^ ArmA 3 Objects ^ OSM FCLASS / TYPE ^ | Buildings | commercial, construction, industrial, military, residential | | Bushes | farm, farmland, grass, greenfield, brownfield, meadow | | Trees | forest, orchard | | Rocks | quarry | Please note that if you place buildings with area shapefiles using TP area random feature, it doesn't look very nice, real populated places object placement is always done by hand :-o