logo separator

[mkgmap-dev] FakeIdGenerator

From WanMil wmgcnfg at web.de on Tue Jan 8 19:36:45 GMT 2013

Hi Gerd,

> Hi Steve, WanMil,
>
> I think the FakeIdGenerator should be changed.
> As Rogert Calvert pointed out, other tools like SRTM2OSM generate OSM data
> with IDs like "9223372036854775807"

do you know any other tool than SRTM2OSM? If it's only SRTM2OSM I guess 
there is no problem. The history of SRTM2OSM tells that version 1.10 
starts with IDs at 2^63-1 counting down. So there are 
4611686018427387903 ids until it conflicts with mkgmaps FakeIdGenerator.
I haven't followed the whole thread. Did Roger use the latest version of 
SRTM2OSM?

> These ids may be treated as fake ids by the
> FakeIdGenerator.isFakeId() method which is too simple.
>
> Possible solutions:
> - the reader should stop with an error message if an OSM id is found that is
> higher than FakeIdGenerator.START_ID

A warning doesn't harm. But I would not stop the reader because 
otherwise you cannot use SRTM2OSM any more.

> or
> - the FakeIdGenerator should be changed to allow a parameter which gives a
> start value (or maybe a range )

At the moment we try to reduce the number of options. So I don't want to 
create a new one here.

There might be some other strategies:
1. Using negative Ids. I don't know if that conflicts with other tools.
2. Using a new generator for each file. This could be implemented as 
ThreadLocal and resetted each time a file starts. This reduces the id 
range that is required.

Of course if another tool uses the same id range you will have the same 
problems again. But the only tool which I can remember that caused 
problems is SRTM2OSM.

WanMil

>
> What do you think?
>
> Gerd
>






More information about the mkgmap-dev mailing list