Vegetation creation with scenProc

  • While waiting for Arno's return to answer my questions about building creation I would like to know if anyone has ever managed to exclude trees based on natural areas.


    In my living are there are beautiful mountains (well, they should be considered as hills as they barely exceeds 600m), it's called le Massif de l'Estérel. They have some rocks with a very typical orange color:


    The problem is that on OSM the whole area is covered by a forest polygon (landuse = forest) so all the area is populated with trees preveting to see the rocks with real color.


    What I want to do is to exclude tree generation of the area with rocks. It should increase a lot the realism the scenery.


    For that I have created a lof of polygons on OSM with the tag natural=bare_rock (you can see an example here: https://www.openstreetmap.org/#map=14/43.5072/6.8828) but now I'm unable to configure scenProc in order to take them into account.


    I've tried to add And NOT natural="bare_rock" for the tree generation of forest:

    Code
    1. PlacePointsInPolygon|landuse="forest" And NOT natural="bare_rock"|0.00020;0.00020|1.0;1.0|INHERITPARENTATTR

    But I think it makes non sense because it should only exclude trees on OSM ways which have both landuse="forest" AND natural="bare_rock".


    I imagine that AddAttributeIfInside should my friend but adding the following declaration doesn't help:

    Code
    1. AddAttributeIfInside|FTYPE="POINT" And natural="bare_rock"|FROMFILE="*.kml"|String;skip|yes

    Any suggestion ?


    Thanks, Vincent.

  • I cannot help with the code but I can tell you how I would do it: with the help of AFS2 Scenery Editor and maybe with JOSM too. These are the tools I use after having sent a osm-file through ScenProc in order to detect forests, woods, tree rows and single trees and generating a toc-file. Usually I use osm filter before to continue to work with just the attributes I need. I would reccomedn to check in AFS2 Scenery editor what the toc-file looks like and delete the trees where necessary, maybe also add trees or bushes here and there.

    Best regards,

    Thomas


    i7-6700K @ 4.0 GHz, Geforce GTX 1080, 32MB RAM, 500 GB SSD, 1 TB SSD, 1TB HD, 32" Monitor 4K, Oculus Rift

  • Yes Thomas it is true that I can eliminate the trees manually with AFS2 Scenery Editor. But this would be the last resort because it will be a boring task and it's like I have to redo a job which is already done since I've already manually defined the rocky areas in OSM (which is good because it can be useful for other people and for other contexts than AFS scenery creation).


    I guess I could also use masks based on KML files in scenProc but again it would require duplicate work and it would not be generic.


    So if possible I would like to find a solution that is automatic and generic because I think that the problem itself is very generic (there are often forests in OSM that cover non-forest parts).


    AddAttributeIfInside should really help, I guess it was created for that ...

  • Vincent,

    Here is an example that will ignore all polygons tagged natural = "bare_rock" within landuse="forest" polys.


    ## ----------------------------------------------------------------------------------------------------------------------

    # osm

    ImportOGR|C:\Users\rgord\Desktop\Test_NATURAL\test_bare_rock.osm|*|*|NOREPROJ


    # clear all 'bare_rock'

    SubtractFeatures|landuse="forest"|natural="bare_rock"|1

    # TREES

    PlacePointsInPolygon|landuse="forest"|0.0001;0.0001|1.0;1.0

    # this line generates a broadleaf tree for 2% of the tree coordinates with each tree between 58 to 65 feet tall

    CreateAF2Plant|FRAND < 0.02|17.67;19.812|0|broadleaf|3

    # this line generates a broadleaf tree for 18% of the tree coordinates with each tree between 40 to 55 feet tall

    CreateAF2Plant|FRAND >= 0.02 AND FRAND < 0.2|12.19;16.76|0|broadleaf|0

    # this line generates a broadleaf tree for 75% of the tree coordinates with each tree between 32 to 45 feet tall

    CreateAF2Plant|FRAND >= 0.2 AND FRAND < 0.95|9.75;13.71|0|broadleaf|2

    # this line generates a broadleaf tree for 5% of the tree coordinates with each tree between 20 to 30 feet tall

    CreateAF2Plant|FRAND >= 0.95|6.096;9.144|0|broadleaf|12

    # Export the AF2 TOC file

    ExportTOC|C:\Users\rgord\Desktop\Test_NATURAL|test_bare_rock

    ## ----------------------------------------------------------------------------------------------------------------------


    -- Rich

  • Hello Rich,


    Thanks a lot, that was exactly what I was looking for !


    I've completely missed this SubtractFeatures statement. I'll test it tonight or tomorow as I'm in office today.


    It should also help to avoid trees on roads, and trees too closed to buildings (like in the scenProc guide example with the 1.5 ratio).


    Many thanks ! :)