• 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.

P3D v5 Importing from openstreetmap.org

Messages
1,964
Country
unitedkingdom
I'm very new to Scene proc, here you import a .osm file, but if I select an area equal to my geotiff in OSM and export, it's just a file called "map".
Is this the right kind of file to use, or should I use QGIS to filter and export as .OSM type file?
 
I exported the area or my geotiff and downloaded the file from OSM.org.
It's vey large at 32mb, running this example script from the guide gives an out of range error.
I can't see how to export only buildings from OSM, I guess this filters for them anyway?


ImportOGR|"F:\Airports\Tucson\Autogen\1_NA_WGS_NA_2_Map"|*|*|NOREPROJ|*|*

#
SplitGrid|AGN|building="2"
##

AddAttribute|FTYPE="POLYGON" And building="*"|Integer;BUILDTYPE|5
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FAREARAT>0.80|Integer;BUILDTYPE|1
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FNUMVERT<10 And FNUMPERPANG>3 And FNUMNOTPAR<2|Integer;BUILDTYPE|3
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FCONVEX=1|Integer;BUILDTYPE|4

AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=16|String;BUILDCAT|INDUSTRIAL
AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=15|String;BUILDCAT|COMMERCIAL

AddAttribute|FTYPE="POLYGON" And building="*" And FWIDTH>5|String;ROOFTYPE|PEAKED_ALL
AddAttribute|FTYPE="POLYGON" And building="*" And FWIDTH>5 And FLENGTH<12|String;ROOFTYPE|PEAKED_SIMPLE

AddAttribute|FTYPE="POLYGON" And building="*" And FWIDTH>20|String;ROOFTYPE|PEAKED_LOW_PITCH
AddAttribute|BUILDCAT="INDUSTRIAL"|String;ROOFTYPE|PEAKED_LOW_PITCH
AddAttribute|BUILDCAT="COMMERCIAL"|String;ROOFTYPE|PEAKED_LOW_PITCH

ReplacePolygonByBuildingRectangles|BUILDTYPE=3|0.8;4;4|0.25;2.0;0.5|Integer;BUILDTYPE|2

CreateAGNGenBuild|BUILDTYPE<3 And ROOFTYPE="PEAKED_ALL"|{c05c5106-d562-4c23-89b8-a4be7495b57c}|MAXRATIO=2
CreateAGNGenBuild|BUILDTYPE<3 And ROOFTYPE="PEAKED_SIMPLE"|{d4ee02a2-ed47-4f10-b98c-502516983383}
CreateAGNGenBuild|BUILDTYPE<3 And ROOFTYPE="PEAKED_LOW_PITCH"|{a9b0e686-0758-4294-a760-9bb4fd341621}

ExportAGN|P3D v4|"F:\Airports\Tucson\Builds\SXAD_KTUS_P3Dv5\SXAD_KTUS_P3Dv5\texture"
 
I just tried this script:
"
AddAttribute|FTYPE="POLYGON" And building="*"|Integer;BUILDTYPE|5
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FAREARAT>0.80|Integer;BUILDTYPE|1
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FNUMVERT<10 And FNUMPERPANG>3 And FNUMNOTPAR<2|Integer;BUILDTYPE|3
AddAttribute|FTYPE="POLYGON" And building="*" And BUILDTYPE=5 And FCONVEX=1|Integer;BUILDTYPE|4
#
# Remove complex buildings
ReplacePolygonByBuildingRectangles|BUILDTYPE=3|0.8;4;4|0.25;2.0;0.5|Integer;BUILDTYPE|2
#
# Create buildings autogen
CreateAGNGenBuild|building="*" And FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CreateAGNGenBuild|building="*" And FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
An unexpected error occured during running your configuration
"

Given here:
And get this error:


Error:
Index was outside the bounds of the array.

A much smaller area gives the same error:
12:25 SceneryProcessor Error System.IndexOutOfRangeException: Index was outside the bounds of the array.
at ASToFra.scenProc.Steps.SplitGrid.Process(List`1 cells, String[] arguments)
at ASToFra.scenProc.Processor.SceneryProcessor.Process()
at ASToFra.scenProc.Processor.SceneryProcessor.ProcessConfig(String filename, List`1 commands)
 
Hi,

I would start simple, if you make a script that just imports the OSM data you have saved (so only the ImportOGR step). Can you run that without any warnings in the event log? I suspect you might have an issue with the coordinates used in your file.
 
OK,
Running ImportOGR|"../filee.osm"|*|building|NOREPROJ
Works and it read 2649 files from the file.

But wont generate the building without the same error.
 
I've used Quick OSM in QGIS and imported just the buildings on a layer, but IDK how to save just those as a file type that SceneProc might use.
 
Ah yes, I just have, it seems to load ok, but I get a "
An unexpected error occured during running your configuration

Error:
Index was outside the bounds of the array."
I sent the raw OSM to Arno, hopefully he can help. Simply using this to make a gazillion autogen buildings will be great.
 
Can you show the entire log after loading just the osm data?
 
Is this what you mean by load it?
1702662830646.png
 
Yes, that looks ok. I was suspecting a warning there about weird coordinate ranges. I'll check the file later when I'm behind my PC.
 
Hi,

The problem is your SplitGrid command is invalid. The third argument is the bounding box for the area to read, while you have the filter there. So instead of:

Code:
SplitGrid|AGN|building="2"

You should use:

Code:
SplitGrid|AGN|*|building="2"
 
Thank you!
I still don't understand any of it, but it's worked and I see buildings!
So next I need to figure out how to add attributes for vegetation!
 
Which version of scenProc are you using?

You should have seen a warning in the event log like this with your script:

07:51 SplitGrid Warning Line 3: Assuming bounding box value building="2" is search string

I will modify scenProc as well so that it does not crash on such input.
 
It says 3.20 on the detail properties.
For the dumb people like myself perhaps have some example scripts that kind of work updated in the PDF?

I'd love to know how it works, how does it write the .agn files?
Does it write an intermediary xml and run it with the building positions, sizes and guids? What does it then compile through?
 
Hi,

Did you see that the manual has a complete chapter full of working samples? In these samples it is also explained what the different steps do.
 
Ok thanks, I did briefly look through it and used the sample above. It's very complex and will take a good while to get my head around it! It is fantastically powerful though!
I'm hoping to import the road/highway lines into blender, array lights along the curves and bake some night lighting into the photoscenery next.
I'll probably have to use quick OSM to filter to export them and find some way.
 
Last edited:
Another question...
I've generated more buildings, but it overlapped the last geotiff area, so there is a strip of missing buildings.
I see from the manual I can load the buildings from the existing tile so this doesn't happen, can I re-generate the same scene proc script with this added, or do I need to start again as it might double the autogen already generated?
 
Well I generated the same shp file again having loaded the agn files and the gap is filled, but unsure if the existing buildings have been duplicated.
 
Back
Top