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

Create Attribute from Values

Messages
111
Country
austria
Hi Arno,

Today I tried to create attributes from values but it didn't work as expected.

_______________________________________________________
IMPORTSHP|C:\buildings.shp|*|NOREPROJ
#
ADDATTRIBUTE|FTYPE=POLYGON|WIDTH|FWIDTH|1
ADDATTRIBUTE|FTYPE=POLYGON|LENGTH|FLENGTH|1
ADDATTRIBUTE|FTYPE=POLYGON|RATIO|FRATIO|1
#
EXPORTSHP|*|building_test
_______________________________________________________


The new created attributes have only the name as text inside instead of numeric values.
Is there any way to make this work as expected? :(

Regards,
Heinrich
 
I solved the Problem with the following script:

ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<1.0|RATIO|0.9|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.9|RATIO|0.8|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.8|RATIO|0.7|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.7|RATIO|0.6|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.6|RATIO|0.5|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.5|RATIO|0.4|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.4|RATIO|0.3|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.3|RATIO|0.2|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.2|RATIO|0.1|1
ADDATTRIBUTE|FTYPE=POLYGON;FRATIO<0.1|RATIO|0.0|1

The idea was to check the FRATIO values. It seems that FRATIO is calculated wrong.
When I have a square polygon then FRATIO is 0.6 but it should be about 1.
Maybe FRATIO is calculated with distance values in degree instead of meters.

Arno, would you be so kind and check this?

Thank you,
Heinrich
 
Hi Heinrich,

I'll check, but it should be meters.

It's probably not a good idea to use the hardcoded attributes yourself. The values you specify are ignored when using them in scenproc.
 
Hi Arno,

I didn't want to use the hardcoded values. I just wanted to be sure the values are correct.

For me it seems that the FRATIO is not correct. Simply check it by using a perfectly square object.

But if FRATIO is wrong, probably the FWIDTH and FLENGTH are wrong too.

Regards,
Heinrich
 
I will have a look.

About the special attributes that are calculated by scenproc, if you add attributes with the same name they will be ignored. Those special names are treated differently. So assigning them a value won't help.
 
No, not yet. The FSDevConf takes most of my spare time till the weekend I'm afraid.
 
Hi,

I just had a look in the code and the ratio is calculated by dividing the width and the length. Both are in meters, so that should work fine for a building that is square (in meters).

I'm not behind my FS pc now, so I can't try it with some files here myself. Do you have a sample object that should be square but is not?
 
Hi Arno,

Attached you will find testfile with 3 square objects. Two objects with 5x5 meter and one object with 10x10 meter.

The calculated FRATIO for all three objects is about 0.66!!

Regards,
Heinrich
 

Attachments

Thanks, I'll have a look.
 
Hi,

The functions to calculate the width and length were into not that good, I have improved them now.

Only for the rotated object the resulting ratio is still not 1.0, it is around 0.8. That's because all calculations for width and length (and thus also ratio and area) are done on the best fitting bounding box for the shape. But this bounding box is currently being fit in lat/long coordinates. Because that's what is used to define autogen buildings as well. If I would calculate the best fit in meters I guess the attributes get more accurate, but than the best fitting bounding box would no longer be good for the autogen. So I am a bit hesitating to change this.

Given the workflow you have, could you accept the ratio being not around 1.0 for a square object, because the best fitting bounding box is indeed larger than the square object?

The changes are NOT yet in the development release by the way.
 
Hi Arno,

Of course I will accept any improvements. As soon as you put this new calculation into the development release, I will test immediately and tell you the results.

Regards,
Heinrich
 
Hi,

I have done some more testing now and put the update in the development release. So you will find it in the build tomorrow.

The image attached shows the rotated feature. The light polygon is the best fitting bounding box in lat/long. The dark one is your original one. Are you really sure it is square? The offset is much bigger than I expect.
 

Attachments

  • poly.png
    poly.png
    9.3 KB · Views: 532
Hello Arno,

As I noticed on your picture, it seems that you are calculating distances and angles in geographic projection which is normally in degree units and in my opinion wrong for such calculations. The bounding box on your picture is deformed because the square angled corners are in fact not square.
If you look at my attached pictures you will see my 3 squares from the test shapefile in two different projections.
In UTM projection all dimensions and angles are correct, no distorted angles. You should make all your calculations in this projection system. As you can see on the other image in geographic projection, the dimensions and angles are not correct.
This seems to be the reason for the wrong FRATIO values.
I think this is an important issue because eventually this effects also other calculations for angles and dimensions in ScenProc.

Regards,
Heinrich
 

Attachments

  • UTM_projection.jpg
    UTM_projection.jpg
    90 KB · Views: 497
  • Geographic_projection.jpg
    Geographic_projection.jpg
    90.3 KB · Views: 503
Hi Heinrich,

But the autogen is also defined in degrees, that's why I am using that for the best fitting bounding box. Although I just remember that the autogen tiles are not completely square in size, maybe that deformation is enough to compensate for this offset. Let me give that a try tonight.
 
Hello Arno,

Here is another example of the issue. The object in the center of the attached picture is one Long building and is converted into 5 seperate objects by ScenProc with the option MAXRATIO. As you can see the objects are not well alligned, so I think the calculated orientation seems to be wrong.

You are right, the autogen tiles are square, BUT NOT the Content, it is deformed, depending on the latitude.

Regards,
Heinrich
 

Attachments

  • allignment.jpg
    allignment.jpg
    405 KB · Views: 537
Hi,

I think that's probably the same issue. Let's see.

The imagery is indeed deformed based on latitude. But autogen objects are always defined in degrees, not in meters.
 
Hi,

By taking the difference in X and Y size of the autogen cell into account things end up a little bit better. But I am still not 100% satisfied with the result. Like you mentioned with buildings that are divided into parts there is still some offset. I'll have a look at that.
 
Hi,

I had another look at the MAXRATIO issue. When I check the autogen in Annotator the different objects align perfectly. But when you look in FSX the different buildings indeed seem a little bit rotated and don't align perfectly.

Do you see the same kind of behaviour?
 
Back
Top