This reduces the warnings for "FIXME - too many POIs in group" and "point number too big" to one per source map.

Kimon

Index: src/uk/me/parabola/mkgmap/combiners/MdrBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/MdrBuilder.java (revision 2053)
+++ src/uk/me/parabola/mkgmap/combiners/MdrBuilder.java (working copy)
@@ -50,6 +50,7 @@
 import uk.me.parabola.imgfmt.fs.FileSystem;
 import uk.me.parabola.imgfmt.fs.ImgChannel;
 import uk.me.parabola.imgfmt.sys.ImgFS;
+import uk.me.parabola.log.Logger;
 import uk.me.parabola.mkgmap.CommandArgs;
 import uk.me.parabola.mkgmap.srt.SrtTextReader;
 
@@ -69,6 +70,8 @@
        private File tmpName;
        private String outputName;
 
+       private static final Logger log = Logger.getLogger(MdrBuilder.class);
+       
        /**
         * Create the mdr file and initialise.
         * It has a name that is based on the overview-mapname option, as does
@@ -274,12 +277,16 @@
         * @param maps Maps of regions, cities countries etc.
         */
        private void addPoints(MapReader mr, AreaMaps maps) {
+               boolean warnedPointNumberTooBig = false;
                List<Point> list = mr.pointsForLevel(0);
                for (Point p : list) {
                        Label label = p.getLabel();
                        if (p.getNumber() > 256) {
                                // I think we limit the number of 
points+ind-points, but just in case
-                               System.out.println("point number too big");
+                               if (!warnedPointNumberTooBig) {
+                                       log.warn("point number too big");
+                                       warnedPointNumberTooBig = true;
+                               }
                                continue;
                        }
 
Index: src/uk/me/parabola/mkgmap/main/Main.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java     (revision 2053)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java     (working copy)
@@ -741,6 +741,8 @@
 
                boolean haveIndPoints = false;
                int pointIndex = 1;
+               
+               boolean warnedTooManyPOIs = false;
 
                // although the non-indexed points are output first,
                // pointIndex must be initialized to the number of indexed
@@ -794,8 +796,12 @@
                        map.addMapObject(p);
                        if(!point.hasExtendedType()) {
                                if(name != null && div.getZoom().getLevel() == 
0) {
-                                       if(pointIndex > 255)
-                                               log.error("FIXME - too many 
POIs in group");
+                                       if(pointIndex > 255) {
+                                               if (!warnedTooManyPOIs) {
+                                                       log.error("FIXME - too 
many POIs in group");
+                                                       warnedTooManyPOIs = 
true;
+                                               }
+                                       }
                                        else if(point.isExit()) {
                                                Exit e = 
((MapExitPoint)point).getExit();
                                                if(e != null)

_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to