- Messages
- 32,883
- Country
Hi,
I have made the two changes now. I'll push a new build in a bit.
For the altitude from an attribute, I have added it to all three steps to create plants, lights and buildings. So that the behaviour is consistent.
Just for the record, here is an updated example script:
I have made the two changes now. I'll push a new build in a bit.
For the altitude from an attribute, I have added it to all three steps to create plants, lights and buildings. So that the behaviour is consistent.
Just for the record, here is an updated example script:
Code:
# Example AeroFly FS 2 scenProc script
# with function to filter out objects on airport
# --------------------------------------------------------
#
# Load OpenStreetMap data of the area to work on
# Only load highway, landuse and builidng to save memory
ImportOGR|annemasse.osm|*|highway;landuse;building|NOREPROJ
#
# Load Shapefile that contains the area of aiports that
# should be filtered out
ImportOGR|airport.shp|*|*|NOREPROJ
#
# Split the features into a grid of 0.25 x 0.25 degrees
# Do not split buildings, but filter them into thee
# right grid cells
SplitGrid|0.25|*|building="*"
#
# Place point features for the lights along roads of
# type primary at 50 meter interval
PlacePointsAlongLine|highway="primary"|SINGLE|50;50|0;0|25|String;point|light|hdg
#
# Place point features for the plants in forest polygons
# using spacing of 0.00025 degrees and no randomness
PlacePointsInPolygon|landuse="forest"|0.00025;0.00025|0.0;0.0|INHERITPARENTATTR
#
# Filter out the buldings, lights and plants that are within
# the airport polygons
AddAttributeIfInside|building="*"|FROMFILE="airport.shp"|String;skip|yes
AddAttributeIfInside|point="light"|FROMFILE="airport.shp"|String;skip|yes
AddAttributeIfInside|FTYPE="POINT" And landuse="forest"|FROMFILE="airport.shp"|String;skip|yes
UnloadFeatures|skip="yes"
#
# Create AF2 plants
CreateAF2Plant|landuse="forest"|10;20|0|broadleaf|T02
#
# Create AF2 lights
CreateAF2Light|point="light"|0.8;0.8;0.8|3|0;0;1|10
#
# Create AF2 buildings for polygons that are almost rectanguar
# Make longer buildings industrial with a flat roof
CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH < 12|2|gable|residential|0
CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 12 And FLENGTH < 25|3|gable|residential|0
CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 25|2|flat|industrial|-1
#
# Export the AF2 TOC file
ExportTOC|out|annemasse
Last edited: