mapsforge / vtm

OpenGL vector map library - running on Android, iOS, Desktop and browser.
GNU Lesser General Public License v3.0
269 stars 89 forks source link

Triangulation issues since release 0.18 #1097

Closed dnesbitt61 closed 3 months ago

dnesbitt61 commented 8 months ago

With Mapsforge VTM releases 0.18, 0.19, and 0.20 I am seeing triangulation issues with multiple map files. We develop on Android so the screenshots below are from an Andoid app. We have maryland.map and pennsylvania.map data loaded. This data was generated over a year ago, and we noted these issues when trying to upgrade to the latest VTM library. Checking versions we found proper rendering using version 0.17, but from 0.18 onwards we see issues. Images below compare an area near Perryville, Maryland. Land/sea triangulation appears, but also we see issues with

With 0.17: mf017 aberdeen0_17

With 0.20 (similar with 0.18 and 0.19): mf020 aberdeen0_20

devemux86 commented 8 months ago

@dnesbitt61 what do you mean with "triangulation"? For users not familiar with this map area, can you point what is wrong and how it should be rendered?

Or do you mean overlapping map files? This is an OpenGL case and before there was an issue with e.g. same lake existing on overlapping map files.

There was a fix for overlapping maps in VTM 0.18, see:

There is also an open issue about overlapping regions in the same map:

dnesbitt61 commented 8 months ago
          what do you mean with "triangulation"

I have been assuming that the issues I see are due to how polygons get converted into triangles. I am assuming that this is done within VTM since OpenGL can only render triangles. I could be wrong (not sure if you store polygons or triangles in the .map file - e.g. split polygons into triangles at run time or during data creation).

I see issues starting with 0.18. I tried attaching a video showing how areas change - with different triangle cutouts and such but the videos are too large. Here is another image comparison with maryland.map and pennsylvania.map loaded. See the large triangular parts of land that cut out into the Chesapeake Bay.

vtm0_18

With 0.17: vtm0_17

devemux86 commented 8 months ago

@dnesbitt61 I cannot reproduce it with Cruiser with latest VTM, default themes and maps from Mapsforge.

In your themes use the "mesh" just for land / sea, because it can cause artifacts in other areas.

Note: Mapsforge format is not related with the OpenGL or software rendering. Map engines read the data and render them using the rules of each engine.

dnesbitt61 commented 8 months ago

Should I expect Mapsforge/VTM versions to be backwards compatible? Specifically, should a newer version of the library work with prior versions of data, or do I need to generate new data (with compatible version of mapwriter) when we update the Mapsforge/VTM library? I am seeing these artifacts when using version 0.18 with older data. No artifacts with 0.17 on Android with the same data. I see no differences when I use a style file with only nosea and issea|sea with mesh="true" (compared with mesh="true" for all area features).

devemux86 commented 8 months ago

All libraries are constantly being improved and being open source, everyone can contribute. :slightly_smiling_face:

We cannot know your maps / themes, but the tests are made with available Mapsforge maps and the themes in library. In the above links there are details for the changes and why "mesh="true" for all area features can lead to artifacts.

Working good on one map does not make it a good choice if it does not work in other maps and produces a lot of GL warnings / errors in the log.