Hi Ticker,

I can track down the OutOfMemoryError to java-1.8.0.

java 1.8.0.492 runs either out of memory or hangs for days in an endless loop.
java 1.8.0.482 works fine.

Did took some time to me to find out that this is the real culprit, there were too many variable data in the game.

To reproduce:

Download the shapefile for WGS84 from https://osmdata.openstreetmap.de/data/land-polygons.html

And run:
mkgmap_sea_generator land-polygons-*/land_polygons.shp WGS84 sea-test

mkgmap_sea_generator is a wrapper script:
/usr/lib64/jvm/jre-1.8.0-openjdk//bin/java -Xmx8192M -cp /usr/share/java/mkgmap.jar:/usr/share/java/mkgmap-SeaGenerator/splitter-412.jar:/usr/share/java/mkgmap-SeaGenerator/commons-pool.jar:/usr/share/java/mkgmap-SeaGenerator/gt-api.jar:/usr/share/java/mkgmap-SeaGenerator/gt-cql.jar:/usr/share/java/mkgmap-SeaGenerator/gt-data.jar:/usr/share/java/mkgmap-SeaGenerator/gt-main.jar:/usr/share/java/mkgmap-SeaGenerator/gt-metadata.jar:/usr/share/java/mkgmap-SeaGenerator/gt-opengis.jar:/usr/share/java/mkgmap-SeaGenerator/gt-referencing.jar:/usr/share/java/mkgmap-SeaGenerator/gt-shapefile.jar:/usr/share/java/mkgmap-SeaGenerator/jsr.jar:/usr/share/java/mkgmap-SeaGenerator/jts.jar:/usr/share/java/mkgmap-SeaGenerator/vecmath.jar uk.me.parabola.mkgmap.sea.optional.PrecompSeaGenerator "$@"

mkgmap.jar is build with SeaGenerator enabled following the mkgmap documentation.


For the "land-only tile is flooded" problem: I cannot reproduce that since I didn't saved the that state of the OSM data and the people currently break the coastline faster than other can repair them :( But with the latest land polygons this did not show up, but the land polygons are not correct due to the broken coastline...

Regards,
Thorsten


Am 2026-06-28 21:19, schrieb Ticker Berkin via mkgmap-dev:
Hi Thorsten

If you send me details about your procedures/scripts... that produced your last working sea.zip and how/where to get the latest base data to run it on I'll have a go at running it and see if I can diagnose the OutOfMemoryError you reported on 28th May.

I don't want to try varying the procedure yet.

I used to understand the sea generation logic within a tile when not using sea.zip and the things that went wrong when bits of coastline were missing, crossed, in the wrong direction or applied incorrectly, but haven't tackled sea/optional/PrecompSea{Generator/Merger/Saver}.java

Ticker


On Sat, 2026-06-27 at 18:17 +0200, Thorsten Kukuk via mkgmap-dev wrote:

Hi,

I finally found a solution for the heap overflow errors when using the
mkgmap SeaGenerator, seems a combination of several security updates
including java.
I have now a container with a software combination which works with old
land_polygons.shp files, but not with new ones.

If I use the land_polygons.shp file from OSM mkgmap SeaGenerator seems
to be stuck somewhere in an endless loop, it doesn't seem to do
anything.
With my own generated ones, I get:

SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 48.867188,83.320313, index key is
2260992_3866624
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 48.164063,83.320313, index key is
2228224_3866624
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 48.164063,84.023438, index key is
2228224_3899392
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 47.460938,84.023438, index key is
2195456_3899392
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 47.460938,84.726563, index key is
2195456_3932160
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 46.757813,84.023438, index key is
2162688_3899392
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 46.757813,84.726563, index key is
2162688_3932160
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 46.054688,84.023438, index key is
2129920_3899392
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 46.054688,84.726563, index key is
2129920_3932160
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 45.351563,84.726563, index key is
2097152_3932160
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 44.648438,84.726563, index key is
2064384_3932160
SCHWERWIEGEND (SeaGenerator): Precomp sea data seems to be wrong,
land-only tile is flooded around 43.945313,84.726563, index key is
2031616_3932160

If I load the land_polygons.shp file, everything is fine. This tile is
land only, no sea. Same for all tiles around this tile. The OSM data
does not contain any coastline in this tile and the tiles around, too.

Any ideas what's still wrong here?

AI claims this:
   Here's what's happening:

   1. PrecompSeaMerger processes your land polygons from the shapefile
   2. If a tile has no land polygons intersecting it, the merger creates
a sea polygon for that tile (line 159)
   3. This sea polygon is returned with just one way tagged as
natural=sea
   4. PrecompSeaSaver receives this single sea way and writes it to the
index as "sea" (line 108)
   5. The reference file (sea-check.txt) expects this tile to be land
('l')
   6. This causes the mismatch error

   Why This Happens

   The logic assumes that if no land polygons from the shapefile
intersect a tile, the tile must be sea. This is WRONG for interior
continental areas far from any coastline!

   A tile can have:
   - No land polygons intersecting it (because the shapefile only
contains coastal land polygons)
   - AND still be a land tile (because it's in the interior of a
continent)

   The shapefile likely only contains land polygons near coastlines, not
complete continental coverage. Interior tiles (like the one at
48.867188,83.320313 in Kazakhstan) have no polygons in
   the shapefile, so the code incorrectly marks them as sea.

   Solution

   The code in PrecompSeaMerger.java needs to be fixed to handle the case
where a tile has no intersecting polygons.


Does this make sense to anybody?

Thanks,
Thorsten
_______________________________________________
mkgmap-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo/%(_internal_name)s
_______________________________________________
mkgmap-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo/%(_internal_name)s
_______________________________________________
mkgmap-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo/%(_internal_name)s

Reply via email to