AeroFly FS 2 support in scenProc

I looked up the Create Rectangle discussion from the User Manual and am unsure how to use that instead of the Shapefile. Could you please show us an example by editing the Shapefile script above to use the CreateRectangle instead - also can we use decimal degrees for the arguments? (Sorry for not understanding just what to do).

Thanks

Dave W.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Instead of using ImportOGR to load a shapefile, you can use the CreateRectangle step to make rectangular polygon. For example:

CreateRectangle|6.05;6.06;51.04;51.05|String;type|airport

This will made a rectangle with as corners N51.04 E6.05, N51.05 E6.06. And give it an attribute type, with value airport.

So in the AddAttributeIfInside step you replace the FROMFILE="airport.shp" with type="airport" and then it will test against this newly made rectangle.
 
Arno,
Unfortunately the U.S.A. OSM coverage for buildings is quite limited in many areas - is there any chance that your Feature Detection capability (looking for rectangular edges of a limited range of sizes) could be used to help populate these US areas? I understand that getting orientation might be difficult, but perhaps any representative "autogen" building - 1 or 2 stories - might help the appearance (at least, from a distance).

Thanks as always,

Dave W.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Dave,

Yes, I'm working on improved feature detection to also get buildings out. But I'm not sure when that will be finished and functional. It's kind of a slow process since I don't have so much time.
 
Arno,
Thanks for putting so much time in - we all have greatly benefited from your work through the years. If there is anything I could help with on the building detection testing or tuning (not coding unless it is real simple), please let me know.

Dave W.
 
Arno,
I'm not sure we flightsimmers that are using Aerofly FS2 have thanked you enough for ScenProc and how it generates our buildings, trees, and lights so easily (what we call cultivation ). The exclude file capability works so well even with very complex shapes. Would it be possible to use more than one exclude file in a given execution of the SPC file or should we break it up into area chunks?
BTW, flying in moonlight with all the buildings and lights with Rift VR or equivalent is so beautiful! I just built the Miramar MCAS base near San Diego with cultivation down to San Diego and it is amazing!

Thanks again

Dave W.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi Dave,

You can use as many exclusion polygons as you want. If you all give them the same attributes you don't even have to alter the rest of the script.

Happy to hear the Aerofly FS2 support is appreciated, I already got the impression from some of the forum posts I read :)
 
Arno,
Sorry for asking probably a simple question - but do I somehow merge the exclusion polys into a single KML file or do I use multiple separate KML files?

Thanks

Dave W.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Both should work, so whatever works best for your workflow.
 
Thanks for all your help with Aerofly FS2 Arno. A few of us have had great results based on the sample file you gave, however for some reason the SplitGrid line didn't make it into the version we've all been using, and I'm now hitting the problem in my other post that requires a SplitGrid to enable parallel processing of feature filtering.

I've been reading about SplitGrid in the manual: "Autogen file have a fixed grid size, so therefore the data needs to be split."

Perhaps this isn't the case with Aerofly FS2? Can you shed any more light please on the implications of a SplitGrid? I have noted the importance of excluding buildings in section 5.1 of the manual so I feel like I'd like to understand SplitGrid more before I include it.

"In the SPLITGRID step the last attribute specifies that we don’t want to split
features of the category building. This is done because else you would get very
small building segments. So instead building features are put in the grid cell
where their center falls into."
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Hi,

Below is the example script I use for AeroFly, it does contain a SplitGrid command to divide the data into tiles. Each of these tiles are then processed in parallel, so that performance can be speed up.

It is important that you exclude buildings from the splitting, because else they might be cut in half. The the filter at the end of SplitGrid instructs the step to not split, but only sort buildiings. You will have to adjust the filter to your data if you are not using OpenStreetMap data.

In this sample script I use a tile size of 0.25 x 0.25 degrees. If you make it smaller you might get more performance improvements. That's something you will have to tune a bit probably.

With this script each tile will be output as a seperate cultivation file. If you want one single output file you need to put a MergeGrid command before the ExportTOC. This will combine all the tiles into one again. So then you can have the performance improvements of multiple tiles, but still one output file.

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
#
# 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|broadleaf
#
# 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
CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 12 And FLENGTH < 25|3|gable|residential
CreateAF2Building|building="*" And FAREARAT>0.7 And FLENGTH >= 25|2|flat|industrial
#
# Export the AF2 TOC file to the folder out
ExportTOC|out|annemasse
 
That really helps a lot thanks. I certainly get the parallel processing concept and value of breaking down the grids. I probably will do a MergeGrid at the end as FS2 seems happy with a single TOC and its easier to manage. I'll have to see the impact of not splitting but sorting buildings.

Worst case I presume a building moves by 1/2 its longest dimension so it can fit into the nearest grid? If the split line was along a street in a busy city that might be noticeable compared to the underlying orthophotography. Do you find that this isn't noticed in practice or is it something to look for and fine tune for?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
The spilt line is always in a rectangular grid. If a building crosses it, you'll get two buildings. The building will just be cut along the line.
 
Oh dear, now I'm confused again. I thought we weren't splitting buildings?

# 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
SplitGrid|0.25|*|building="*"
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
In that case we don't split. They fall into the tile where the center is. So they are not moved.
 
Gooseno1 pointed me to the JOSM editor ( https://josm.openstreetmap.de/ ) this week on the Aerofly FS2 forums and I found that I can now easily edit OSM files adding houses, trees, and gain understanding just what the various elements are by clicking on a feature and getting its data entries so I can make changes to the SPC file to exclude or pick up something that was missing. I am able to deal with large OSM areas like San Diego county.

Thanks again Arno!!

Dave W.
 
@arno,
Have you made any progress on using the image pattern recognition to find buildings and forests yet? I think that most OSM data has info for the streets but the buildings and trees have to be added by hand.

I am working on San Diego county now and there are small patches of buildings but most residential home and small town buildings are missing as well as small forests (less than an acre).

Thanks

Dave W.
 
Top