logo separator

[mkgmap-dev] Coastline issues - analysis and possible solution

From Bartosz Fabianowski bartosz at fabianowski.eu on Mon Aug 29 20:43:33 BST 2011

> Maybe the overlap parameter of splitter prevented that because splitter
> puts all points in the tile that is either contained in the bounding box
> or contained in a overlap region with width "overlap" garmin units. If
> overlap is larger than the expansion you don't see this problem.

I investigated whether the overlap parameter could fix this. The answer, 
unfortunately, is no. This problem occurs whenever a tile is expanded, 
due to rounding, beyond the boundary of the extract being used as input 
data. Even with the overlap parameter set to a large value, there is 
simply no data in the extract for the offending region. The only way to 
get this data is to take it from somewhere else, such as a separate 
coastline file covering a larger area.

> If you go in such details I propose to make use of the GpxCreator class
> in the mkgmap source code.

Thanks for the pointer. I will use it in future investigations.

> The --coastlinefile option is a good way to be 100% sure that you get
> valid coastlines and no flooded tiles. But only if you use "confirmed"
> coastlines (so a file that is confirmed to be error free).

I will be making available daily coastline extracts from now on. I will 
not be verifying that these are error-free. They will simply be 
coastlines extracted by osmosis. If the coastlines in Geofabrik's 
europe.osm.pbf are broken, so will be those in 
coastlines_europe.osm.pbf. My aim is to make the complete European 
coastlines available as an easy download. Fixing broken coastlines is 
another issue which I am not trying to address at this time.

> You also pointed to a very big disadvantage: the memory usage is very
> HIGH, because the coastline file needs to be completey loaded in parallel.
>
> This might be fixed by adapting the bounds file algorithm to the
> coastline processing.

I have an alternative idea: As I described, the problem is that 
coastlines for part of a tile may be missing. To fix this, there is no 
need to load a complete coastline file possibly covering the entire 
planet. Only the part of the coastline file overlapping the tile is 
needed. Memory consumption could be reduced to exactly that of normal 
tile processing by parsing the input data for a tile first and then 
loading only the ways and nodes from the coastline file that fall within 
the tile's boundary. This would require a reload of the coastline data 
for each tile. Another option would be to preload the coastline data for 
the combined bounding box of all tiles to be processed.

- Bartosz



More information about the mkgmap-dev mailing list