Indexing street belonging to two cities

Hi there, It is not uncommon for Poland, that one street is located in two different cities. If there are addresses, mkgmap can deal with that problem and allow garmin devices to find the proper address. But if there are no addresses, I was not able to find a method for proper search index generation. Is there any solution for this problem? cgpsmapper supports this type of indexing by using @ in cities name: CityName=city1@city2 so img format can handle this. Thanks for any suggestions Piotr

Hi Piotr, this probem exists probably around the world. Some mappers split OSM ways at boundaries to solve this. Anyway, there is no easy way to solve this in mkgmap. It would be possible to split all OSM ways with highway=* at boundaries before style processing, so that each part gets different mkgmap:admin_level=* values and thus different mkgmap:city values. When --bounds is used the needed data should be available. Disadvantage would be that the number of road objects in the *.img file increases although we can store multiple cities for one road. Another simpler approach could be to post process just the way nodes for those ways which are routable (after style processing). This is probably easier to implement and closer to the way how housenumbers are processed, but still a lot of work. Why does it work with house numbers? Because each node or way with addr:housenumber is processed by the style rules and thus different numbers may have different mkgmap:city values. The program collects those values in a list for each road object when the housenumbers are processed. Without housenumbers there is only the information from the road object itself. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Donnerstag, 13. Oktober 2022 22:02 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Indexing street belonging to two cities Hi there, It is not uncommon for Poland, that one street is located in two different cities. If there are addresses, mkgmap can deal with that problem and allow garmin devices to find the proper address. But if there are no addresses, I was not able to find a method for proper search index generation. Is there any solution for this problem? cgpsmapper supports this type of indexing by using @ in cities name: CityName=city1@city2 so img format can handle this. Thanks for any suggestions Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

pt., 14 paź 2022 o 15:31 <gpetermann_muenchen@hotmail.com> napisał(a):
this probem exists probably around the world. Some mappers split OSM ways at boundaries to solve this.
Hi Gerd, So if I understood correctly it is mainly a data problem not a compiler problem itself. I am using mkgmap for compiling mp files, so streets location is clear. As I said cgpsmapper supports this type of street sharing using @ within cityname. Presently I am compiling source with cgpsmapper, but I would like to use mkgmap for this purpose, as for new Garmin receivers there are better voice commands (especially keep right/left works as it should). I know that mkgmap is mainly for osm sources, but do you think it would be possible add this feature for mp files? Cheers Piotr

Hi Piotr, yes, with *.mp files this should be easier. Please provide a sample input and desccribe the expected result and also attach the output from cgpsmapper. You can upload a zipp here: https://files.mkgmap.org.uk/ Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Freitag, 14. Oktober 2022 20:02 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pt., 14 paź 2022 o 15:31 <gpetermann_muenchen@hotmail.com> napisał(a):
this probem exists probably around the world. Some mappers split OSM ways at boundaries to solve this.
Hi Gerd, So if I understood correctly it is mainly a data problem not a compiler problem itself. I am using mkgmap for compiling mp files, so streets location is clear. As I said cgpsmapper supports this type of street sharing using @ within cityname. Presently I am compiling source with cgpsmapper, but I would like to use mkgmap for this purpose, as for new Garmin receivers there are better voice commands (especially keep right/left works as it should). I know that mkgmap is mainly for osm sources, but do you think it would be possible add this feature for mp files? Cheers Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

pt., 14 paź 2022 o 20:24 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr, yes, with *.mp files this should be easier. Please provide a sample input and desccribe the expected result and also attach the output from cgpsmapper. You can upload a zipp here: https://files.mkgmap.org.uk/
That could be possible. What is enough for you, just an img file, or all files required by Mapsource/Basecamp? Additionally, cgpsmapper will also include data for [SIGN] sections that allows to control what is printed on the top bar of garmin devices (eg, Exit 2 toward XXX). I wonder how difficult would it be to support this feature as well. Piotr

Hi Piotr, reg. [SIGN]: I think we support this with OSM files, so there should be code to write the data, but the current code ignores [SIGN] in *.mp input. So, yes, would be good to have a working example. Please make it small, just a few cities, not a full map of Poland ;) I think I just need the *.img file, but you can also provide all the output from cgpsmapper. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Freitag, 14. Oktober 2022 22:13 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pt., 14 paź 2022 o 20:24 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr, yes, with *.mp files this should be easier. Please provide a sample input and desccribe the expected result and also attach the output from cgpsmapper. You can upload a zipp here: https://files.mkgmap.org.uk/
That could be possible. What is enough for you, just an img file, or all files required by Mapsource/Basecamp? Additionally, cgpsmapper will also include data for [SIGN] sections that allows to control what is printed on the top bar of garmin devices (eg, Exit 2 toward XXX). I wonder how difficult would it be to support this feature as well. Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

sob., 15 paź 2022 o 16:00 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
reg. [SIGN]: I think we support this with OSM files, so there should be code to write the data, but the current code ignores [SIGN] in *.mp input. So, yes, would be good to have a working example. Please make it small, just a few cities, not a full map of Poland ;) I think I just need the *.img file, but you can also provide all the output from cgpsmapper.
Files uploaded https://files.mkgmap.org.uk/detail/558

Hi Piotr, I've downloaded the file. I'll have a closer look during the next days. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Sonntag, 16. Oktober 2022 13:26 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities sob., 15 paź 2022 o 16:00 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
reg. [SIGN]: I think we support this with OSM files, so there should be code to write the data, but the current code ignores [SIGN] in *.mp input. So, yes, would be good to have a working example. Please make it small, just a few cities, not a full map of Poland ;) I think I just need the *.img file, but you can also provide all the output from cgpsmapper.
Files uploaded https://files.mkgmap.org.uk/detail/558 _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

niedz., 16 paź 2022 o 17:56 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
I've downloaded the file. I'll have a closer look during the next days.
Hi Gerd, Thanks a lot. Just for information. Regarding [SIGN], theoretically SignParam should decide wheter the info is Toward (if it starts from T,). Exit (if it starts from E.) or onto (if it starts from O,), but for unknown for me reason cgpamapper generates only Toward message. Cheers Piotr

Hi Piotr, I am a bit confused. The map file 48240001.img is in NT format. Can you really create that with cgpsmapper? If you are able to create that in the older IMG format please do that. It will help me to understand what mkgmap has to write, but note that mkgmap cannot write NT format. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Sonntag, 16. Oktober 2022 19:30 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities niedz., 16 paź 2022 o 17:56 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
I've downloaded the file. I'll have a closer look during the next days.
Hi Gerd, Thanks a lot. Just for information. Regarding [SIGN], theoretically SignParam should decide wheter the info is Toward (if it starts from T,). Exit (if it starts from E.) or onto (if it starts from O,), but for unknown for me reason cgpamapper generates only Toward message. Cheers Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

pon., 17 paź 2022 o 14:46 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
I am a bit confused. The map file 48240001.img is in NT format. Can you really create that with cgpsmapper? If you are able to create that in the older IMG format please do that. It will help me to understand what mkgmap has to write, but note that mkgmap cannot write NT format.
Hi Gerd, AFAIR it is not NT format, but rather NI format - sort of new index format. As I understood Stanisław Kozicki emails from many years ago, real NT format had never been decoded by him, but he introduced new indexes format or something I am not entirely sure. It was really created with cgpamapper. Take care Piotr

Hi Piotr, well, GPSMapEdit says it is NT format, and for the existence of the sub type GMP means NT format. Anyhow, I might find a way to work around that. Do you know what the data starting with HLevel0 is about? I cannot find that in the cGPSmapper manual version 2.5 I've also noticed that mkgmap ignores the key Routeparam because it expects RouteParam. I guess it should ignore case as with some other key words? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Montag, 17. Oktober 2022 14:53 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pon., 17 paź 2022 o 14:46 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
I am a bit confused. The map file 48240001.img is in NT format. Can you really create that with cgpsmapper? If you are able to create that in the older IMG format please do that. It will help me to understand what mkgmap has to write, but note that mkgmap cannot write NT format.
Hi Gerd, AFAIR it is not NT format, but rather NI format - sort of new index format. As I understood Stanisław Kozicki emails from many years ago, real NT format had never been decoded by him, but he introduced new indexes format or something I am not entirely sure. It was really created with cgpamapper. Take care Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Piotr, the attached patch solves the indexing city problem. Rather ugly but I think it works. Please try. A patched binary is here: https://files.mkgmap.org.uk/download/559/mkgmap.jar The [SIGN] part will take more time... Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Montag, 17. Oktober 2022 15:50 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities Hi Piotr, well, GPSMapEdit says it is NT format, and for the existence of the sub type GMP means NT format. Anyhow, I might find a way to work around that. Do you know what the data starting with HLevel0 is about? I cannot find that in the cGPSmapper manual version 2.5 I've also noticed that mkgmap ignores the key Routeparam because it expects RouteParam. I guess it should ignore case as with some other key words? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Montag, 17. Oktober 2022 14:53 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pon., 17 paź 2022 o 14:46 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
Hi Piotr,
I am a bit confused. The map file 48240001.img is in NT format. Can you really create that with cgpsmapper? If you are able to create that in the older IMG format please do that. It will help me to understand what mkgmap has to write, but note that mkgmap cannot write NT format.
Hi Gerd, AFAIR it is not NT format, but rather NI format - sort of new index format. As I understood Stanisław Kozicki emails from many years ago, real NT format had never been decoded by him, but he introduced new indexes format or something I am not entirely sure. It was really created with cgpamapper. Take care Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

pon., 17 paź 2022 o 15:50 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
well, GPSMapEdit says it is NT format, and for the existence of the sub type GMP means NT format.
Well, it might be alike from index point of view, but I am sure that the whole NT, have never been decoded.
Anyhow, I might find a way to work around that.
That could be awesome, if you need any additional data, please let me know, I will try to prepare specific data if you wish.
Do you know what the data starting with HLevel0 is about? I cannot find that in the cGPSmapper manual version 2.5
You can ignore it, it is extension from navitel, and it is used in the source code for bridges depiction. In general it shows level: -1 mean tunel, +1 etc mean above surface.
I've also noticed that mkgmap ignores the key Routeparam because it expects RouteParam. I guess it should ignore case as with some other key words?
Yes, mkgmap ignores Routparam, but it is not an issue at all, as I am preprocessing source for mkgmap. It might be that cgpmapper is not case sensitive at all, but I would need to check it. Should I? Routeparam is a result of another software, that prepares mp for cgpamapper. It creates routing data (nodes), restrictions, signs and balances routing classes. But apparently cgpamapper accepts Routeparam as well. Piotr

Hi Piotr, it seems I already worked on the [Sign] stuff in 2016, see https://www.mkgmap.org.uk/pipermail/mkgmap-dev/2016q1/024703.html I have no idea why I stopped at that time, but it means that I was wrong when I wrote that we already know how to write the [Sign] data. I've confused that with the method how we write destination hints. I'll start again to look at the data from Andrzej. Reg. multiple cities for one road: My patch only handles the @ in city names. The manual shows that this trick can also be used for RegionName. I have to add some more code to handle this in the way documented in the manual. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Montag, 17. Oktober 2022 16:11 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pon., 17 paź 2022 o 15:50 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
well, GPSMapEdit says it is NT format, and for the existence of the sub type GMP means NT format.
Well, it might be alike from index point of view, but I am sure that the whole NT, have never been decoded.
Anyhow, I might find a way to work around that.
That could be awesome, if you need any additional data, please let me know, I will try to prepare specific data if you wish.
Do you know what the data starting with HLevel0 is about? I cannot find that in the cGPSmapper manual version 2.5
You can ignore it, it is extension from navitel, and it is used in the source code for bridges depiction. In general it shows level: -1 mean tunel, +1 etc mean above surface.
I've also noticed that mkgmap ignores the key Routeparam because it expects RouteParam. I guess it should ignore case as with some other key words?
Yes, mkgmap ignores Routparam, but it is not an issue at all, as I am preprocessing source for mkgmap. It might be that cgpmapper is not case sensitive at all, but I would need to check it. Should I? Routeparam is a result of another software, that prepares mp for cgpamapper. It creates routing data (nodes), restrictions, signs and balances routing classes. But apparently cgpamapper accepts Routeparam as well. Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Piotr, reg. multipile cities: I'm sorry, it seems I no longer understand the code in mkgmap :( In fact it seems I somehow lost my ability to understand and handle complex problems, probably it's time for me to stop doing this. My first patch works as intended but doesn't change the output as expected. I thought that mkgmap can handle roads with multiple cities but you seem to be right that this only works when the cities are encoded with the house numbers. I've no idea what mkgmap should write for your input and our tools to analyse the GMP format are too poor as well. Maybe cgpsmapper creates fake house numbers for the additional cities? Reg. [Sign]: I might look at this again in the winter. Right now I prefer to cycle and do some OSM mapping. ciao, Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Dienstag, 18. Oktober 2022 09:34 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities Hi Piotr, it seems I already worked on the [Sign] stuff in 2016, see https://www.mkgmap.org.uk/pipermail/mkgmap-dev/2016q1/024703.html I have no idea why I stopped at that time, but it means that I was wrong when I wrote that we already know how to write the [Sign] data. I've confused that with the method how we write destination hints. I'll start again to look at the data from Andrzej. Reg. multiple cities for one road: My patch only handles the @ in city names. The manual shows that this trick can also be used for RegionName. I have to add some more code to handle this in the way documented in the manual. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Piotr Wawrzyniak <wopozka@gmail.com> Gesendet: Montag, 17. Oktober 2022 16:11 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities pon., 17 paź 2022 o 15:50 Gerd Petermann <gpetermann_muenchen@hotmail.com> napisał(a):
well, GPSMapEdit says it is NT format, and for the existence of the sub type GMP means NT format.
Well, it might be alike from index point of view, but I am sure that the whole NT, have never been decoded.
Anyhow, I might find a way to work around that.
That could be awesome, if you need any additional data, please let me know, I will try to prepare specific data if you wish.
Do you know what the data starting with HLevel0 is about? I cannot find that in the cGPSmapper manual version 2.5
You can ignore it, it is extension from navitel, and it is used in the source code for bridges depiction. In general it shows level: -1 mean tunel, +1 etc mean above surface.
I've also noticed that mkgmap ignores the key Routeparam because it expects RouteParam. I guess it should ignore case as with some other key words?
Yes, mkgmap ignores Routparam, but it is not an issue at all, as I am preprocessing source for mkgmap. It might be that cgpmapper is not case sensitive at all, but I would need to check it. Should I? Routeparam is a result of another software, that prepares mp for cgpamapper. It creates routing data (nodes), restrictions, signs and balances routing classes. But apparently cgpamapper accepts Routeparam as well. Piotr _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd,
I thought that mkgmap can handle roads with multiple cities but you seem to be right that this only works when the cities are encoded with the house numbers.
Actually in mp format you can encode void house numbers with 2 cities. Doesn't it work in mkgmap? I mean statement like: Numbers1=0,N,-1,-1,N,-1,-1,Płońsk,-1,-1,Skarżyn,-1,-1 -- Best regards, Andrzej

Hi Andrzej, I guess that works but Piotrs data is different. It has e.g. Numbers1=0,O,7,11,E,12,18 Numbers2=1,O,21,29,E,20,24 Numbers3=2,B,31,31,E,28,38 Numbers4=3,N,-1,-1,E,40,48 CityName=Teresin@Granice The doc shows that you can have up to three cities, and I've no idea how to decide which numbers belong to which city. I assume that the "multiple cities" stuff forces the GMP format, but I didn't try this. I just verified that my version of cGPSMapper also writes the GMP format for Piotrs input file. Maybe someone can analyse that in detail. The good thing is that we have a *.mp file and a GMP output. This should help to understand the GMP format. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej@poczta.onet.pl> Gesendet: Sonntag, 23. Oktober 2022 00:13 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] Indexing street belonging to two cities Hi Gerd,
I thought that mkgmap can handle roads with multiple cities but you seem to be right that this only works when the cities are encoded with the house numbers.
Actually in mp format you can encode void house numbers with 2 cities. Doesn't it work in mkgmap? I mean statement like: Numbers1=0,N,-1,-1,N,-1,-1,Płońsk,-1,-1,Skarżyn,-1,-1 -- Best regards, Andrzej _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd,
The doc shows that you can have up to three cities, and I've no idea how to decide which numbers belong to which city.
I guess the reasonable solution is to split "CityName" and assign all numbers to all cities. I have tested a bit my map and found that with 2 cities in "numbers" statement without house numbers, search index contains left city (first in statement) and combined city name (Left@Right) form "CityName" statement. Right city is missing.
The good thing is that we have a *.mp file and a GMP output. This should help to understand the GMP format.
This is not a true GMP format. This is an old MPC data packed as a GMP. I have discovered that it works and implemented conversion MPC->NT in GmapTool. Then I explained the idea to Staszek Kozicki and he implemented the same in cGPSmapper. You can convert any img using command line version of GMapTool like this: gmt -jxzo ntlike.img source.img MPC data consist of blocks TRE, RGN, LBL etc. Each block starts with a header and then data. Header contains pointers to data. GMP is similar. It starts with a GMP header, then it contains TRE, RGN, LBL, NET, NOD, DEM (sometimes more) headers and then all data. GMP header contains pointers to following headers. It is relatively easy pack old format as GMP. But it is not a real thing, since it doesn't use any features of NT maps. -- Best regards, Andrzej
participants (4)
-
Andrzej Popowski
-
Gerd Petermann
-
gpetermann_muenchen@hotmail.com
-
Piotr Wawrzyniak