MDR 9 & 10 groups

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

MDR 9 & 10 groups

Ticker Berkin
Hi

While trying to diagnose a indexing problem, I find that a bit code in
imgfmt/app/mdr/MdrUtils.java:getGroupForPoi() troublesome:


...
         * 4-5 Recreation / Entertainment / Attractions
         * 6 Shopping
         * 7 Auto Services
         * 8 Community
         * 9 ?
         *
         */
        public static int getGroupForPoi(int fullType) {
                // We group pois based on their type.  This may not be
the final thoughts on this.
                int type = getTypeFromFullType(fullType);
                int group = 0;
                if (fullType <= 0xf)
                        group = 1;
                else if (type >= 0x2a && type <= 0x30) {
                        group = type - 0x28;
                } else if (type == 0x28) {
                        group = 9;
...

type 0x28 is, according to my device, "Island", but not the one that is
findable under Geographic Points/Water Features, as used by the default
style, which is 0x650c.

So, the first question is, does anyone know why 0x28 was given it's own
group.

The second problem is that the code that builds up the group start
indexes into Mdr10 for Mdr9 assumes that the type ranges of the POI
allocated for a group are in the same order as the groups, so, if you
actually have a POI of type 0x28 then, because it has a lower type but
a higher group than the 0x2a..30 range/groups, mdr9 is wrong.

Unless there is a good reason to have 0x28=group 9, then the simplest
fix is just to remove the lines of code and put in a comment that the
types must be in order.

I'm trying to fix something else in this area so I can include this in
some future patch.

Regards
Ticker

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

Steve Ratcliffe

Hi Ticker

> So, the first question is, does anyone know why 0x28 was given it's own
> group.

I've no idea why, but that is the way it is as far as I could
determine.

> The second problem is that the code that builds up the group start
> indexes into Mdr10 for Mdr9 assumes that the type ranges of the POI
> allocated for a group are in the same order as the groups, so, if you
> actually have a POI of type 0x28 then, because it has a lower type but
> a higher group than the 0x2a..30 range/groups, mdr9 is wrong.

I don't see where that happens but that would be wrong and mdr9
should be ordered by group.

Cheers
Steve
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

Gerd Petermann
Hi Ticker,

I also don't know what 0x28 is, but you are probably right that the code is wrong. A change from
LinkedHashMap to TreeMap for field index in MDR9 should fix this, right?

Gerd

________________________________________
Von: mkgmap-dev <[hidden email]> im Auftrag von Steve Ratcliffe <[hidden email]>
Gesendet: Montag, 15. April 2019 23:12
An: [hidden email]
Betreff: Re: [mkgmap-dev] MDR 9 & 10 groups


Hi Ticker

> So, the first question is, does anyone know why 0x28 was given it's own
> group.

I've no idea why, but that is the way it is as far as I could
determine.

> The second problem is that the code that builds up the group start
> indexes into Mdr10 for Mdr9 assumes that the type ranges of the POI
> allocated for a group are in the same order as the groups, so, if you
> actually have a POI of type 0x28 then, because it has a lower type but
> a higher group than the 0x2a..30 range/groups, mdr9 is wrong.

I don't see where that happens but that would be wrong and mdr9
should be ordered by group.

Cheers
Steve
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

Ticker Berkin
Hi Gerd & Steve

When I was running with a small example it seemed that the MDR9 was
written in group order, each with start record to MDR10 that is
calculated on the assumption that MDR10 was also generated in the same
group order. However the step in MDR10 caused by a single 0x28/group 9
POI appeared incorrect.

Now, with a real map, I'm having trouble working out what is going on
and it might be correct. I need to check more carefully.

I thought LinkedHashMap did preserve an order.

Regards
Ticker

On Tue, 2019-04-16 at 05:46 +0000, Gerd Petermann wrote:

> Hi Ticker,
>
> I also don't know what 0x28 is, but you are probably right that the
> code is wrong. A change from
> LinkedHashMap to TreeMap for field index in MDR9 should fix this,
> right?
>
> Gerd
>
> ________________________________________
> Von: mkgmap-dev <[hidden email]> im Auftrag
> von Steve Ratcliffe <[hidden email]>
> Gesendet: Montag, 15. April 2019 23:12
> An: [hidden email]
> Betreff: Re: [mkgmap-dev] MDR 9 & 10 groups
>
>
> Hi Ticker
>
> > So, the first question is, does anyone know why 0x28 was given it's
> > own
> > group.
>
> I've no idea why, but that is the way it is as far as I could
> determine.
>
> > The second problem is that the code that builds up the group start
> > indexes into Mdr10 for Mdr9 assumes that the type ranges of the POI
> > allocated for a group are in the same order as the groups, so, if
> > you
> > actually have a POI of type 0x28 then, because it has a lower type
> > but
> > a higher group than the 0x2a..30 range/groups, mdr9 is wrong.
>
> I don't see where that happens but that would be wrong and mdr9
> should be ordered by group.
>
> Cheers
> Steve
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

Ticker Berkin
Hi

I was wrong - MDR 9 & 10 are correct regardless of the out-of-order
0x28/group 9.

Sorry wasting your time.

Ticker

On Tue, 2019-04-16 at 11:50 +0100, Ticker Berkin wrote:

> Hi Gerd & Steve
>
> When I was running with a small example it seemed that the MDR9 was
> written in group order, each with start record to MDR10 that is
> calculated on the assumption that MDR10 was also generated in the
> same
> group order. However the step in MDR10 caused by a single 0x28/group
> 9
> POI appeared incorrect.
>
> Now, with a real map, I'm having trouble working out what is going on
> and it might be correct. I need to check more carefully.
>
> I thought LinkedHashMap did preserve an order.
>
> Regards
> Ticker
>
> On Tue, 2019-04-16 at 05:46 +0000, Gerd Petermann wrote:
> > Hi Ticker,
> >
> > I also don't know what 0x28 is, but you are probably right that the
> > code is wrong. A change from
> > LinkedHashMap to TreeMap for field index in MDR9 should fix this,
> > right?
> >
> > Gerd
> >
> > ________________________________________
> > Von: mkgmap-dev <[hidden email]> im Auftrag
> > von Steve Ratcliffe <[hidden email]>
> > Gesendet: Montag, 15. April 2019 23:12
> > An: [hidden email]
> > Betreff: Re: [mkgmap-dev] MDR 9 & 10 groups
> >
> >
> > Hi Ticker
> >
> > > So, the first question is, does anyone know why 0x28 was given
> > > it's
> > > own
> > > group.
> >
> > I've no idea why, but that is the way it is as far as I could
> > determine.
> >
> > > The second problem is that the code that builds up the group
> > > start
> > > indexes into Mdr10 for Mdr9 assumes that the type ranges of the
> > > POI
> > > allocated for a group are in the same order as the groups, so, if
> > > you
> > > actually have a POI of type 0x28 then, because it has a lower
> > > type
> > > but
> > > a higher group than the 0x2a..30 range/groups, mdr9 is wrong.
> >
> > I don't see where that happens but that would be wrong and mdr9
> > should be ordered by group.
> >
> > Cheers
> > Steve
> > _______________________________________________
> > mkgmap-dev mailing list
> > [hidden email]
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> > _______________________________________________
> > mkgmap-dev mailing list
> > [hidden email]
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

popej
In reply to this post by Gerd Petermann
Hi Gerd,

point 0x28 is a label or region name without an icon. Do any Garmin's
map include 0x28 in search index?

--
Best regards,
Andrzej
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: MDR 9 & 10 groups

Gerd Petermann
Hi Andrzej,

I've looked at output of mdrDisplay and found some in Deutschland-v3, but I never tried to find out what they are good for.

Gerd

________________________________________
Von: mkgmap-dev <[hidden email]> im Auftrag von Andrzej Popowski <[hidden email]>
Gesendet: Mittwoch, 17. April 2019 13:44
An: [hidden email]
Betreff: Re: [mkgmap-dev] MDR 9 & 10 groups

Hi Gerd,

point 0x28 is a label or region name without an icon. Do any Garmin's
map include 0x28 in search index?

--
Best regards,
Andrzej
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev