logo separator

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

From GerdP gpetermann_muenchen at hotmail.com on Tue Jan 15 21:14:12 GMT 2013

WanMil wrote
> 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.

Hi WanMil,

Yes, that is exactly the problem. What I want to change is that mkgmap 
prints the error message even when no problem occurs. 
You can have two situations:
1) two or more large  identical polygons with many points cause the error
message,
but the points are saved with less bytes than estimated. In this case there
is no problem 
2) two or more large  identical polygons with many points cause the same
error message 
AND the points are saved with so many bytes that the limit is reached. This
is an error
and must be avoided. If the error hapens, I think the program will 
throw 
new IllegalStateException("Polyline offset too large: " + off);
 
The number of bytes needed to save a polygon is variable, and afaik the
current estimation
is a bit too pessimistic.
So, we can change two parts:
1) Remove the error message "area too small to split ..."
2) Create one area for each of the large polygons. I don't know if it would
cause problems
when two areas are located at the same position. If yes, we can more them a
little bit.

I will trace that down tomorrow.

Gerd




--
View this message in context: http://gis.19327.n5.nabble.com/Why-do-we-have-the-Area-too-small-to-split-at-message-tp5744612p5744766.html
Sent from the Mkgmap Development mailing list archive at Nabble.com.


More information about the mkgmap-dev mailing list