DEM size in Garmin Basemap > 16MB

Hi, I've just noticed that the DEM file in my Oregon basemap (gmapbmap.img) is ~ 31MB. Up to now I thought that 16MB is either the limit for a single file in an img or for the whole img file. Both seems to be wrong. @Steve: The value is coded in BufferedImgFileWriter: // The maximum allowed file size. private long maxAllowedSize = 0xffffff; Is that an mkgmap limit or do you think that Garmin uses a special trick for the base map? Gerd

Hi Andreas, strange. I've only tested with --gmapi so far, so I am 100% sure that this works. I did not yet test the nsi installer version or the gmapsupp. Maybe you used the wrong program? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von andreas.schmidt.hetschbach@t-online.de <andreas.schmidt.hetschbach@t-online.de> Gesendet: Freitag, 22. Dezember 2017 18:39:46 An: mkgmap-dev; Development list for mkgmap Betreff: Re: [mkgmap-dev] DEM size in Garmin Basemap > 16MB Hi Gerd, if finalized, would „mkgmap –gmapi“ create the DEM-files in the „product1-folder. As far as I Tested it yet, it doesn´t“? Andreas Gesendet von Mail<https://go.microsoft.com/fwlink/?LinkId=550986> für Windows 10 Von: Gerd Petermann<mailto:GPetermann_muenchen@hotmail.com> Gesendet: Freitag, 22. Dezember 2017 17:44 An: Development list for mkgmap<mailto:mkgmap-dev@lists.mkgmap.org.uk> Betreff: [mkgmap-dev] DEM size in Garmin Basemap > 16MB Hi, I've just noticed that the DEM file in my Oregon basemap (gmapbmap.img) is ~ 31MB. Up to now I thought that 16MB is either the limit for a single file in an img or for the whole img file. Both seems to be wrong. @Steve: The value is coded in BufferedImgFileWriter: // The maximum allowed file size. private long maxAllowedSize = 0xffffff; Is that an mkgmap limit or do you think that Garmin uses a special trick for the base map? Gerd _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, I have added DEM to my maps using BuilDemFile and without any changes to splitter parameters. The biggest DEM was about 35MB and the biggest img about 40MB including 32MB of DEM. I haven't noticed any problems. Even more, I have build TDB using test version of mkgmap v3999, so mkgmap has no problems with reading big img with DEM. I think there is no superficial limit for single img. Internal structure of img is FAT-alike, and limits comes from this structure. You can get 256 FAT records for a subfile like DEM and 240 sector pointers in each record. With max sector size 64kB, it makes limit like nearly 4GB. I don't know if mkgamp uses fixed sector size for created img. If yes, then limit would be dependent on this value. -- Best regards, Andrzej

Hi Andrzej, good to know. I assume the 16MB limit makes sense for other subfiles which only have 3-byte offsets. In DEM files every offset is stored with up to 4 bytes, so it it obvious that more than 16MB are intended. I've now found that there is already a method setMaxSize() which allows to set a different size and I am now testing the created img files. With gmapi format it looks good. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Freitag, 22. Dezember 2017 18:50:31 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] DEM size in Garmin Basemap > 16MB Hi Gerd, I have added DEM to my maps using BuilDemFile and without any changes to splitter parameters. The biggest DEM was about 35MB and the biggest img about 40MB including 32MB of DEM. I haven't noticed any problems. Even more, I have build TDB using test version of mkgmap v3999, so mkgmap has no problems with reading big img with DEM. I think there is no superficial limit for single img. Internal structure of img is FAT-alike, and limits comes from this structure. You can get 256 FAT records for a subfile like DEM and 240 sector pointers in each record. With max sector size 64kB, it makes limit like nearly 4GB. I don't know if mkgamp uses fixed sector size for created img. If yes, then limit would be dependent on this value. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Andrzej, with r4016 I've changed the limit for DEM files to 256 MB and it seems to work fine. Maybe I should better use a different writer class for DEM, the limit is in BufferedImgFileWriter but not in FileBackedImgFileWriter which we use for mdr files. Something to look at in the next days. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Freitag, 22. Dezember 2017 20:22:06 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] DEM size in Garmin Basemap > 16MB Hi Andrzej, good to know. I assume the 16MB limit makes sense for other subfiles which only have 3-byte offsets. In DEM files every offset is stored with up to 4 bytes, so it it obvious that more than 16MB are intended. I've now found that there is already a method setMaxSize() which allows to set a different size and I am now testing the created img files. With gmapi format it looks good. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Freitag, 22. Dezember 2017 18:50:31 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] DEM size in Garmin Basemap > 16MB Hi Gerd, I have added DEM to my maps using BuilDemFile and without any changes to splitter parameters. The biggest DEM was about 35MB and the biggest img about 40MB including 32MB of DEM. I haven't noticed any problems. Even more, I have build TDB using test version of mkgmap v3999, so mkgmap has no problems with reading big img with DEM. I think there is no superficial limit for single img. Internal structure of img is FAT-alike, and limits comes from this structure. You can get 256 FAT records for a subfile like DEM and 240 sector pointers in each record. With max sector size 64kB, it makes limit like nearly 4GB. I don't know if mkgamp uses fixed sector size for created img. If yes, then limit would be dependent on this value. -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 22/12/17 16:44, Gerd Petermann wrote:
@Steve: The value is coded in BufferedImgFileWriter: // The maximum allowed file size. private long maxAllowedSize = 0xffffff;
True, and you can just use setMaxSize() if the limit doesn't apply for a particular file. Looks like you did that already :) The default limit is just a safe value for the files that use 3 byte pointers. Steve
participants (5)
-
andreas.schmidt.hetschbach@t-online.de
-
Andrzej Popowski
-
Gerd Petermann
-
Gerd Petermann
-
Steve Ratcliffe