OSM feature detection in SceneProc

  • Hi,

    Quite new to the scene but I'm very interested in messing around with some scenery creation using AeroScenery and SceneProc, I've managed to get most of it working just fine but now I'm trying to delve into SceneProc for a more custom template based on my area.

    I've noticed that some tags don't work at all in SceneProc, I'm not sure if anyone else experienced with this or the author has a predefined list of key/values that are accepted.

    map.osm

    SceneProc.spc file

    Code
    ImportOGR|D:\AeroScenery\map.osm|*|*|NOREPROJ
    UnloadFeatures|natural="tree_row"
    
    OUTPUT:
    18:35   UnloadFeatures    Information    Removing features that match natural="tree_row"
    18:35   UnloadFeatures    Information    Removed 0 features

    Funnily enough if I modify my map.osm to change the tag key from natural to highway it works fine.

    Code
    ImportOGR|D:\AeroScenery\map.osm|*|*|NOREPROJ
    UnloadFeatures|highway="tree_row"
    
    Output:
    18:36   UnloadFeatures   Information     Removing features that match highway="tree_row"
    18:36   UnloadFeatures   Information     Removed 1 features

    I could potentially rename the ones I want, but before I do that I'm unsure if this is intended behavior? The default OSM map comes with natural=tree_row tag/key pair.

    Other than that much thanks to Nick (AeroScenery), Arno (SceneProc) & Crispy (SceneProc Template).

    Here's what I have so far (Edinburgh in progress):

    [Blocked Image: https://i.ibb.co/xFGfqXM/ed.png]

    Original Google Maps 3D Aerial - still some way to go, primarily fixing vegetation and additional buildings where there should be vegetation.

    Thanks.

    Edited 3 times, last by nmj (December 23, 2018 at 9:28 PM).

  • Not sure whether you’re aware but if you’re cultivating in the UK you can use Ordnance Survey data. It’s pretty much the Gold Standard as far as cultivation goes - every building and tree clump is included. (That is unless something better has been devised since that I’m not aware of.)

    Most of the work on OS Cultivation has been done by Spit40. Search for his latest configuration file. - the one that solves the problem of the shimmering buildings.

    EDIT: Just found Spit40’s instructions and config file and put it in the post below .....

    Cheers

    Ian

    New Simplified Workflow for OS Data Cultivation

    I got ScenProc working directly from the OS data without the need to process in QGIS. Here's the full working workflow.


    1. Go to this page on OS Site
    2. Pick the squares you want data for (hold ctrl down for multiple) - check you're downloading data type:vector download ESRI shape
    3. Scroll to the bottom and click Continue, enter your details
    4. A few minutes later you get a download link for files with names like "opmplc_essh_sd.zip" (this would be for SD grid square)
    5. Unzip these files you receive and you'll find a data folder that contains files like: SD_Road.dbf, SD_Road.prj, SD_Road.shp, SD_Road.shx
    6. The SHP files are the primary ones, but keep the PRJ and SHX in the same folder
    7. Install ScenProc
    8. Now edit the file paths on lines 11,12,13,14 & 93 of the following scenproc script, save it as something like "os_data_SD.spc"
    9. Comment out lines 18-23 as necessary depending on whether your cultivation area includes airports that you have built cultivation exclusions for
    10. Load your SPC file into scenproc then run it to convert the OS Data into a TOC file for adding to your airport cultivation

    Edited 2 times, last by Ian C (December 24, 2018 at 12:21 AM).

  • Thanks Ian,

    I've tried that and it seems like some of the building data is a bit off, I am expecting grass and see a building instead in some places (especially gardens). Going to have a better look to see what is causing it, need to trim the .shp files first as even one square is way too large.

  • Thanks Ian,

    I've tried that and it seems like some of the building data is a bit off, I am expecting grass and see a building instead in some places (especially gardens). Going to have a better look to see what is causing it, need to trim the .shp files first as even one square is way too large.

    Occasionally there's a mismatch between the aerial images and the OS data if new houses have been built on a greenfield site recently. (The OS data is more up-to-date I guess.)

    The OS grid squares are very large (100x100 km). I like to have my tree separation set to 0.0001 degrees but I don't think ScenProc can cope with the large number of trees generated for some of the squares (over 15 million) - usually if there are a large numbers of buildings too. It crashes. Square TQ (containing London) is particularly problematic. I've had to reduce the tree density in some cases.

  • Fair enough, I'll do some cross-referencing with the OS data to see if it's indeed the right landscape compared to what I see in-game (ignoring photoreal scenery).

    Edit:

    Seems I've got it working now, PlacePointsInPolygon was missing a INHERITPARENTATTR at the end and I accidentally renamed the .toc file on the output so it wasn't overwriting the old one I had (figured that out after I literally trimmed the entire area down and wondered why everything was still showing up).

    I just need to play with ReplacePolygonByBuildingRectangles now as some of the more complex polygon shapes are displaying in a weird way (and with different roof types unfortunately, but unsure if I can do anything for that).

    Edit 2:

    I think I'm at a point where complex polygons need to be done manually and the only way to have the same roof/building is to remove all the other ones from the building_textures folder as it seems AFS2 just chooses one at random. I also noticed some rotation issues (houses on a hill), they'd either be floating or be in the ground but I don't think much can be done about that unless I design them manually and place them on the map or so.

    Anyhow I'm happy with the result now - Day Screenshot / Night Screenshot. Perhaps the next step is getting the Edinburgh building textures and finally the airport.

    Edited 3 times, last by nmj (December 24, 2018 at 4:17 AM).

  • I've noticed that some tags don't work at all in SceneProc, I'm not sure if anyone else experienced with this or the author has a predefined list of key/values

    But back to the original question.

    I too have never been able to get natural="tree_row" to work either with LineToPolygon or PlacePointsAlongLine

    This may be a scenProc limitation.

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • There is a fix for the "tree_row" issue

    In the scenProc\gdal-data\osmconf.ini

    In the [lines] section replace

    attributes=name,highway,waterway,aerialway,barrier,man_made,power,tunnel,bridge,railway

    with

    attributes=name,highway,waterway,aerialway,barrier,man_made,power,tunnel,bridge,railway,natural

    Arno said he will update the config for the next release

    cheers

    /Stu

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Why does the attached OSM file not create a toc-file when running through ScenProc (template_ver6.spc). These are all natural=tree points. The data is from osm and filtered out with osm-filter so only natural=tree is kept in order to keep the file small. The region is north of Berne.

  • I am not sure what is in template_ver6.spc but

    ImportOGR|map.osm|*|*|NOREPROJ

    CreateAF2Plant|natural="tree"|10;12|0|broadleaf

    ExportTOC|.\|cultivate

    produces trees from that osm snippet

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • natural=tree_row does still not work with scenproc latest dev release.

    What is wrong with that:

    PlacePointsInPolygon|natural="tree_row" And NOT landuse="forest"|0.00009;0.00009|1.0;1.0|INHERITPARENTATTR

    CreateAF2Plant|natural="tree_row"|10;15|0|broadleaf

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

  • natural="tree_row" is a line feature

    LineToPolygon|FTYPE="LINE" And natural="tree_row"|3|String;landuse|tree_row

    PlacePointsInPolygon|landuse="tree_row"|0.00005;0.00005|1.0;1.0|INHERITPARENTATTR


    CreateAF2Plant|landuse="tree_row" And FRAND >= 0.2|4;12|0|broadleaf

    CreateAF2Plant|landuse="tree_row" And FRAND < 0.2|5;10|0|conifer

    will create a 3m polygon along the tree_row features and place points in the landuse="tree_row" polygons

    The PlacePointsAlongLine directive is not well suited for tree cultivation.

    /Stu

    i7-6700K CPU @ 4.00GHz | ASUS Z170-A | 16Gb DDR4 | Samsung SSD 950 PRO NVME M.2 256GB | Samsung SSD 850 EVO 1TB | GeForce GTX 1080 Ti on GP102-A GPU | Oculus CV1 | Windows 10

  • Thanks lenidcamper, works fine now.

    Below is a screenshot from an area with defined tree rows in JOSM (orginal osm data from bbbike). The second picture shows the same region in AFS2 Scenery Editor after the scenproc process. The forests and buildings are not shown as I filter them out for the tests. There are very few tree_rows in osm data but one can draw them yourself (a line defined as tree_row). This is faster than drawing single trees. Can be used for alleys too.


    And finally the view out of the lovely R22.

    Regards,

    Thomas

    i7-14700KF @ 5.6 GHz, Geforce RTX 4090, 32MB RAM, 1TB SSD M.2, 1TB SSD M.2, 2TB SSD M.2, 32" Monitor 4K, Pimax Crystal

    Edited once, last by TomB (January 30, 2019 at 10:53 PM).