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

Using USBuildingFootprints P3D V5

Messages
28
Country
australia
Hi,

I am trying to make some autogen using Microsoft USBuildingFootprints using geojson files converted to shape files. I have successfully made the photoscenery tiles using this program https://github.com/stackTom/Ortho4XP_FSX_P3D and they show in P3D V5.

The program above makes tiles in a 1 degree lat x 1 degree long area. The tile in question is one with the bottom left corner at 40.0 N, -112.0 W. So the top right corner is at 41 N, -111 W. The tile includes a large part of Salt Lake city in Utah.

I looked at OSM data but it is very sparse in the USA and I can get autogen using OSM for Salt Lake City, but two thirds of the city is missing buildings.

I downloaded a geojson file for the whole state of Utah from here https://github.com/Microsoft/USBuildingFootprints and loaded it into QGIS and exported it to a shape file.

The shape file shows all the building footprints in Utah in QGIS, but the geojson file is nothing more than a heap of polygons without any attributes but we know they are all buildings.. The geojson file looks like this....

Code:
{
  "type":"FeatureCollection",
  "features":
  [
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-113.539195,41.960749],[-113.539123,41.960749],[-113.539123,41.960818],[-113.539195,41.960818],[-113.539195,41.960749]]]},"properties":{}},
    {"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-113.281561,41.977923],[-113.281499,41.977912],[-113.281481,41.977968],[-113.281543,41.977979],[-113.281561,41.977923]]]},"properties":{}},

At this stage I am trying to show any autogen at all on my tile with a very, very basic script as shown below but everything I try shows no autogen.

The script (see below) creates around 2,000 agn files and I have placed them all in a texture folder in along with my scenery folder but no autogen shows. The autogen files range from 64kb down to 1 kb in size.

For the script, I have included a bounding box which is the same size as my tile as I don't need the whole of Utah.

I have used a random guid roof type as an experiment -( I have reported some issues with P3D V5 not showing guid rooftypes in this thread https://www.fsdeveloper.com/forum/threads/prepar3d-v5-support.447308/.)

Some questions:

Does the script look OK ?

Do I have the bounding box coordinates correct ?

How do I split the grid if there are no properties labelled as buildings in the shape file ?

Why do I get no autogen showing in P3D V5 ?

Do you have any suggestions on how to cater for large and small building footprints as many of the polygons are large industrial type building as well as small houses.

Code:
ImportOGR|C:\Users\Zap\Desktop\ut\UtaShp.shp|-112.0;-111.0;40.0;41.0|*|NOREPROJ

SplitGrid|AGN|*|building="*"

CreateAGNGenBuild|*|{d4ee02a2-ed47-4f10-b98c-502516983383}|MAXRATIO=2

ExportAGN|FSX|C:\Users\Peter\Desktop\NewFolder



Also, the script below is one used successfully with OSM data from the Ortho4P3D program to create autogen for the tile, but it is very sparse...

Code:
# Credit to Harry Otter for the default ScenProc script!
IMPORTOGR|@0@|*|building;landuse;natural;leisure|NOREPROJ
#
SplitGrid|AGN|*|building="*"
#
SETAGNBUILDINGHEIGHT|*|1.0;0.5;0.0;0.0
#creation de la vegetation
CreateAGNPolyVeg|FTYPE="POLYGON" And landuse="forest"|{0053b63d-b2c0-4bd9-9853-d9d21c9ad1fa}
CreateAGNPolyVeg|FTYPE="POLYGON" And natural="scrub"|{2fde0277-1697-4dab-b481-c3985c80596f}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And landuse="orchard"|{56a4998d-c1e5-416c-a37b-c35ce16504b6}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And landuse="conservation"|{bc6396b0-6e51-4a4f-ab4f-5386c84609a6}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="wood"|{dcf543b7-c0d5-4fd4-b970-83965c2911c9}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="nature_reserve"|{82f0282d-f82d-484c-a640-aac21a69be03}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="garden"|{2368c260-177d-4af7-94d4-da882778108f}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="tree"|{7dc6ef4e-92a5-4d0d-b94b-212dd1fa936d}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="tree_row"|{a4a30975-075c-49ec-87fb-7e0931cb5004}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And natural="wetland"|{89ed8548-e54f-40ef-9837-7653885d409c}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="park"|{e04669c0-9f7b-42e8-a2c7-eee870c59d8e}
CREATEAGNPOLYVEG|FTYPE="POLYGON" And leisure="golf"|{2fbf9f8d-6ba2-4cc1-8d8e-af218f65d0e8}
# Add attribute to indicate the type of building
# 1 = ALMOST RECTANGLE (BASED ON AREA RATIO)
# 3 = REGULAR SHAPED (MANY PARALLEL EDGES)
# 4 = CONVEX POLYGONS
# 5 = CONCAVE POLYGONS
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
# Classify industrial/commercial buildings
AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=16|String;BUILDCAT|INDUSTRIAL
AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=15|String;BUILDCAT|COMMERCIAL
# Add attribute for roof type
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
# Remove complex buildings
ReplacePolygonByBuildingRectangles|BUILDTYPE=3|0.8;4;4|0.25;2.0;0.5|Integer;BUILDTYPE|2
# Create buildings autogen
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}
#
CreateAGNGenBuild|building="*" And FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CreateAGNGenBuild|building="*" And FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}
#
EXPORTAGN|FSX|@1@
 
Last edited:
Hi!

Well, I think that's the problem:
ImportOGR|C:\Users\Zap\Desktop\ut\UtaShp.shp|-112.0;-111.0;40.0;41.0|*|NOREPROJ

How should ScenProc know in which spatial reference system the input data layer is present?
In which reference system is the shapefile available? Have you defined a projection in GIS?

You could try "AUTODETECT" instead of "NOREPROJ"...
 
Thanks Mattias,

From the Microsoft website:

What is the coordinate reference system?
EPSG: 4326

I have tried AUTODETECT as well. Still no autogen showing.

Do I have the bounding box correct ?
 
When converting the geojson to a shapefile, which reference system did you use?
Open up the shapefile in QGIS, make a right-click on the layer - Properties - Information.
In the first block, you will find the line "KBS EPSG: xxxx"
What's the xxxx?
 
4326 should be ok...
The bounding box looks also good.

What how did the output of ScenProc look like?
 
Annotation 2020-05-06 161311.jpg
 
Well, it created the buildings and saved it to the agn-files.

You have the photoscenery in the scenery-folder, and the agn-files in the texture folder?
 
I also have this scenery at the very top of my scenery list above ORBX. I can see the photoscenery but no autogen.

I have also tried loading it in P3D V4 and no luck.
 
Hm, try the following:
rename the folder "ADDON_SCENERY" to for example "Utah". Move it to your P3D-root -> "Addon Scenery"-folder
Then add the folder "Utah" to the top your scenery library.

I also had such a problem a few weeks ago, when another scenery excluded the autogen...
Try do deactivate all other sceneries in you scenery library...
 
No luck. I did what you suggested see below...

All other ORBX sceneries were disabled

Also, I have successfully made autogen from OSM data and it shows in P3D V5 from the location.. G:\O4P3D\O4P3D\Orthophotos\+40-120\+40-112\NAIP_17\ADDON_SCENERY

Annotation 2020-05-06 164147.jpg
 
Hi,

The script and event log looks OK. So you might want to try a different roof GUID, maybe the one you used has issues.

And in the SplitGrid step the building="*" can be replaced by * as well, since there is no building attribute. This will prevent that buildings are split in two on the edge of tiles.
 
Hi Arno, I tried changes to SplitGrid and a different roof GUID but no success...

ImportOGR|C:\Users\Peter\Desktop\ut\UtaShp.shp|-112.0;-111.0;40.0;41.0|*|AUTODETECT

SplitGrid|AGN|*|*

CreateAGNGenBuild|*|{f0ea2a86-da5f-11de-8a39-0800200c9a66}|MAXRATIO=2

ExportAGN|FSX|C:\Users\Peter\Desktop\texture4
 
Hi Arno, is there a way you can test this for me ? Here is the shape file I am using...

I can see Autogen created with OSM data no problem in both V4 and V5.... It's just the shape file approach that is not working.

Alternatively, do you have a shape file (with no object properties) and script you know works ?

 
Hi,

If you use the same script and same roof GUID with OSM data the buildings do show?

In that case the roof GUID is probably not the problem.
 
Hi Arno, is there a way you can test this for me ? Here is the shape file I am using...

I can see Autogen created with OSM data no problem in both V4 and V5.... It's just the shape file approach that is not working.

Alternatively, do you have a shape file (with no object properties) and script you know works ?


I can't check the SHP file, since the DBF and SHX files are missing.
 
Here is what I get with the script below using OSM data...

Script is below photo...

2020-5-6_22-23-40-586.jpg


ImportOGR|G:\O4P3D\O4P3D\OSM_data\+40-120\+40-112\scenproc_osm_data\scenproc_osm_data0_1.osm|-112.0;-111.0;40.0;41.0|building;landuse;natural;leisure|NOREPROJ
ImportOGR|G:\O4P3D\O4P3D\OSM_data\+40-120\+40-112\scenproc_osm_data\scenproc_osm_data0_2.osm|-112.0;-111.0;40.0;41.0|building;landuse;natural;leisure|NOREPROJ
ImportOGR|G:\O4P3D\O4P3D\OSM_data\+40-120\+40-112\scenproc_osm_data\scenproc_osm_data0_3.osm|-112.0;-111.0;40.0;41.0|building;landuse;natural;leisure|NOREPROJ

SplitGrid|AGN|*|building="*"
#
SETAGNBUILDINGHEIGHT|*|1.0;0.5;0.0;0.0

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
# Classify industrial/commercial buildings
AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=16|String;BUILDCAT|INDUSTRIAL
AddAttributeIfInside|FTYPE="POLYGON" And building="*"|LUCODE=15|String;BUILDCAT|COMMERCIAL
# Add attribute for roof type
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
# Remove complex buildings
ReplacePolygonByBuildingRectangles|BUILDTYPE=3|0.8;4;4|0.25;2.0;0.5|Integer;BUILDTYPE|2
# Create buildings autogen
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}
#
CreateAGNGenBuild|building="*" And FWIDTH<20|{5ae04eb6-934c-4f63-bb48-5e7dee601212}|MAXRATIO=2
CreateAGNGenBuild|building="*" And FWIDTH>20|{6089A0BD-CED1-4c47-9A9E-64CDD0E16983}

ExportAGN|FSX|C:\Users\Peter\Desktop\osm
 
Back
Top