@ all: I need an algorithm that uses a list like below and fills
"the rest of planet" with a small number of rectangles. There is
no need to find the smallest number, but the result should be
near.
Another idea:
detect problematic polygons or read problematic-polygons.txt
read relations and copy with way-ids and node-ids to RAM
read ways and copy node-id to RAM
read nodes
is node in tile X?
check in RAM: does this node belong to a way or relation?
save this info somewhere (so you know, which ways and
relations should be written to a tile X and which way/node-ids are
missing)
read nodes again
is node in tile X?
write to tile X
is node missing in tile X?
write to tile X
read ways
should it be written to tile X?
write it to tile X
read relations
should it be written to tile X?
write it to tile X