• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Error when compiling road traffic

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

When I am compiling my lines with road traffic in SBuilderX I get the following error:

Conversion from string "" to type 'integer' is not valid

Has anybody seen this error before?
 
Messages
506
Country
unitedstates
The error message doesn't trigger for me. Are you making roads, traffic or roads with traffic? I just made a quick test file and SBX gave me what I laid out, including traffic with the "b" tag! :eek:

I didn't test within FSX, just the making and compiling of the file.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

I am using linear features for the freeway traffic. I am not making the roads themselves, since they will be used together with a photo scenery.

Maybe another factor is that I imported them from a shapefile and that there are about 50000 features in that file.
 
Messages
214
Country
unitedkingdom
I'm getting the same message Arno. Did you figure out what the problem and solution was?

I'm using Shapefiles, but with very few features.

I have ArcGIS v10

Andy
 
Last edited:

RicherSims

Resource contributor
Messages
567
Country
dominica
This is a shot in the dark, but last time i remember seeing an error like that I think it had to do with direction of flow of traffic. Try selecting all your lines and setting the properties to flow forward or backward, but not both.
I might be wrong but hope this helps.
 
Messages
68
Country
italy
Hi Arno,
finally you had resolve thi error.
Today i try to add some road traffic in beograd and the same error appear:

Conversion from string "B" to type 'integer' is not valid.

After two three times, another error report that cannot save or compile BGL beacuse file is open to another application.


Thanks for yout help,
Simone
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

I am revisiting my old topic. It indeed seems to be related to the traffic direction.

But is there a way to update this value for all lines at once? Even with all lines selected, SBuilderX only updates the one I right click on.

So that means I have to separately update all my lines, which is a lot of work when processing a big area.

Maybe I should just update scenProc to be able to do this for me, probably quicker... :D
 
Messages
1,510
Country
unitedstates
So that means I have to separately update all my lines, which is a lot of work when processing a big area.

Maybe I should just update scenProc to be able to do this for me, probably quicker... :D

You could export your lines to .SBX, then open the SBX in a text editor and replace every occurrence of "Type=FWX2B" with "Type=FWX1F" for example. Then delete all lines from your project and re-append the fixed .SBX.

Jim
 
Messages
506
Country
unitedstates
You could export your lines to .SBX, then open the SBX in a text editor and replace every occurrence of "Type=FWX2B" with "Type=FWX1F" for example. Then delete all lines from your project and re-append the fixed .SBX.

Jim

Why not export the entire project, make the changes and bring it back into SBX? If there are a lot of lines showing, it could turn into quite an adventure?


Hi,

I am revisiting my old topic. It indeed seems to be related to the traffic direction.

But is there a way to update this value for all lines at once? Even with all lines selected, SBuilderX only updates the one I right click on.

So that means I have to separately update all my lines, which is a lot of work when processing a big area.

Maybe I should just update scenProc to be able to do this for me, probably quicker... :D

One thing I'm wondering about with the usage of the "B" tag, is if there is a single line used for traffic going in both directions? And if so, is it sitting in the middle of the roadway? Dual direction traffic would need two lines, one for each direction. With a SBuilderX output file in .SBX format a good programmer, like you!, could manipulate the data fairly easily to turn one line into two, nudging them ever so slightly off the center of the road.
 

GHD

Messages
12,243
Country
england
Shp2Vec doesn't handle the "B" flag.

From the SDK

Note that the entry ‘B’ ( both directions) is not implemented.
 
Messages
1,510
Country
unitedstates
Why not export the entire project, make the changes and bring it back into SBX? If there are a lot of lines showing, it could turn into quite an adventure?

How does exporting the entire project change anything? I've always kept my traffic lines in a separate SBX project. I export my lines to .SBX, then move my existing lines over (so I don't end up with lines on top of lines), import the .SBX back into the project with the traffic direction reversed, and then spend hours adjusting points to fit the photoreal roads. It's a royal PITA no doubt, but the only thing that'd alleviate that would be if "B" worked in FSX.

With a SBuilderX output file in .SBX format a good programmer, like you!, could manipulate the data fairly easily to turn one line into two, nudging them ever so slightly off the center of the road.

That might work for straight sections of road but you'd need to figure out a way to detect curves and adjust the radius somehow between the inside and outside lanes.

It would be huge if an app could be written that would compensate for corner radii. I'd speculate that detecting and solving for corner radii is the reason it says "Note that the entry ‘B’ ( both directions) is not implemented" in the SDK :) .
 
Messages
506
Country
unitedstates
That might work for straight sections of road but you'd need to figure out a way to detect curves and adjust the radius somehow between the inside and outside lanes.

It would be huge if an app could be written that would compensate for corner radii. I'd speculate that detecting and solving for corner radii is the reason it says "Note that the entry ‘B’ ( both directions) is not implemented" in the SDK :) .

If you watch traffic going around a curve, isn't it a jerky process of fish-tail go straight, fish-tail, go straight? These are not smooth movement going around a bezier curve. (If that's the correct term? :confused:) The traffic is going from data point to data point, where it adjusts it's direction to go to the net data point.

It's been a while since I read the thing, but ERSI's paper on the SHP file format didn't mention anything about curved lines. It's just a process of follow the data points. And just like laying down a stream or drawing a coastline, the more data points there are the better it will look.
 
Messages
1,510
Country
unitedstates
I understand that, but if you have a long straight section of road, a 90° curve, and another longs section of road, which way do you shift the line so that they remain the same distance apart? Obviously you'd need to shift it 45° in a direction perpendicular to the apex of the curve but how would you calculate that if you had a road with multiple curves in both directions?

Would it be possible to somehow take "point-X" for example from the exported .SBX, calculate a direction or heading based on the positions of "point-X (-1)" and "point-X (+1)", then shift "point-X" slightly in a direction 90° to the heading derived from the previous calculation?
 
Messages
506
Country
unitedstates
There are formulary processes (neat term, huh?) where looking ahead to the next data point will give you heading and distance. So if you were to know that a 90 degree turn was the next direction any shift of the traffic point could be slightly less for the inside and slightly more for the outside lane of traffic.

Here is a link to one such site; http://williams.best.vwh.net/avform.htm

Makes me wish I had focused a little more in high school math. But I find if I stare at it for long enough it starts to make some sense. Then it's all a matter of trial and (lots of) error. :eek:
 

HolgerSandmann

Resource contributor
Messages
392
Country
ca-britishcolumbia
Hi guys,

Hi,

I am revisiting my old topic. It indeed seems to be related to the traffic direction.

But is there a way to update this value for all lines at once? Even with all lines selected, SBuilderX only updates the one I right click on.

So that means I have to separately update all my lines, which is a lot of work when processing a big area.

Arno, you can adjust any value within group selections (other than their names) but you need to be in the Line Tool mode (for vectors) and then right-click anywhere in the SBX window; the pop-up menu will have the header "ON MANY LINES" and then you can select Properties to make the required changes. If your traffic vectors are mixed in with other lines you can select only them via the Edit > Find tool by searching for their names or Guids.


As for making traffic vectors from roads there's actually a simple trick if you're only dealing with a few roads: make a duplicate of the road vector, right-click on it to assign a width (e.g., "6" for a typical minor road), then right-click on it again and convert to a polygon, then select the polygon to "Make Line" and, voila!, you have two perfectly parallel lines that you can assign traffic type and direction to.

Obviously, if your project has loads of road vectors the less painful way is to use a GIS program to create buffer polys of a given width for all vectors at once and then create boundary vectors along those. I use Manifold GIS, which takes only a few minutes for thousands of vectors, but there might be freeware alternatives that do the same job.

Cheers, Holger
 
Messages
1,510
Country
unitedstates
Thanks much for the helpful tips Holger, all above problems solved with a single reply :) .

Jim
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Holger,

Thanks, I am going to give that a try. You can see I don't use SBuilderX that often, I just clicked at the wrong place :)
 
Top