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

shapefile with holes (islands) in it

Messages
111
Country
austria
Hello Arno,

I want to convert shapes of woodland to AGN but the shapefiles have lots of holes (clearances in the wood) which results in strange overlapping parts in the resulting AGN file.
Is it possible from your side to convert these kind of shapefiles correctly or is it neccessary to split (unhole) the polygons before feeding them to ScenProc?
Do you have any idea which program can do such splitting?

Is there any limitation in number of shapes or size (vertex count)?

Best Regards from Austria
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi,

At the moment scenproc can not handle shapefiles with holes correctly, it's on my todo list to see if I can fix that. So for now you'd better process the files first.

I am not aware of a limit to the amount of vertices.
 
Messages
111
Country
austria
Luckily GlobalMapper can "unhole" shapes very easy. I attached a screenshot where you can see that ScenProc has still problems with such cut-out polygons.
Some "holes" seems to be rendered properly but some others are not.

ScenProc is such a really great tool for converting my vegetation files to autogen, maybe you could take a peek look on this issue.
I can provide you all the source files if you need for testing.

Best Regards,
Heinrich
 

Attachments

  • compare01.jpg
    compare01.jpg
    535.2 KB · Views: 454

rhumbaflappy

Administrator
Staff member
Resource contributor
Messages
4,651
Country
us-wisconsin
Hi Heinrich.

A bit off topic, but how do you use Global Mapper to unhole? That would be a very useful thing for FS9 as well as for scenproc.

Dick
 
Messages
111
Country
austria
This information comes directly from the user manual (sometimes reading really helps :) )
--------------------------------------------------------------------------------
Converting Areas with Islands to Single Vertex List
If one or more area features with separate islands/holes within them are selected, the Create Single Vertex List Area From Selected Area(s) With Islands option will appear in the Advanced Feature Creation sub-menu of the right-click menu. When selected, this option will connect all of the islands/holes within the selected parent areas into a single vertex list and replace the original parent/island area with a new area that contains just that single vertex list. This is useful for converting areas with islands into a form that software that cannot handle areas with holes can make use of.


--------------------------------------------------------------------------------

Best Regards,
Heinrich
 
Messages
111
Country
austria
Arno,
Do you think you can take a look at the issue with the holes earlier in this thread?

Regards,
Heinrich
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi,

It is on my todo list for scenproc, but I haven't had much time recently to work on it. I am also not sure how easy it will be to implement, since the internal representation of polygons in scenproc does not know about holes either.
 
Messages
111
Country
austria
Arno,
there are no holes in my shape file anymore, I removed them with GlobalMapper by cutting the holes and connect them with the polygon but as you can see on the comparision screenshot of GlobalMapper and TmfViewer, converting convex shapes seems to be an issue in some cases.
_______
Heinrich
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi,

Ah sorry, I missed that other question.

I think that is a limitation of fsx. To work around it the complex polygons would have to be split I think.
 
Messages
111
Country
austria
Hello Arno,

I did some investigation on the issue with the mixed up AGN files produced by ScenProc and it seems that the splitting algorythm is a little buggy in some special cases.
First I attached two screenshots of a tiny shapefile. As you can see on the first image from GlobalMapper the shapefile is not that complicated and has only one inner part. On the second image, showing the resulting AGN-file in TMF-Viewer, the inner part is simply ignored and still filled with vegetation, eventually the vertex leading to the cut-out are too close to each other.

I attached another screenshot where you can see another issue with one tile completely ignored. Maybe both issues comes from the same bug.

I also attached the shapefile from the first example, I hope you can help.

Regards,
Heinrich
 

Attachments

  • screen_002.jpg
    screen_002.jpg
    77.6 KB · Views: 437
  • screen_001.jpg
    screen_001.jpg
    122.4 KB · Views: 453
  • screen_000.jpg
    screen_000.jpg
    254.4 KB · Views: 472
  • shape_test.zip
    1,022 bytes · Views: 220

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi,

Thanks for the sample, I'll use it while debugging the issue with the holes.
 

Horst18519

Moderator
Resource contributor
Messages
2,343
Country
germany
On another note, Heinrich, did you find that the results in FSX fit your annotations in the Annotator? I wasn't happy with that for my current project, so I did some more SDK reading and found something interesting on this:
You need to increase the image_pixels value:
(default is 16, but the line is missing in the default fsx.cfg, so if you want another value, you need to add the line)

Code:
[TERRAIN]
...
IMAGE_PIXELS_FOR_AUTOGEN_POLYGONS=256

Explanation:
FSX does not use vectors to place vegetation polys, it processes those vectors into 1-bit images. Obviously, a 16x16 pixels image will not show a precise result of complex vegetations polys on a 1024x1024 landclass texture.
The higher the image_pixels value, the more precise the result, but of course this will hit your framerate. I found 256 to be a good compromise between precision and performance.

Maybe you already know this, just wanted to share this with others interested in that kind of AGN development.

EDIT: Make sure you also include this in the user manual. The user has to include that line in his FSX.cfg as well to get the same results.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi Heinrich,

Not yet, I have been away for business in the last two weeks. But during that period I had a first look at reading OSM files with holes. From what I learned there adding support for shapefiles with holes should be possible later as well. I still have to test the issue you had with annotator not showing the right polygon. I expect to run into that as well.
 
Messages
111
Country
austria
Hello Arno,

I did some more investigation on the issue with wrong decoding of shapefiles (img 1). It seems that scenProc is optimising or reducing vertex when decoding.

When I manually shift the vertexes (img 2) which are on the same position away from each other, your algorythm works correctly (img 3).

Regards,
Heinrich
 

Attachments

  • screen_001.jpg
    screen_001.jpg
    122.4 KB · Views: 408
  • hole02.jpg
    hole02.jpg
    126.7 KB · Views: 347
  • hole01.jpg
    hole01.jpg
    224 KB · Views: 415
Messages
111
Country
austria
Hello Arno,
This issue still exists on build 353 from yesterday. Maybe you can cast an eye on this?

Merry Christmas to you Arno :santahat:
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
30,551
Country
netherlands
Hi,

I don't have your photo scenery here of course, so I can't test it in Annotator or FSX. But what I did is load your SHP file in scenProc, then use the splitgrid step and then export the result as SHP again.

What I see then is that there are two polygons and the hole is still represented correctly. Based on these polygons the autogen files would be written. So it might be that FSX / Annotator does not like polygons that have touching edges. That is often considered to be a faulty polygon.

Not sure how I can test that further now. But I might be able to widen the gap in the tool to work around it.
 
Messages
111
Country
austria
Hello Arno,

I did the same and you are right, sorry but I had no idea that scenProc would be able to export shapefiles.
So maybe it would be possible for you to work around this problem by widen the gap as you mentioned.

Regards,
Heinrich
 
Last edited:
Messages
111
Country
austria
Arno,
I did the same now with a bigger shapefile and there are still some glitches in the resulting shapefiles. If you export the shapes with scenProc you will notice some wrong or doubled polygons, mostly when they are not touching the surrounding AGN border. I attached the source shapefile.

Regards,
Heinrich
 

Attachments

  • kmv50_woodland.zip
    102.9 KB · Views: 221
Top