PYLONGEN utility to generate pylon scenery objects from OSM files 1.0.1

License Agreement
Flight-Sim.org - Lizenz

Will generate a TSC file with positions matching all nodes with power="tower" tag in a OSM file.

--------------------------------------------------------------------------------------------------------


Note : PylonGen has been superceded by the new generalized ObjectGen utility


--------------------------------------------------------------------------------------------------------


A significant feature of VFR flight are lines of power pylons stretching off into the haze.

In the absence of a MakeAF2Object directive in scenProc, I created a utility PYLONGEN to parse OSM files and generate a TSC file with entries

for each node along ways tagged with k="power" v="line".


PYLONGEN


The PYLONGEN utility will use the bounds defined in the OSM file to calculate the coordinates

for the TSC and reject any pylon points out of bounds.


PYLONGEN expects the following command line arguments


arg[0] The OSM file must be specified by direct or relative path.


arg[1] Optionally a second argument to specify the relative path from the TSC file

to the PowerPylonModels folder in the deployed scenery/places folder hierarchy.


No second argument means the PowerPylonModels folder is local to the TSC file.

..\ would mean PowerPylonModels folder is in the parent folder.

..\..\ would mean the grandparent.


Placing the PowerPylonModels folder at a higher level in the hierarchy means

it can be shared by multiple cultivation areas.


The utility will produce TSC and log files in current directory.


Model selection precedence


If the power="line" way has a tag model="yourSiteSpecificModelName", the specific model will be used for that line. This allows customization for distinctive pylon styles.


If no model defined but the line has a cables tag defined for the way, a generic N-cables model name will be be selected based on number of cables. A number of generic pylon models have been provided.


As a last resort the defaultPylon model will be used.


Way and node ids are added to the TSC to track back to OSM file for any missing or spurious towers.


Model development

Example models were converted from SketchUp 3DWarehouse (I found ZoSoChiles 3d Model conversion post most helpful in getting the pylon models converted.)


The model base must be centered on the drawing origin


No geo-position info should be defined in the model


The model should be aligned for a east west cable run


The piers should be extended well below grade to allow for slope placement. Steep slopes may require manual elevation tweaks in the TSC.


Limitations

You may need to set the time of day to align 3D generated shadows and ortho image shadows.


Ortho image of power cables are sometimes highly visible and may not be aligned with implicit line of sight from the camera position. I do not think anything can be done to fix that.


Tower model and orientation may be confused where lines join. Depends on which way gets processed first. Can tweak in the TSC if you care.


/Stu

  • Version 1.0.1

    Bug fixes based on early feedback


    - Do not create TSC if no pylons detected within bounds.


    - More graceful handling of missing or malformed arguments.


    - Use culture invariant number format for TSC midpoint


    - Added 10-cables model. Extended piers below grade for all models. Include SketchUp files for models

  • Version 1.0.0