1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

AeroFly FS 2 support in scenProc

Discussion in 'scenProc' started by arno, 7 Oct 2017.

  1. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    This week I was approached by an AeroFly FS 2 user with the question if scenProc could be used to make cultivation (the AeroFly name for autogen) for AeroFly FS 2 as well. Of course this was not the highest priority item on the wishlist to work on, but I liked the challenge and the data structure to write to seemed simple enough. So I sidetracked a bit from what I was actually working on and decided to give it a go.

    The fact that I’m writing about it now already indicates that it worked. In the next development release of scenProc you will find support to create cultivation for AeroFly FS 2 as well. You can create plants (trees), buildings and lights.

    Section 5.9 of the updated manual shows an example script that can be used for AeroFly FS 2. Using OpenStreetMap data I have scattered trees into forest polygons, placed lights along a road and create houses from buildings that are almost rectangular. Hopefully this sample script should be enough to get you going. If there are any questions or suggestions, just let me know.

    [​IMG]

    [​IMG]

    Continue reading...
     
    pmb2017 likes this.
  2. toprob

    toprob

    Joined:
    27 Jun 2004
    Messages:
    824
    Wow, Arno, that is great news, can't wait to give it a go.
    And I love your attitude -- 'I had a look, it seemed like it would be easy, so I did it.':)
     
  3. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    That's how most features got into my tools, somebody suggests something interesting and I just give it a try :).
     
  4. Trespassers

    Trespassers

    Joined:
    2 Oct 2017
    Messages:
    2
    Country:
    switzerland
    Hello everybody.

    I'm the Aerofly FS2 user who distracted Arno from his tasks, I must admit he's been extremely reactive and positive, thanks again Arno!

    Being new on this forum, let me introduce myself: My name is Antoine, I'm a long time user of MS FS series and now LM P3D, with the v4 that could be the kind of Graal we've been hoping for so long... Being for so long an FS enthusiast led me IRL to the PPL flying licence back in 2008.

    Even if LM's last opus is very promising, I was seduced by a small outsider, IPACS Aerofly FS2 (AFS2), that could become an excellent VFR flight platform if it grows up.
    Now that a few tools become available, I'm investigating the feasibility of generating an autogen for AFS2 similar to what can be done in FSX/P3D, based on OSM and other shp data.



    Below some pics of Lausanne area (Switzerland) with an initial test zone. I only placed autogen buildings for now, from OSM data. Trees come for the Swiss DLC and their placement is quite poor.

    Still a lot to improve, but I'm currently concentrating on feasibility rather than aesthetics. The good think is it works and already doesn't look so bad. Thanks to Arno, extracting OSM data toward AFS2 is now possible with ScenProc, that's a huge help!


    [​IMG]


    [​IMG]


    [​IMG]


    Villages too are much enhanced by 3D...

    [​IMG]


    [​IMG]


    Yverdon-les-Bains

    [​IMG]


    [​IMG]


    [​IMG]


    Back to Lausanne, morning light. Here looking towards Evian

    [​IMG]


    [​IMG]




    Cheers

    Antoine
     
  5. roland_lfor

    roland_lfor

    Joined:
    25 Dec 2014
    Messages:
    48
    Country:
    france
    Well done Arno !

    As Antoine said, AFS2 could be a good challenger for VFR flights, especially when one can expect more than 100fps with photo scenery + full autogen coverage :)

    Thanks
     
  6. whitav8

    whitav8

    Joined:
    17 May 2010
    Messages:
    96
    Country:
    us-california
    The real strength of FS2 is the frame rate that supports very fluid VR . Amazing!! Try it on Steam
     
  7. whitav8

    whitav8

    Joined:
    17 May 2010
    Messages:
    96
    Country:
    us-california
    I hate to ask newbie questions, but here goes:

    Goal: Select small area of california-latest.osm (or whatever OSM data from Geofabrik) so as to view in QGIS and limit what ScenProc has to deal with

    Do you use QGIS to select a rectangular area (not sure how to do that without it taking forever) and save it
    OR
    just put "minx;maxx;miny;max" lat/lon values in the ImportOGR attributes? And what is meant by min/max for negative numbers (do you really mean by arithmetic value or NW-SE corners)

    I wanted to test this process for maybe a 20nm square area but have to start with a 10gb file for California.

    Thanks for the help - and Arno, you are the BEST! (BTW: MCX of mdl/bgl to AC3D works well)

    Dave W.
     
  8. Trespassers

    Trespassers

    Joined:
    2 Oct 2017
    Messages:
    2
    Country:
    switzerland
    If you use QGIS, you can download a square window of osm data to use directly for testing.

    Cheers
    Antoine
     
  9. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    Another option is to download the square from the OSM website directly, but that only works for files that are not too big. 20 km might be too big.

    If you plan to process the data a lot of times, it's probably easiest to extract the data in QGIS first. You can use the bounding box option in scenProc, but loading will cost more time in that case. If you only want to process it once the time difference is maybe less important.

    The min and max values are what they say :). The the min is always the lowest value. So also if coordinates are negative. So minx, miny is the lower left corner and maxx;maxy the upper right corner.
     
  10. whitav8

    whitav8

    Joined:
    17 May 2010
    Messages:
    96
    Country:
    us-california
    Arno,
    What a treat to see some buildings in my hometown (Oceanside) in California where there is just a little OSM data - amazing! Thanks for your quick response since we didn't have a tool to read the OSM and make a TOC file that was generalized like ScenProc.

    I need to read up on QGIS because I didn't see how to export some OSM for a rectangular subset area - but your own min/max coordinates worked fine.

    Thanks again

    Dave W.
     
  11. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    Happy to hear that worked.

    I don't load OSM data in QGIS that often, but I believe there is a plugin to load data for a given area available (it should be installed by default).
     
  12. Rodeo

    Rodeo

    Joined:
    29 Mar 2017
    Messages:
    8
    Country:
    germany
    Hi Arno,

    as a beginner of scenProc in aerofly I'm looking for an exclude option. The reason is to exclude airport area where the buildings are placed with ac3d.
    Can you point me to the direction how to do that?

    Thanks and regards
    Rodeo
     
  13. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    I'll try to make a sample script tonight. If you have a polygon that covers the area of the airport it is not so hard to do.
     
  14. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    Hi,

    Here is a sample script. I have commented it quite a bit, so hopefully it is self explaining :)

    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
    ExportTOC|out|annemasse
     
    Last edited: 18 Oct 2017 at 20:19
    Luis Clement likes this.
  15. Luis Clement

    Luis Clement

    Joined:
    10 Oct 2017
    Messages:
    3
    Country:
    france
    First of all to thank you very much for the great with your application! It is great!!!

    On the above does any of the friends here could share a shp file that I could edit and use? I am not proficient with QGIS, I tried but got completely lost... So I was hoping this exclusion could ve done with just GPS corner coordinates or somthing like it? A second point in your maual, pdf, your exmaples have an arrow that when copied to a notepad type for editing gives some errors and I saw many peopel get lost. For sure easy to fix by deleting the characters, just thought I mnetioned. Cheers, Luis
     
  16. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    If you want a rectangle area you could also use the CreateRectangle step in scenProc. This will make a rectangle from the coordinates you specify.

    Another option would be to use the airport bounds from OSM, but they might not match the actual addon extends.

    The arrows in the manual indicate that the same line continues. I can't put such long lines in the manual else. So you need to put them back on one line in the editor.
     
  17. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    Hi,

    There was a mistake in the sample script above. I made it from mind yesterday, but the FilterFeatures step is implemented differently then I remembered. So I changed that part of the script a bit to work.
     
  18. Luis Clement

    Luis Clement

    Joined:
    10 Oct 2017
    Messages:
    3
    Country:
    france
    Salut Arno merci!
    Quick question, have you corrected the script above or do you have a new one you can share? I understand from the pdf, and I did fix it myself like you mentioned. I only mentioned it to you as I saw it from other people having trouble on another forum... :)
     
  19. arno

    arno Administrator Staff Member FSDevConf team Resource contributor

    Joined:
    28 May 2004
    Messages:
    24,694
    Country:
    netherlands
    I have updated the sample above. So what's posted is correct now.
     
  20. Rodeo

    Rodeo

    Joined:
    29 Mar 2017
    Messages:
    8
    Country:
    germany
    Hi,

    I can confirm that it works now. The log lists the number of excluded objects by the shape polygon.
    Thank you so much for your effort!

    Rodeo
     

Share This Page