logo separator

[mkgmap-dev] House numbers

From Gerd Petermann gpetermann_muenchen at hotmail.com on Thu Sep 14 19:01:57 BST 2023

Hi Michael,

I think it would be possible to change the code in mkgmap, but it would be difficult. I still don't see any good reason to display an unnamed road with a name. In fact, I've invested a lot of time in my area to fix OSM data where mappers decided to name roads after the adddress of nearby houses.

Why would it be difficult to implement this?
The current implementation adds the label after the style rules were processed, so the style decides what ways are routable and what labels are added to them. The code tries to avoid adding address data to footways or cycleways.
You suggest to parse the data first, check every possible line with highway=*, but at that stage mkgmap doesn't know if the style will add a routable line for that road.

It would be much easier to change the logic which adds a label for the addr:place numbers. The code is in HousenumberRoad.java and
it looks like this
                if (!found){
                        if (labels[0] == null){
                                // add empty label so that the address search name doesn't appear in the map
                                // when the original road did not have any label
                                labels[0] = "";
                        }
                        for (int i = 1; i < labels.length; i++){
                                if (labels[i] == null){
                                        labels[i] = streetName;
                                        log.info("added label",streetName,"for",road,"Labels are now:",Arrays.toString(labels));
                                        found = true;
                                        break;
                                }
                        }
                }

So, if you really want to display wrong road names you just have to remove the block which adds an empty label and change the for loop to start with 0 instead of 1.

I would add an option to do that if you or someone else can convince me that this is a good idea. I think it would be plain wrong and very confusing.

ciao,
Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Forstner Michael <forstner-m at a1.net>
Gesendet: Donnerstag, 14. September 2023 12:08
An: 'Development list for mkgmap'
Betreff: Re: [mkgmap-dev] House numbers

Hello Gerd,

I tried the system with POI and it works now. But this is just a workaround,
which should not actually be necessary.
Is it really not possible to name unnamed streets after an addr:place
beforehand and then let the further process go through. OSM's work is then
taken over when a street name is taken over by a nearby building with
addr:place.
I think a similar command is necessary: set mkgmap:label:1='${addr:place}'
But it is unclear to me where this should be applied. I do not want to dig
around too much in the source code. You will probably know a lot better
about the source code.

Thank you!

Best regards
Michael


_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list