# Extrusion bridges from OSM data?

#### crushnik

I found when searching through an OpenStreetMap file that you can filter road sections that are on bridges. Is it possible to convert this data into extrusion bridges somehow?

Thanks,

#### crushnik

I know the ScenProc manual covers Extrusion Bridges, but I can't really make sense out of some of the elements.

Code:
CreateXMLBridge|highway="motorway" AND bridge="*"|highway="motorway"|12|layer|6|0.1|8aaabdf2-4496-483a-8df1-86ea13aa950d|7ed5603a-d17a-4246-bc3d-baadea6909fa|bef5ea7f-4a47-4e35-8a6e-c7eb78e6ff0e

I am having a hard time applying this example (from the ScenProc manual) to my Tennessee OSM data: https://download.geofabrik.de/north-america/us/tennessee-latest-free.shp.zip or getting anything to work. Has anyone else had success?

Last edited:

#### arno

Staff member
FSDevConf team
Resource contributor
Yes, it works for me

The manual explains what all the steps are. Actually the sample should just work on your OSM data as well (assuming it was loaded from PBF, if you use a SHP your attributes might have different names).

#### crushnik

Yes, it works for me
If that's all it takes to make my wildest scenery creation dreams come true, I can download the PBF instead. Can't wait to get home and see what this looks like! Thanks again Arno!!!

#### arno

Staff member
FSDevConf team
Resource contributor
You can also change the filters in the script of course to match your data, that's not a lot of work either

#### crushnik

Used this:
Code:
#
ImportOGR|path\to\file\tennessee-latest.osm.pbf|*|*|NOREPROJ
#
#
ExportBGL|P3D v2|TNbridges|path\to\output

ScenProc says it wrote about 1,000 bridges or so (which do not display on TMFviewer), but also said I need to tell it where XtoMdl.exe is in the Options menu and I see no such option. Took a look around at other people who had a similar issue of not being able to point ScenProc to the XtoMDL file and thought I would try pointing the ScenProc config file to the P3D SDK instead of the default FSX SDK -- with no luck.

Additionally, my bridge BGL file gave me flickering polygons in the sim and then caused P3D to crash.

Last edited:

#### arno

Staff member
FSDevConf team
Resource contributor
Hi,

TMFViewer does not show BGLComp based BGL files, so it's normal you don't see anything.

I thought I had fixed the issue with the XtoMDL path warning. Are you using the latest development release? Let me check tonight.

What was flickering in sim? You should see some bridges normally.

#### crushnik

Are you using the latest development release?
The 8/1/2020 dev release. Next time I am in front of the computer I will have to run the script again and record a clip to explain the flickering issue better.

#### arno

Staff member
FSDevConf team
Resource contributor
8/1/2020 as in August 1st I assume (I read it as January 8th with my European eye's). That version should have the fix already.

#### crushnik

That version should have the fix already.
I wondered that myself... I know I downloaded it on August 1 so I thought you were just being extraordinarily considerate to your friends in the United States by naming it that way.
I did see from other posts on the XtoMDL options issue that you said you had fixed it, so I'm not sure what my issue is (I've found that in general it's safe to assume that I am the problem). I downloaded the 64-bit update version, "3.0.0.0 rdbbf6395 DEV 8/1/20" -- I'll try installing again and see if that fixes the problem.

EDIT: it did not work any better after re-installing the FULL 64-bit latest development release. I've got grey flickering lines shooting across the screen (looks like vehicles flying by on a time-lapse video) and, on the horizon, what looks like a gigantic extrusion bridge that's about 100 miles above the surface. The script I used is in Post #6 above and the sim crashes a few seconds after loading unless I run P3D after I remove the bridge BGL.

Thanks for all the help!

Last edited:

#### crushnik

I tried exporting the bridge data from an Open Street Map shapefile zip, added brackets around the GUIDs and changed the first one, which was an FSX guid, out for a GUID I found in the P3D SDK. Had some success, but if layer is height data, then many of the bridges have a "0" layer data and I'm guessing that is why I am not seeing any overpasses. All roads spanning water vectors appear to be bridges, which is great.

Here is my code:
Code:
#
ImportOGR|path\to\shapefile|*|*|NOREPROJ
#
#
ExportBGL|P3D v2|TNbridges|path\to\folder

It worked, so I don't know if the XtoMDL notification was an issue anyways. What I did notice is that the simulator would get stuck at 80% when loading the flight if the bridge BGL files were in the Scenery folder. It would work, however if they were in the Texture folder. This may be a fluke, I don't know.[/code]

#### crushnik

Is there a way to exclude stock extrusion bridges, both road and rail? I typically append statewide shape files into SBuilderX, but I do not see a good GUID option. Is it done by XML file or something?

Also, when there is a bridge, is there a way to make the road texture underneath disappear?

Thanks,

#### JRobinson

Yep XML, click the "X" exclude icon and draw a rectangle. Tick "extrusion bridges" in the dialog that pops up.

Also, when there is a bridge, is there a way to make the road texture underneath disappear?
Only way I know is to break the road at that point and start it again on the other side of the bridge. If it's a short section of road you can export it to SBX, right click, do "manual check", delete all the points coming from one direction, then re-append the SBX, do manual check again and delete all the points coming from the other direction leaving a gap where the bridge is. You might also try "slice to QMID 20" or something, then delete a small section and drag some vertices around to make the road start/stop where you want it.

#### crushnik

Revisiting extrusion bridges and examining the XML file to figure out why my bridges aren't showing up. Is the elevation data generated by CreateXMLBridge being added and subtracted to the elevation data from the terrain mesh? Or is that above and below sea level and my bridges are looking great, apart from being buried underground?

Code:
<ExtrusionBridge
instanceId="{c5831d1f-79c9-4d64-93a5-a1bc892a7d60}"
probability="0.0205347426331298"
suppressPlatform="FALSE"
imageComplexity="NORMAL"
extrusionProfile="{8aaabdf2-4496-483a-8df1-86ea13aa950d}"
<AltitudeSampleLocationList>
<AltitudeSampleLocation  lat="36.5622512" lon="-94.3459459" />
<AltitudeSampleLocation  lat="36.5618667847449" lon="-94.3445727193346" />
</AltitudeSampleLocationList>
<PolylinePointList>
<PolylinePoint latitude="36.5622512" longitude="-94.3459459" altitude="-0.32481"/>
<PolylinePoint latitude="36.5620056" longitude="-94.3450715" altitude="7.95620"/>
<PolylinePoint latitude="36.5622512" longitude="-94.3459459" altitude="7.95620"/>
<PolylinePoint latitude="36.5620056" longitude="-94.3450715" altitude="-0.32478"/>
<PolylinePoint latitude="36.5618667847449" longitude="-94.3445727193346" altitude="-5.04380"/>
</PolylinePointList>
<PolylineObjectPlacementList>
<PolylineObjectPlacement id="{bef5ea7f-4a47-4e35-8a6e-c7eb78e6ff0e}" />
</PolylineObjectPlacementList>
</ExtrusionBridge>

#### crushnik

Finally getting somewhere... this is supposed to be two parallel bridges where US 60 spans the Current River at Van Buren, Mo. You can see the southern bridge shows up, but the northern one does not. During my entire flight, I was treated to these white, flickering lines running for miles and miles in various directions that don't appear in my source data shapefile (see attached), which I made by filtering primary, secondary, and motorway roads (and their trunks) from OpenStreetMap source data, then filtered out bridge="T"

Code:
#
ImportOGR|pathtoshapefile|*|*|NOREPROJ
#
SPLITGRID|LOD5|*|*
#
#
ExportBGL|P3D v2|MO_bridges|pathtooutput

#### Attachments

• 2020-12-8_10-33-7-564.jpg
316.4 KB · Views: 191
• Screenshot 2020-12-08 104835.png
18.7 KB · Views: 141

#### arno

Staff member
FSDevConf team
Resource contributor
Hi,

I think the problem might be your filter for the ramps, at the moment you include all features in there, including the bridges themselves. What I always do is make sure that only features that are of the same type and not a bridge are selected.

Here is an example line I use for motorway bridges:

Code:
CreateXMLBridge|(highway="motorway" Or highway="motorway_link") And bridge="*"|(highway="motorway" Or highway="motorway_link") And Not bridge="*"|12|level|2|0.05|{dee07112-c3e3-44e2-b68b-1311e8952444}|{7ed5603a-d17a-4246-bc3d-baadea6909fa}|{5ab44846-7d8b-4661-8329-8051536ab17a}

#### crushnik

Makes sense @arno, I'll give it a shot. Thanks!

#### crushnik

I use OSM pbf files to make extrusion bridges and it works great. Until a bridge crosses from one state to the next. In the case of Missouri and Illinois, the bridges just collapse into the Mississippi River. Does anyone have an idea that might lead to a solution?

#### GaryGB

Hi Chris:

IIRC, a solution to this issue you cite may have been found, but I don't recall exactly where it is discussed.

One may need to utilize GIS data from both the adjacent discrete US State-based data sets to avoid gaps in bridge assembly.

But I'm not certain if there is a way do this via semi-automated means.

So, in some cases one may need to manually assemble a bridge.

This is just a shot in the dark, but perhaps some of the linked info below may prove useful:

First, an old thread-based mini-tutorial from Scott Gridleys FreeFlow forum system using the SBuilder for FS9 (aka "SB205") GUI:

While intended for FS9, most SDK BGLComp concepts are 'comparable'; XML syntax may be slightly different for FSX / P3D.

The SBuilder for FS9 project can be saved as a legacy format SBuilder Exchange file *.SBX and 'Appended' to SBuilderX

If needed, SBuilderX SBuilder Exchange file *.SBX format can be retro-converted to the legacy SBuilder for FS9 *.SBX format via:

Luis Sa's SBX3TO2 utility for converting SBuilderX format *.SBX files to SB205 format *.SBX files:

Original source for quote: http://www.fs-freeflow.com/forum2/index.php?topic=595.0

"Wayback Machine" Internet Archive:

https://web.archive.org/web/20060105182758/http://www.fs-freeflow.com/forum2/index.php?topic=595.0

BTW: SBuilderX' method may have superseded SBuilder_205' above method with its quirks / 'gotchas' as cited in its "Help" file:

"Extrusion Bridges

Extrusion bridges are the new FS X method for inserting bridge objects. Each point on the line will display a bridge pylon, and will have a height above a plane determined by the 2 end points. Go to the tab to select the bridge model:

By clicking on the Properties button, you can indicate more parameters:

The width of the bridge should correspond to the width of the road as determined in the terrain.cfg file. Unless you will have freeway traffic passing over the bridge, it is best to Suppress the Platform, as they have a large impact on performance. You can set the height of the bridge in 3 different ways:

1. Set the maximum height in the above window. SBuilderX will calculate a gradual rise from one end of the bridge to that height, and then descend to the other end.
2. Set the height in the General tab. All points will have the same height.
3. You can set the height of each point individually by right-clicking on each and displaying its Point Properties window."

Arno and Holger sorting out some extrusion bridge issues in another older thread:

Luis Feliz-Tirado's "Illustrated Guide to Extrusion Bridges"

https://library.avsim.net/esearch.php?CatID=fsxsd&DLID=140542

P3Dv5 BGLComp SDK docs regarding Extrusion Bridges:

https://www.prepar3d.com/SDKv5/sdk/world/scenery/scenery_overview.html#ExtrusionBridge

IIRC, I cited some pertinent threads dealing with extrusion bridges in this search result:

...and in these search results:

I hope this helps.

GaryGB

Last edited: