logo separator

[mkgmap-dev] Map ID: In-file replacing

From Simon Eugster livin.shadow at gmail.com on Thu Jan 14 01:54:03 GMT 2010

Ralf Kleineisel wrote:
> On 01/13/2010 09:14 PM, Simon Eugster wrote:
> 
>> I thought it would be enough to just search for the map ID in a .img file 
>> and replace it by a new one. Well, after some research I found out that 
>> this is not true.
>> http://svn.parabola.me.uk/mkgmap/trunk/src/uk/me/parabola/imgfmt/app/trergn/MapValues.java
>> I tried to check out TreCalc listed there, but it would not compile ...
>>
>> Would it be possible to change mkgmap that way that it supports in-file 
>> replacing of the map ID (without regenerating all stuff)?
> 
> Wgmaptool can do this.

Well ...
Now my Python script can do it as well.
I've mainly copied Steve's code (thank you!) and translated it to Python.
It took some time (as you can see when you look when I sent this mail) to 
get everything right ... but now it is working :)

$ python change-mapID.py 1000.img 12343210
Old map ID at fe00: 0x000003e8 = 1000
Header length: 188
Values: e1c63e9b ee9a3e9a eeee3e9a eeee3e9a (original)
Values: 57c264ef 00d4649a 002864ee 002864ee (calculated)

Have fun :)
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libGarminImg.py
Type: text/x-python
Size: 6429 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20100114/994b06a0/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: change-mapID.py
Type: text/x-python
Size: 193 bytes
Desc: not available
Url : http://lists.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20100114/994b06a0/attachment-0001.py 


More information about the mkgmap-dev mailing list