Object generation utility

  • How to generate a drop target


    Copy below code into a text file and name that OsmDropMe.bat.

    Position it onto your desktop.

    Adjust drive and path to the real position of your osm2AFSobject folder.

    I also copied the example.xml to tom_scene.xml


    Then you can drop any .osm file onto this batch file.

    Code
    1. F:
    2. CD \Geoconvert\osm2AFSobject\
    3. DEL osmObjects.tsc
    4. osm2AFSobject.exe %1 .\tom_scene.xml
    5. PAUSE


    The resulting file osmObjects.tsc has to be renamed, i.e. Objects_Munic.tsc and copied to your assosiated airport.



    PS: The only critical part in the example.xml file, which needs attention is this line:


    <relativePathPrefix>"..\..\..\..\objects\"</relativePathPrefix> (correct, if your objects folder is 4 folders higher in your directory tree then the tsc file.)


    <relativePathPrefix>"..\objects\"</relativePathPrefix> (if your objects folder is 1 folder higher in your directory tree.)


    <relativePathPrefix>"objects\"</relativePathPrefix> (if your objects folder is in the same folder as the tsc file)


    everything else can be left alone for the beginning.

  • There is no right or wrong answer for relative paths.


    It all depends on how you want to place your scenery files in the run time folder structure.


    The osm2AFSobject User Guide describes a folder structure that places the objects folder at the same level as scenery in the extra user folder structure.

    This mirrors the folder layout in core AFS2 distribution. The relative path prefix in the example.XML was tested against that folder structure.


    If you want some other scenery organization you will need to adjust the relative path prefix and potentially the model name strings in the XML to match your layout. It is configurable because everybody has a different idea on how things should be organized.


    /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

    Edited once, last by lenidcamper ().

  • Ok, finally it worked !!! Thank you Stu and Tom !


    But curiously, when I have a look on my .tsc, only few aerialways and skilifts are written..... In the Saanen area for example, on google street map you see more than 20.... I make the selection square, save by overpassing API, then run your .exe, all is ok, but few aerialways and stations are present in the final .tsc


    Any ideas ?


    Thx

  • but few aerialways and stations are present in the final .tsc

    check the tags on the ways for those lifts . make sure your criteria will select them.


    if they are different you need to create a new way configuration for the different selections.

    There is no orCriteria to allow this or this selection

    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

  • ok. by my example.tsc, I find this entries:


    <andCriteria>

    <keyValueEntry key="aerialway" value="gondola" />

    <!-- occupency tag can be used to process aerialways of a certain type with appropriate sized towers.

    Requires additional way configuration for each type.

    -->

    <keyValueEntry key="aerialway:occupancy" value="8" />

    </andCriteria>

    </selectionCriteria>


    Do it means I have to change the entries with the same names/values as yours, or shoud I have to ADD more key entries.


    A question: how did you find the "cable_car" value ? From where do you know that ? And what means "8" or "30" ??? A skilift, for example, what will be the "name" and the value ? "2" ? "1" (if it means the number of persons ????


    Thx, I'm totally new

  • If you need a specific lift to be recognized correctly, you have to look into the OSM source. Either by notepad++ (see above) or by JOSM (see below).

    Then adapt your xml to the filed_names (=key) and values listed there.


    Regarding my example Herzogstandbahn (60 km SSE of Munich) with JOSM


    Mark the cable car track (here: dashed red line)

    :


    and look into extended Information:


    There you find the two key fields (red and green marked) to be entered into the xml.

    You have to REPLACE the existing value.

    Therefor I am working with a copy of the example.xml file!


    Alternate entries for different cable cars may be possible, but there I need an example from a more knowledged person.


    Cheers,

    Thomas

  • If you look at your osm file in a programme like JOSM you can see how the aerialways are defined by clicking on it. All these definitions (value) have to go into the xml file. else they won't be found. There is not just one 'skilift'.


    You will also find definitions here: https://wiki.openstreetmap.org/wiki/Key:aerialway

    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

  • The selection criteria can be any tag you want.


    If for example some aerial ways are tagged with manufacturer make or model information and you have a 3D model for that type of equipment you can use that tag to apply the correct model only to the aerial ways of that type.

    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

  • In the xml file to filter the osm data. This creates then a tsc with the coordinates. You then still need the appropriate objects that are called from the tsc. I do not think that you have these objects ready. Maybe some can be found in the sketchup warehouse.

    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

  • ahhh ok thank you TomB..... I thought it was possible just to have the "pylons" of all cableway, gondola, chairlift, t-bar and so on.... with some kind of simplified "standart" models..... like it works with Electricity Pylons in Pylogen.exe.


    Ok, now it is not possible, at last to "cultivate" big ski resorts like Switzerland: each of these has a mix of differents aerialways....


    But to have already the Elecricity Pylon is great !!!!


    Anyway, thank you for your help !


    Happy weekend

  • I didn't want to stop you. I have checked the Gstaad area and filtered out all aerial ways with the help of osm filter. This is what I got:



    It is shown without the bing background because one can see it better like this. There are four gondola aerial ways and one chair lift with pylon information. Drag lifts have no information about pylons. I have found various pylons in the sketchup warehouse. For the gondolas the osm2AFSobject can be used and it would give pylon coordinates. For all other arial ways it would only give the stations coordinates. These coordinates can also be extracted from google maps directly and pylons from the sketchup warehouse could be hand placed.

    I will test this once maybe over the weekend.

    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

    Edited once, last by TomB ().

  • I thought it was possible just to have the "pylons" of all cableway, gondola, chairlift, t-bar and so on.... with some kind of simplified "standart" models..... like it works with Electricity Pylons in Pylogen.exe.

    The power pylons are quite consistently tagged. Some other object types have a variety of tags.

    That is the downside of an extensible crowd sourced system.


    I did not implement the orCriteria because I did not know if there were use cases that would require it.

    I was not sure anyone would want the same model displayed for features that had different tags.


    it is possible with v0.1 to cut and paste a way or node configuration and substitute different selection criteria.


    I wanted to understand the requirements before adding any complexity in the selection criteria schema.

    Everyone should understand that v0.1 was released as beta to determine if my understanding of the requirements

    captures the range of other peoples requirements.


    Requirements=>design=>implementation=>test=>release


    /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

  • Hi Stu,

    yes I think it is senseful to assign a similar model to different nodes, if not a common key can not be found.


    Another question:

    How far can the schema be extended by the user:

    -Is it possible to define different skilift types (way) and different pylons (nodes) below the section ski lift scenario?


    - Can a new category (i.e. Cooling towers) added by the user?


    I would be very grateful for some more examples.


    Cheers,

    Thomas

  • How far can the schema be extended by the user:

    The schema (osm2AFSobject.xsd) is fixed as delivered in the release. The schema is what drives the parsing logic for the XML configuration files. If the schema changes the parsing code needs to change. As long as all configuration files comply with the schema (pass validation) they will be parsed and processed correctly (barring any bugs in the code :()


    If you want different pylon types for different aerial ways you need to copy and paste the ski lift way configuration example and substitute selection criteria and model names for the new type of aerial way.


    For new object class (ie cooling towers) it depends if they are represented by a circumference way or single node.

    Whatever the case it would be like the way or node configuration examples for storage_tank with selection criteria of "man_made" and "cooling_tower" (or whatever tag is in the OSM file.)


    Have a look at the algorithm described in the User Guide. Everything depends on defining criteria to select nodes or ways of interest and model matching criteria to select a model name to export for the feature..


    /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

  • Thank you Stu for your explanation. I will play with it...


    I have one important feature wish:


    Limitation the of OSM data area like ScenProc:

    ImportOGR|e:\OSM\muenster.osm|6.6796875;7.03125;51.9485109588037;52.1630778751331


    Two reasons:

    - If you download an osm area from Geofabrik.com, some areas are as big as 2 GB and can not sub-devided.

    These are too big and osm2AFS2object crashes.

    - the resulting tsc file would become too big anyhow.

    - if you split it to smaller pieces and try to do this with JOSM, one often gets an overlapping coverage, which will result in doubled objects.


    Then I could run ScenProc and directly after it, your program with the same area limits.

    I am not shure what is the better way: as third parameter or as line in the xml file.


    It would be very nice if you could implement this.

  • Currently objects are clipped at the bounding box defined in the OSM file

    Adding a boundingbox override in the XML is not difficult but there may still be performance issues on very large files.


    I have always used a tiled approach to cultivation.


    For each 01x0.1 degree tile I generate a powershell script of the form


    Set-ExecutionPolicy Bypass -scope Process -Force

    $client = new-object System.Net.WebClient

    $client.DownloadFile("https://overpass-api.de/api/map?bbox=6.9,46.3,7.0,46.4","F:\scenery\cultivation\work\6.95_46.35\6.95_46.35.OSM")


    I have not tried Geofabrik. I need to look at the implications of very large OSM files.

    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