logo separator

[mkgmap-dev] echo improvements for elements with fake ids

From Mike Baggaley mike at tvage.co.uk on Wed Jan 21 13:16:01 GMT 2015

Hi WanMil, 

I did notice after posting the code that the other class members started
with a lower case letter. No problem with following that convention
(developments I have been involved in have always used upper case first
letter for class variables, to distinguish them from local variables). I
come from C++/C# background, so have not heard of Javadoc comments before. I
will have a look at how they work.

It seems to me to be better to use the relation Id (if it is available) if a
fake way is being built from a relation, rather than the Id of one way
within the relation. I gather that echo/echotags can be used on points,
lines and relations, and that the original id could be a line or relation (I
haven't noticed any code generating fake points from points, but could have
missed it). I did think about storing a reference to the original Element
instead of its id, but didn't think that improving a diagnostic message
warranted that much, just to add the word relation or way. Adding a variable
to indicate the sort of original element would use another 8 bytes per
Element (unless we used the significant bits within originalId). The
ways/relations Ids I used for testing were all unique - when looking up the
Id in OSM either the way or relation did not exist with that number. I don't
know whether this is always be the case. Please feel free to improve the
algorithm.

Regards,
Mike

-----Original Message-----
From: WanMil [mailto:wmgcnfg at web.de] 
Sent: 20 January 2015 22:24
To: Development list for mkgmap
Subject: Re: [mkgmap-dev] echo improvements for elements with fake ids

Hi Mike,

that's a good idea to tackle the fake id problem.

I didn't have time to test it but after a short look over the committed 
patch I think there are a few things to be improved:

First of all small stylistic things: fields should start with lower case 
letters. So OriginalId in Element should be originalId.
It would be good if you add (javadoc) comments to your source code :-)

It seems that the ways created by Multipolygon relations use the 
relation id as original id. I am not sure if that's the best choice. 
It's not easy to decide which id should be chosen when ways are merged. 
When using the relation id it should be clear in the output that this id 
is the relation id and not a way id. Otherwise users will search for 
completely wrong ways.

WanMil

> HI Gerd, thanks for that - I was scratching my head trying to think of a
> way that would use less memory. If using the tags, each tag would have
> used more than 8 bytes, although they would have only been on faked
> elements. The tag iterators would also have processed them (unless
> special code was included to exclude them). I did wonder whether we
> could store both the original Id and the fake Id in the 64 bit number
> with perhaps 40 bits for the OSM Id and 24 bits for the fake Id, but
> this might not be enough space (taking into account the future).
>
> Mike
>
> *From:*Gerd Petermann [mailto:gpetermann_muenchen at hotmail.com]
> *Sent:* 19 January 2015 20:29
> *To:* mkgmap-dev at lists.mkgmap.org.uk
> *Subject:* Re: [mkgmap-dev] echo improvements for elements with fake ids
>
> Hi Mike,
>
> I've committed the patch as is. The memory impact is not that big as
> we have typically less than 500.000 instances of Element in one tile,
> so 8 more bytes * 500.000  ~ 4MB more heap.
>
> Gerd
>
> From: mike at tvage.co.uk <mailto:mike at tvage.co.uk>
> To: mkgmap-dev at lists.mkgmap.org.uk <mailto:mkgmap-dev at lists.mkgmap.org.uk>
> Date: Mon, 19 Jan 2015 11:55:00 +0000
> Subject: [mkgmap-dev] echo improvements for elements with fake ids
>
> The attached patch improves the echo and echotags messages by including
the
> id of the original element when a fake id is generated by mkgmap, thus
> enabling you to find it in OSM.
>
> Please try, and commit if you are happy with the change.
>
> Regards,
> Mike
>
>
> _______________________________________________ mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk <mailto:mkgmap-dev at lists.mkgmap.org.uk>
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>
>
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>





More information about the mkgmap-dev mailing list