["PATCH" v1] Housenumber search for OSM data

Hi all, I have implemented a first prototype to support housenumber search for OSM input data. This is already possible for polish format but not for OSM. Don't expect anything when trying the patch but I wanted you to take part on the first small steps of the housenumber integration. This is what the patch does: 1. Collect all nodes and ways/polygons tagged with addr:housenumber and addr:street 2. Collect all roads 3. For all elements collected in 1. get the closest road with equal name 4. Attach the housenumbers to the first routing segment of the road. Yes that's wrong - but at the moment I don't know how to forecast in which routing segments the road will be divided. Warning: The patch is a quick hack (~4 hours). It's undocumented. It's unperformant. It's mostly untested. ... But it's the first time one can search for housenumbers with OSM as input :-) Thanks Steve for implementing the new feature housenumber search! WanMil

Hi WanMil, sounds promising, so I tried it with niedersachsen data (split with --max-nodes=1600000) , but I get an assertion error: java -ea -jar d:\mkgmap_trunk\dist\mkgmap.jar --max-jobs \ --bounds=f:\osm\bounds_20121118.zip --location-autofill=is_in,nearest \ --route -c template.args Time started: Thu Feb 14 22:21:17 CET 2013 java.lang.AssertionError: initial value is not positive: 0 at uk.me.parabola.imgfmt.app.net.NumberPreparer.writeInitialValue(NumberPreparer.java:165) at uk.me.parabola.imgfmt.app.net.NumberPreparer.fetchBitStream(NumberPreparer.java:69) at uk.me.parabola.imgfmt.app.net.RoadDef.writeNet1(RoadDef.java:203) at uk.me.parabola.imgfmt.app.net.NETFile.write(NETFile.java:66) at uk.me.parabola.mkgmap.build.MapBuilder.makeMap(MapBuilder.java:219) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:97) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:61) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:201) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:198) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Let me know if you need more data. Gerd -- View this message in context: http://gis.19327.n5.nabble.com/PATCH-v1-Housenumber-search-for-OSM-data-tp57... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Thanks Gerd, the patch is in such an early state that I do not need to reproduce. The code will be changed completely so searching for bugs will start later on :-) WanMil
Hi WanMil,
sounds promising, so I tried it with niedersachsen data (split with --max-nodes=1600000) , but I get an assertion error: java -ea -jar d:\mkgmap_trunk\dist\mkgmap.jar --max-jobs \ --bounds=f:\osm\bounds_20121118.zip --location-autofill=is_in,nearest \ --route -c template.args
Time started: Thu Feb 14 22:21:17 CET 2013 java.lang.AssertionError: initial value is not positive: 0 at uk.me.parabola.imgfmt.app.net.NumberPreparer.writeInitialValue(NumberPreparer.java:165) at uk.me.parabola.imgfmt.app.net.NumberPreparer.fetchBitStream(NumberPreparer.java:69) at uk.me.parabola.imgfmt.app.net.RoadDef.writeNet1(RoadDef.java:203) at uk.me.parabola.imgfmt.app.net.NETFile.write(NETFile.java:66) at uk.me.parabola.mkgmap.build.MapBuilder.makeMap(MapBuilder.java:219) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:97) at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:61) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:201) at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:198) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
Let me know if you need more data.
Gerd
-- View this message in context: http://gis.19327.n5.nabble.com/PATCH-v1-Housenumber-search-for-OSM-data-tp57... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi WanMil
I have implemented a first prototype to support housenumber search for OSM input data. This is already possible for polish format but not for OSM.
Wow, that is great! To answer your question in the earlier posting. The way I imagined it working (when writing the numbers) is that you would fill in the nodeNumber and then that is converted to an "rnodNumber" later on. It should be possible to do so in the later reaches of the addRoadWithoutLoops() method, but that is a method that could do with a lot of splitting up. ..Steve

Hi WanMil
I have implemented a first prototype to support housenumber search for OSM input data. This is already possible for polish format but not for OSM.
Wow, that is great!
To answer your question in the earlier posting. The way I imagined it working (when writing the numbers) is that you would fill in the nodeNumber and then that is converted to an "rnodNumber" later on.
It should be possible to do so in the later reaches of the addRoadWithoutLoops() method, but that is a method that could do with a lot of splitting up.
..Steve
Hi Steve, I have improved my patch. It's working quite great. Beside the bad performance it seems to be rather ready to commit... :-) I have now distributed the housenumbers to the correct road segments. I found out that the routing nodes are always of type CoordNode. So I assume that each segment between two CoordNodes can be assigned with one Numbers object. Correct? The rnodNumber is the index of the CoordNode within the points list of the MapRoad object. That's working well. I do not know if it is possible that some of the CoordNodes are removed in the further processing? So I could also try to fill in the nodeNumber (is that the id of the CoordNode?) and then let you do the rest :-) Gerd posted an assertion. It's thrown if a housenumber is 0. Is that allowed in the garmin format or do I have to filter it out? I guess I have to filter out that. WanMil

Hi WanMil
I have improved my patch. It's working quite great. Beside the bad performance it seems to be rather ready to commit... :-)
This is great news. I shall have to do some mapping in my area so I can try it out properly!
I have now distributed the housenumbers to the correct road segments. I found out that the routing nodes are always of type CoordNode. So I
Yes that is right, once the node conversion is done the routing nodes have type CoordNode and you can also identify them by getId()!=0
assume that each segment between two CoordNodes can be assigned with one Numbers object. Correct? The rnodNumber is the index of the CoordNode within the points list of the MapRoad object. That's working well. I do
Yes that it right.
not know if it is possible that some of the CoordNodes are removed in the further processing? So I could also try to fill in the nodeNumber (is that the id of the CoordNode?) and then let you do the rest :-)
Well perhaps, the order that things happen in is unclear and could do with tidying up or documenting.
Gerd posted an assertion. It's thrown if a housenumber is 0. Is that allowed in the garmin format or do I have to filter it out? I guess I have to filter out that.
Can housenumbers be 0 in the real world! I'd say not, so filter. I'll check if 0 actually works though and fix if so. ..Steve

Hi
Gerd posted an assertion. It's thrown if a housenumber is 0. Is that allowed in the garmin format or do I have to filter it out? I guess I have to filter out that.
I've now fixed the crash when there is a number zero. Nothing bad happens in the map. It doesn't display the number zero, but you get the number 2 just a bit further along the road as though the 0 is there but just invisible. ..Steve
participants (3)
-
GerdP
-
Steve Ratcliffe
-
WanMil