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

Align library objects

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
34,546
Country
netherlands
Imagine you have some vector data of gas stations and you want to use that to place autogen library objects. But your vector data only contains the location of the gas stations and no information about the heading at all. How to place these objects realistically in your scenery?

I have added a new step to scenProc last week already that helps in this situation. With this new step you can add a heading attribute to such features. And the heading will be derived from the direction of the nearest line to the point feature. So for the example here, that means you will align the gas station objects with the nearest road. That’s exactly what you want!

The small scenProc configuration below shows the basic usage of this new command:

IMPORTOGR|roads.shp|*|*|NOREPROJ
IMPORTOGR|gas_station.shp|*|*|NOREPROJ
#
HEADINGFROMNEARESTLINE|FROMFILE=gas_station.shp|FROMFILE=roads.shp|HDG
#
SPLITGRID|AGN|*
#
CREATEAGNLIBOBJ|FROMFILE=gas_station.shp|{117278df-5ce4-4765-8369-02dd363b08db}|HDG|0|18;2

You might notice I put the HEADINGFROMNEARESTLINE step before the SPLITGRID step. I did that on purpose, because the step only looks for lines within the same cell. So if you first split the objects, it might be that the closest line is not in the same cell anymore and you get the wrong heading.

And below is a picture to show it really works. In this blog post I have been talking about gas stations only, but I’m sure you can imagine many other types of objects that will benefit from this.

gas_station.jpg


Continue reading...
 
It's great, Arno. I saw it in the new documentation and tried it out - worked a treat except I noticed quite a few objects still slightly angled from what I thought should be the nearest line. I'd put the step AFTER SPLITGRID! Didn't realize it needs to be before!
It's a very useful addition. Definitely recommend taking a look at it.
Thank you!
 
Yesterday I also fixed a small bug in the heading. So if you try with today's development release it should be better.
 
:)

Are you a myth .... Arno had already laid the petrol pumps in the past
as you experiment and I had talked about, the problem was precisely the
direction or HDG, with this device you solved your issue.

At this point I believe that the transfer could also be used for other items such as:
churches, schools and everything that comes to mind ....

Thanks Arno, now I can start to experiment ...

Antonio.
 
Old thread but relevant I think to my question. What happens if the object is on a corner of two streets that intersect? Many gas stations are on corners. I take it, it will line up to whichever street is closest to the object? Haven't tried it yet but plan to so thought I would just ask.
 
Yes, it will align with the street that is closest.
 
Hello Arno,

I have been using succesfully this step to place gas stations and churches (both types depending on the size of the footprint).

I have noted that the agn library contains also other objects that could be placed into the scenery depending on the size of their footprints - namely urban buildings and warehouses.

That leaves me with a question whether an alignment of the object could be done not only on the nearest line but also on i.e. the longest side (basically length) of the underlying footprint?

Thanks

Milan
 
Hi,

I have an updated planned to place the library object based on a polygon, instead of a point. That would make that much easier.
 
"I have an updated planned to place the library object based on a polygon, instead of a point. That would make that much easier."

I noticed this thread from about a year ago. Any update on this planned feature? Would really like to test this out based on a poly. Exactly what I am looking for.
 
Hi,

I have this update almost ready, it's in a development branch at the moment and being tested. But I gave some of the other 2.0 features priority recently. I'll try to get it released soon, since I think it's an improvement in general.
 
Back
Top