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

MSFS20 Placing same object with vector points across an entire country

Messages
216
Country
unitedkingdom
I hail from the FS9, FSX & P3D era. I've barely scratched the surface with MSFS 2020 development. I'm an experienced GIS practitioner who uses Shapefiles all the time.

I've seen MSFS 2020 freeware addons which place the same object thousand of times across entire countries/regions, such as mamu82's Default Wind Turbine replacement. In a similar vein I have a single object I'd like to use to populate an entire country. I've done this successfully in the previous sims using shp2vec, with GRS coordinates (Lat/Long with reference to WGS84 ellipsoid and geoid, IIRC). Shapefiles are no longer a requirement for MSFS 2020, but according to the SDK Documentation they can still be used. I have some questions I need help with please...
  1. How does one process an entire country/region at once (it was no problem shp2vec!), if what I've read about a limiting size/range (20 miles?) being designed into the SDK is correct?
  2. What EPSG is used for vector objects in the SDK?
  3. How are object rotations defined (not something I ever dealt with my object in the previous sim, as I simply had them all facing the same direction)
  4. Is any of the above documented somewhere?
Many thanks in advance

Andy
 
Hi Andy,

thansk for the heads up,

this is how to place an object in msfs

XML:
<FSData version="9.0">
    <!--SceneryObject name: Car01_Yellow-->
    <SceneryObject parentGroupID="8" groupIndex="1" lat="70.86970059912032" lon="29.02949597342542" alt="0.00000000000000" pitch="0.000000" bank="0.000000" heading="167.000010" imageComplexity="VERY_SPARSE" altitudeIsAgl="TRUE" snapToGround="TRUE" snapToNormal="FALSE">
        <LibraryObject name="{0BDAA1CC-0EA6-4D46-BD1A-E99ABFC009B8}" scale="1.000000"/>
    </SceneryObject>
    </FsData>


for each object, you need to provide latitude, longitude, altitude (if needed), pitch, bank and heading

over and over and over

that's pretty much all :D

well, it isn't, I have give a longer explanation in this 3d in the avsim forums



Some clarifications:
- my windturbine addon doesn't place them, is a simple replacement of the default Asobo model :)

- The MSFS SDK has no proper vector "objects", every vector stuff is really related to terrain, not objects. Recently , a Vectoplacement tool has been introduced, but is really "place objects along a line tool"

- All coordinatetes in the MSFS world are WGS84 , so 4326 epsg afaik


The SDK is not shipped with tool for mass placement, you need to write your own script specific for your needs.
Your task is quite easy, acquire the coordinates of the object from whatever source (maybe an overpass query), save to any format,
an do a for loop writing for each object the code above to a text file, save as xml, put in msfs project, compile, and the package is ready :D

obviously, if you need to make some "more fancy" stuff, like powerlines, marinas, project lifts and solar farms, than you have to play a lot
with the gis software to obtain the coordinates list for the script :)
(and those addons are placing millions of objects :P )


there is not a easy recipe for everything, like you said, rotation can be a really headache, depending on the objects you want to place

Hope that helps, and glad to help if you have some specific idea!
 
I'm very grateful for your very informative reply Mamu! :)👍👍

It is great to know that GRS (EPSG: 4326) is still in use for vector data, so I don't need to re-project.

Have you ever encountered any issues with a maximum extent which can be processed?

I already have the coordinates for the object placement and had everything set up as shapefiles (and accompanying XML) for FSX/P3D, which worked very well back-in-the-day. Given the MSFS 2020 SDK still uses shapefiles ("vector data is saved in the form of shapefiles ( *.shp)" and "are compiled to *.bgl files using the BGL compiler invoked by the Package Tool", plus "*.xml and shapefiles compilation to *.bgl files is similar to how the FSX assets pipeline worked") and the fact I also made polygons buffered around the points, to extrude everything with a small radius of the object (I forgot to mention this in my original post), I'm more inclined to proceed with this route. The documentation states "*.xml and shapefiles compilation to *.bgl files is similar to how the FSX assets pipeline worked. The file formats are similar but have been extended with new features.". This sounds good, but I'd like to know more in terms of what is different and what has been "extended", but I've yet to find any specifics. Is this just a case of incomplete documentation? Are there any other sources of information? Has anyone out there successfully used their FSX/P3D shapefiles + XML in the MSFS 2020 SDK?

Many thanks again :)
 
No problems with the extent, my addons covers the entire world, and some bgls are across half of the globe 🌎

(I just don't understand how the shapes can help you with your objects, the vector (.shp family) feature are used only for vegetation, building exclusions and other minor terrain feature)

Here is some useful documentation/process


But I really advice to take the plunge and discard the idea of working with shapefiles inside the sim
Asobo is famous to change stuff from time to time, a maybe the .shp support can end at anytime (e.g. they already changed the needed dbf attributes )

I've already fixed my scripts to convert the shp to the .xml format , and is faster that the method explained above, simply export the shp geometry as wkt coordinates and let the script write the XML for you
The xml way is way better cause you have full control per each polygon feature

(E.g. the .shp doesn't allow mixing building and vegetation)
 
I take it back! :oops: I went and looked again at what I did years ago for FSX/P3D and indeed the Shapefile wasn't used to place the object! It was used to re-project the data to WGS84. However, my memory wasn't entirely playing tricks on me, in that I did use another Shapefile (with shp2vec) to place the thousands of small Exclusions (http://www.prepar3d.com/SDK/Environment Kit/Terrain SDK/Terrain and Scenery.html#The Shp2Vec Tool) I'd made by buffering around each point.

So, I will indeed need to use XML (whether for both, or just for the point locations) :)
 
So, I will indeed need to use XML (whether for both, or just for the point locations) :)

For Polygons, not necessarily; for Points, possibly, but I anticipate there may be a way to utilize SHP files for placement as well. ;)


ESRI Shape files use "Attributes" and a defined range of 'Values' just as MS-FS XML files use Elements with "Parameters" and 'Values' as defined in a Schema.

https://www.google.com/search?client=firefox-b-1-d&q=ESRI+SHP+Attribute

https://www.esri.com/news/arcuser/1002/files/table_2.pdf


One can make a *.SHP file in any GIS-enabled application / utility, then add / edit a list of MSFS' "Attributes" and associated 'Values' in that same app.


Also, a Polygon *.SHP file output by SBuilderX (intended for a FSX/P3D CVX BGL via SHP2VEC), can be used as a basic "primitive" in MSFS SDK DevMode.


As one assigns Polygon Properties to a MS-FS Polygon*.SHP file "primitive" in MSFS SDK DevMode, any required "Attributes" / 'Values' are added / edited.


This allows one to utilize vast resources of world GIS data to create terrain scenery etc., then prepare it for "import" and final edits via MSFS' DevMode GUI.

https://www.fsdeveloper.com/forum/threads/having-trouble-creating-shp-file.456127/post-908501.


Some may prefer XML, but IMHO, ESRI SHP files are an industry standard; efforts to eliminate them may be anti-competitive to 3rd party MSFS Developers.

GaryGB
 

Attachments

  • 1673795738236.gif
    1673795738236.gif
    42 bytes · Views: 158
  • 1673795738192.gif
    1673795738192.gif
    42 bytes · Views: 159
Last edited:
Back
Top