Really nice script.
I noticed one bug in the newest version though(An old version I used before did it correctly), some roads where getting random “no bicycle, no car, no etc…” tags
I solved this problem by changing
Hi Liosha, and thank you for the great job you do on routed maps.
You are using Template.pm module since few days. And when I run osm2mp (v0.60r19) it fails on Template.pm
Can’t locate Template.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at F:\David\OSM\Tools\osm2mp_v060r19\osm2mp.pl line 66.
BEGIN failed–compilation aborted at F:\David\OSM\Tools\osm2mp_v060r19\osm2mp.pl line 66.
Beside, could you please switch from DOS linebreaks (cr/nl) to unix breaks? The DOS breaks cause that it’s not possible to make the osm2mp.pl file executable on linux and just run it:
hanno@libertalia ~/osm/routing/osm2mp-read-only/osm2mp $ ./osm2mp.pl
-bash: ./osm2mp.pl: /usr/bin/perl^M: bad interpreter: Datei oder Verzeichnis nicht gefunden
first of all “Thank You” for the great script you wrote. I found that --fixclosenodes does not work correctly in all cases as cgpsmapper still detects a couple of too close nodes. As far as I can tell the closenodes() function is implemented correctly. My guess for the cause is that nodes are only checked and corrected in pairs: Assume that node 1 is too close to both node 2 and node 3. First the distance to node 2 ist corrected and then the distance to node 3. The second correction might push node 1 closer to node 2 again.
As a workaround I tried to execute the correction repeatedly in order to slowly push all conflicting nodes further apart until everything is fixed. However, it seems that this does not work. Either it converges only very slowly or certain node constellations are cycled through in a circular way. Unfortunately, I am not very good at perl so that I can’t try anything more sophisticated.
i tried your script and it works great but only with small areas. It worked with the state of saxony (a german state) and most other german states, but if i try Germany as a whole it crashes with some memory errors. Do you what i can do to fix this?
Ok, the resulting .mp file was also converted by cgps-mapper and MapSource shows it and can calculate routes and i’m able to transfer them with MapConverter onto my Mac.
But a problem arises for me:
If i create maps for every german state, i can show only one of the maps and also routing is possible inside one map only. How can i link or unify more maps to one bigger map? I know it should work with sendmap, but there i need img files while cgpsmapper created directories.
I don’t think our current tools are able to identify the roads that cross different tiles. So currently you could use GPSMapEdit to add the necessary information to the map images. This is described in the wiki.
That’s an old posting before liosha’s script was available
My solution to the routing across tiles problem is more of a hack, rather than a solution. I use osmosis to split my OSM data into tiles, and the connecting nodes of the splitted roads are manually tagged as “garmin:is_external_node=true” (they are currently not that many in OSM Malaysia). In liosha’s script I added a conditional statement that will change the nod values for these connecting nodes (see http://forum.openstreetmap.org/viewtopic.php?pid=13274#p13274)
My previous tests shows that it works when the tiles are square (the connecting nodes are all at tile borders). I’m not sure how it’ll work if the tiles are irregular as in the shape of a state or country. Had a plan to experiment on this but haven’t got started yet
It’d be great if osmosis or any tile splitter tool can automatically tag the connecting nodes as such, rather than doing a major overhaul of your current tools.
Oh ok, but it’s about the same method as described on the mkgmap/routing page.
Tagging nodes as routing node manually is out of the question for me. It should be done automatically or it doesn’t work
If the tools are good at detecting edge nodes then irregular shapes should also work imho.
Yes, that would be awsome, but until now neither Osmosis as well as Osmcut are able to split tiles properly (let ways continue right onto the edge and insert dummy nodes on the edge). That’s why every Garmin map created with OSM tools shows gaps in the roadnetwork near tileborders.