
Hi all, I created my TYP file with the latest TYPViewer. I can compile it using this tool. However, mkgmap fails with a NullPointerException : java.lang.NullPointerException at uk.me.parabola.imgfmt.app.typ.Xpm.writeImage(Xpm.java:43) at uk.me.parabola.imgfmt.app.typ.TypElement.writeImage(TypElement.java:206) at uk.me.parabola.imgfmt.app.typ.TypPoint.write(TypPoint.java:53) at uk.me.parabola.imgfmt.app.typ.TYPFile.writeSection(TYPFile.java:168) at uk.me.parabola.imgfmt.app.typ.TYPFile.write(TYPFile.java:70) at uk.me.parabola.mkgmap.main.TypCompiler.writeTyp(TypCompiler.java:145) at uk.me.parabola.mkgmap.main.TypCompiler.makeMap(TypCompiler.java:102) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:243) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:239) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:695) Exiting - if you want to carry on regardless, use the --keep-going option I found the culprit to be a blank POI : [_point] Type=0x02f03 String1=0x04,XXXXX String2=0x03, String3=0x02, String4=0x01,YYYYY ExtendedLabels=Y FontStyle=SmallFont CustomColor=Day DaycustomColor:#00008B DayXpm="0 0 0 0" [end] If I select the "Bitmap" checkbox, TYPViewer generates the POI like this : [_point] Type=0x02f03 String1=0x04,XXXXX String2=0x03, String3=0x02, String4=0x01,YYYYY ExtendedLabels=Y FontStyle=SmallFont CustomColor=Day DaycustomColor:#00008B DayXpm="16 16 2 1" Colormode=16 "! c #FFFFFF" " c none" " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " ;1234567890123456 [end] This format compiles just fine. http://www.mkgmap.org.uk/doc/typ-compiler says : "In particular the files produced by TYPWiz and TYPViewer are supported." So, is this a bug in mkgmap or TYPviewer ? Thanks, Paco

This is not a TYPviewer bug. POIs can have zero width & height with colormode 0 or 16. Such POIs were found in older TYP files - they were mainkly used for cities etc ; however, Garmin no longer seems to support zero dimensions - some versions of Mapsource even crash ! Also, zero colours in the xpm in the distant past implied 0 colours - Garmin has changed its tune and the zero now indicates truecolors . There is no advantage in reverting to 0 0 0 0 as the same effect can be created using 1 1 0 16 -- View this message in context: http://gis.19327.n5.nabble.com/NullPointerException-when-compiling-a-TYP-fil... Sent from the Mkgmap Development mailing list archive at Nabble.com.

@ Steve The problem I have encountered is that old style 5 5 0 1 colormode 16 , say, did not include 25 colours to make up the bitmap . I've had to include poi stream length checks to accommodate these typ files - very unsatisfactory - btw typviewer creates a msg saying it has detected a problem and saves the poi with the expected 25 extra bytes , whereas I try to maintain the 'original' format. -- View this message in context: http://gis.19327.n5.nabble.com/NullPointerException-when-compiling-a-TYP-fil... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Hello
I created my TYP file with the latest TYPViewer. I can compile it using this tool. However, mkgmap fails with a NullPointerException : java.lang.NullPointerException at uk.me.parabola.imgfmt.app.typ.Xpm.writeImage(Xpm.java:43)
A crash in mkgmap is automatically a bug in mkgmap, so I will look into fixing it. But from Nick's reply it seems that such a thing is just best avoided since it appears that there is uneven support in modern Garmin products for it. ..Steve
participants (3)
-
nwillink
-
paco.tyson@free.fr
-
Steve Ratcliffe