# AeroFly FS 2 scenProc script - Ver 6
# with function to filter out objects on airport
# Author of scenProc Arno Gerretsen
# Script amended, modified and enhanced by Rodeo
# Script updated by Crispy136
# Street lighting update provide by Kenventions
# - This script creates cultivation for night lighting, plants and buildings (incl. high rise)
# --------------------------------------------------------------------------------------------
#
# LOAD OPENSTREETMAP DATA of the area to work on
ImportOGR|F:\AA_sceneproc\travail\loire.osm|*|*|NOREPROJ
#
# LOAD SHAPEFILE that will be excluded from processing.
# - By default this script loads all .kml exclude files in the folder. If you only want specific files, then use
# the filename in place of "*.kml", You may also need to do the same for any of the "AddAttributeIfInside"
# lines you are using in the FILTER section below.
# - Buildings in airport areas are now automatically excluded, so no exclude file is required for these.
#ImportOGR|F:\AA_sceneproc\travail\.kml|*|*|NOREPROJ
#ImportOGR|F:\AA_sceneproc\travail\.kml|*|*|NOREPROJ
#
# SPLITGRID
# Split the features into a grid of 0.25 x 0.25 degrees, Do not split buildings, but filter them into the
# right grid cells.
# - This command enables concurrent processing of the grid cells, speeding up the process.
SplitGrid|0.25|*|*
#
# LIGHTS
# PLANTS
# - For greater realism different tree densities are required for different vegetation areas.
# The lower the value the denser the vegetation. Densities greater than .0001 gave little
# benefit when viewed in FS2.
# - Forests & woods use a high density of 0.0001. Reduce to 0.00015 or 0.00025 for faster processing times.
# - Nature reserves, scrubs & wetlands use medium density of 0.00015. Reduce to 0.00025 for faster
# Processing times or increase to 0.0001 for greater density but slower processing.
# - Parks, trees and tree rows use a low density of 0.00025. 0.0001 or 0.00015 result in unrealistic parks.
# - Golf courses use a very sparse density of 0.00055 to reduce trees appearing in fairways.
# - Denser tree settings increase running time if you have large plant areas in your source file.
# - Where an area has values in 2 or more vegetation types it fails to appear in FS2. As a result
# a decision needed to be made as to which category it belonged to. So "landuse" was given preference
# over "natural" which in turn has preference over "leisure". So an area which is listed in the source
# data as natural = "wood AND leisure = "nature_reserve" would be treated as "wood". So any new
# "landuse" type you add would have to be added as an "And NOT" value for the "natural" and
# "leisure" lines. While any new "natural" type would need to be added as an "And NOT"
# value only in the "leisure" lines.
PlacePointsInPolygon|landuse="forest"|0.0001;0.0001|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|natural="wood" And NOT landuse="forest"|0.0001;0.0001|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|natural="tree" And NOT landuse="forest"|0.00015;0.00015|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|natural="tree_row" And NOT landuse="forest"|0.00015;0.00015|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|natural="wetland" And NOT landuse="forest"|0.00015;0.00015|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|natural="scrub" And NOT landuse="forest"|0.00015;0.00015|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|leisure="park" And NOT landuse="forest" And NOT natural="wood" And NOT natural="tree*" And NOT natural="wetland" And NOT natural="scrub"|0.00025;0.00025|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|leisure="nature_reserve" And NOT landuse="forest" And NOT natural="wood" And NOT natural="tree*" And NOT natural="wetland" And NOT natural="scrub" And NOT name="*Marine*" And NOT name="MNP*"|0.00015;0.00015|1.0;1.0|INHERITPARENTATTR
PlacePointsInPolygon|leisure="golf_course" And NOT landuse="forest" And NOT natural="wood" And NOT natural="tree*" And NOT natural="wetland" And NOT natural="scrub"|0.00055;0.00055|1.0;1.0|INHERITPARENTATTR
# Adding the 'And NOT name="*marine*"' to the leisure = "nature_reserve" line above filters out marine
# national parks wordwide, which usually causes "Trees in the sea". Marine parks not using the word
# Marine in their name may still need to be excluded using an exclusion file. Adding 'And NOT name="MNP*"'
# filters out additional marine parks in Australia.
#
# FILTER out buildings
# The line below automatically removes buildings within your airport area for the majority of airports worldwide.
# The line below removes buildings that are in the area covered by your exclude file. This should only be needed
# if you want to exclude buildings outside an airport area.
#
# FILTER out plants
# - Using this script to generate plants and lighting should generally negate the need to exclude them using
# the lines below.
# - CAUTION - Using any of the 'AddAttributeIfInside|FTYPE="POINT"' lines will dramatically increase processing
# time if the plant type uses a dense setting ie 0.0001.
# AddAttributeIfInside|FTYPE="POINT" And landuse="forest"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And natural="wood"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And natural="tree"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And natural="tree_row"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And natural="wetland"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And leisure="park"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And leisure="nature_reserve"|FROMFILE="*.kml"|String;skip|yes
# AddAttributeIfInside|FTYPE="POINT" And leisure="golf_course"|FROMFILE="*.kml"|String;skip|yes
#
# - The line below excludes trees from sporting areas usually found inside areas designated as parks. This
# will prevent trees appearing inside football ovals, baseball diamonds, hockey fields etc, but has
# a small processing time penalty.
AddAttributeIfInside|FTYPE="POINT" And leisure="park"|leisure="pitch"|String;skip|yes
#
# This next line removes anything identified in the AddAttributeIfInside lines above.
UnloadFeatures|skip="yes"
#
# CREATE AF2 PLANTS
CreateAF2Plant|landuse="forest" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|landuse="forest" And FRAND > 0.5|10;20|0|conifer
CreateAF2Plant|natural="wood" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|natural="tree" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|natural="tree_row" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|natural="wetland" And FRAND < 0.5|5;6|0|shrub|T00
CreateAF2Plant|natural="scrub" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|leisure="park" And FRAND < 0.5|8;20|0|broadleaf
CreateAF2Plant|leisure="nature_reserve" And FRAND < 0.5|8;20|0|conifer
CreateAF2Plant|leisure="golf*" And FRAND < 0.5|8;20|0|broadleaf
#
# CREATE AF2 BUILDINGS
#
# HOUSES
# MERGEGRID joins cells spilt by SplitGrid. These 2 commands provide shorter running times for denser areas.
#MergeGrid
#
# EXPORT THE AF2 TOC FILE
# Enter a folder/file name as required.
ExportTOC|F:\AA_sceneproc\travail|loire_vege