logo separator

[mkgmap-dev] Why do we have the "Area too small to split at ..." message

From WanMil wmgcnfg at web.de on Tue Jan 15 19:39:33 GMT 2013

> Hi,
>
> I wonder if this message is really useful.
> I see this typically for large shapes, the last example from
> Thorsten has two identical large shapes (the island Rügen)
> http://www.openstreetmap.org/browse/relation/54400
>
> The message is printed because
> area.getEstimatedSizes()
> returns values that are higher than some limits.
> The problem: area.getEstimatedSizes() ignores the filters
> which are used to reduce the number of points, so the
> error message may be printed without any reason.
>
> I think it would be better to do something like this:
>   oldPos = buffer.getPosition()
>   add the shape
>   bytes = buffer.getPosition() - oldPos;
>   if (bytes > LIMIT) {
>     print error message
> }
>
> This would also allow to report the name of the shape that is probably
> corrupted.
> Of course, the same can be done for ways or node.
>
> What do you think?
>
> Gerd
>

Hi Gerd,

of course you can move the error message but I think your proposal does 
not solve the problem.

As far as I understand the current processing is:
1. MapBuilder processes all Map objects (cities, roads, POIs etc.).
2. Then these objects must be separated into subdivisions. Subdivisions 
have some limits so MapSplitter (who does this job) checks these limits 
while adding objects to a list (MapArea) that is converted to a 
subdivision later.
3. The objects from the MapArea are filtered when creating the 
subdivions. Now you are right. The filters probably will reduce the 
number of points etc. and therefore there will be some more space until 
the limits of a subdivion are reached.

The error message appears at step 2 where the MapSplitter tries to 
collect as many objects as possible. At first all objects are taken and 
as long as a limit is exceeded the whole area is split into two areas. A 
polygon is put into the area where its center is located. If the larger 
side of the area is <= 10 units the area is no longer split and the 
error message is printed.
This happens if you have two identical large polygons. No matter how 
often MapSplitter splits the areas both polygons will always have the 
same center point and are put into the same area. Together they exceed 
the limits of a single subdivision and therefore the MapSplitter tries 
to split the area again.

If you want to remove the reason of the error message you would have to 
change the way how subdivisions are created.

WanMil




More information about the mkgmap-dev mailing list