osm2mp.pl: OSM -> Polish format converter

Sockeye, it is possible in new version of osm2mp, which is not released yet.
Configuration file format has been completely changed.

You can get current development version from svn: http://code.google.com/p/osm2mp/

Hi Liosha,

good to hear you are continuing to develop this great program as i use it on a regular basis to create the Magellan OSM maps. Is there the chance to include the possibilty to get the information on routes which only contain relations to ways?

e.g. I would like to create a bicycle map, containing all bicycle routes, with the ways all of one type and (re)named to the name of the route. (Also mtb, hiking etc)

Btw. how can I access the code of the current development? I do not find any download possibilities on the link you provided.

Thanks and best regards,
Sockeye

This is not ready yet

Look at ‘Source’ section

Never mind. I wrote a .NET soultion for this, creating these relations as addintional data for overlay maps.

As for the next update of osm2mp, when do you plan your next release?

BR
Sockeye

Hello Sockeye,

do you plan to offer your .NET solution to the community?

hello Liosha,
I´m looking for somthing like this (a bycicle map for the CompeGPS Aventura) . I tried a little with osm2mp.pl (0.90.a) but it´s a little strange if, I try this:

(http://gafner.net/dokuwiki/doku.php?id=aventura:kartenerstellung:anleitungen:osm-vectormap-2)
osm2mp.pl --nocodepage --cfgpoi nopoi.cfg --cfgpoly routepoly.cfg YOUR_MAP.osm > YOUR_MAP_routes.mp

the result is:
Unknown option: cfgpoi
Unknown option: cfgpoly

juson, osm2mp versions 0.9* has new yaml-based features style format, and doesn’t support old .cfg files.
You should convert .cfg files to new format, or use 0.8* instead.

Sockeye, i hope i’ll release it soon, but until then you can get latest revision from svn, it’s quite stable already

Hello Liosha,

is there a description, how version 0.9* work with parameters?

Thanks in advance

juson, i haven’t written any
But you can see example configuration files, they are quite easy.
And feel free to ask, of course :slight_smile:

Hi,
I am trying to make a map for my Garmin Quest and am new to this.
Refering back to some earlier posts that did no get answers. I too am getting an empty .mp file.
Any help greatly appreciated.
Thanks.
Chris.

Emeraldboy,
you better use mkgmap to create garmin maps. It is simpler and better documented.
You should use osm2mp+cgpsmapper only when you need it’s features that mkgmap doesn’t support yet, such as address search.

Thanks Liosha I will try mkgmap. Why am I getting an empty file? Looks like lots of errors when I run the managemaps.bat. I put all the files in the mapmanager dir and entered my map name and pasted in the url. I installed Perl with the packages and .Net4 but not playing ball. I will keep trying for a bit as I do not like to be beaten! Thanks for your help and this useful forum.
Chris.

I want to convert a osm file into a mp file by using osm2pm but I can not figure out how to do it. I tried to find an explanation on running osm2pm for a beginner for a couple of hours but I was not successful. I have installed a perl and tried the following command for the converstion.
c:\perl d:\osm2mp.pl d:\map.osm >map.mp
In d:, there were files, osm2mp.pl and map.osm.

It did not, however, work out and only produced an error message, "Can’t locate Template.pm in @INC… "

What are the correct way to do the conversion or where can I get an explanation for it?

Suggest you try ActivePerl if you haven’t. I found it’s installer and library managers are easier for a beginner than Strawberry Perl. If you track the error messages carefully, you will get a list of math modules you need that don’t come with the basic Perl package.

Thank Seldom for your suggestions.

I track the error message and installed the missing file Template.pm and ran osm2mp again by using the same perl command. However, again I got again an error message saying that another file was missing.

I also changed the Perl from Strawberry to Active but the result was the same.

It gives me a feeling that this not the way I can be successful with. Maybe I need to study Perl? What I want to do, however, is simply converting an osm file into a mp file, I wonder whether I really need to do so. Also I wonder whether by getting some knowdledge on Perl I would be able to successfully do the conversion.

Would you give me a recommendation?

I’m running Win7. When I installed ActivePerl I also got an app called Perl Package Manager.
I install OSM2MP.pl in the same folder as the OSM file I want to convert.
As you run OSM2MP you will get a series of error messages identifying missing library components. Browse for them with Perl Package Manager and install them. It may take a few tries, but eventually you will find all the packages you need.
It might be easier to open OSM2MP.pl in a text editor use the Package Manager to find the “required packages” listed at the start of the file.

Oh, it was great, finally I succeeded the conversion !!
Seldom, your comments of PPM(Active manager), finding required packages from the start of the file, and installig OSM2MP.pl in the same folder as the OSM file for conversion were critical to me.

I appreciate your help.

I summarize the tips for the converion work by using osm2mp for a beginner like me.

  1. Download osm2mp package (http://garminmapsearch.com/osm/osm2mp_v080.zip)
  2. Downaload Active Perl (http://www.perl.org/get.html ) and PPM(Perl Package Manager: http://search.cpan.org/~murray/PPM-2.1.9/bin/ppm.pl))
  3. Install Active Perl first, then PPM
  4. Open osm2mp.pl in a text editor and locate the list of the required packages at the top of the file.
  5. Run PPM by entering the command ‘ppm’ in the Command Window of Windows. Be sure that the computer is in connection with the Internet.
  6. At the ‘View all packages’ winfow of PPM, locate the required but uninstalled packages and put them to the action file list by clicking the package name, pressing the right button and selcting “install ….”
  7. Select “File”-“Run Marked Actions”
  8. Exit the PPM
  9. Put the osm file to convert to the directory of osm2mp package.
  10. In the Command Window of Windows, change the current directory to the directory of osm2mp package by the command, CD
  11. Run the following command
    osm2mp.pl map.osm > m1.mp

The options of osm2mp.pl can be listed by the command,
osm2mp.pl >list.txt

Glad it worked.

Can I ask for explanation what %name parameters can be used
in yml files.
Example:

  • condition:
    • building = *
      action:
    • action: write_polygon
      type: 0x13
      Label: %house

I found %house, %label and guessed %street

Second question is how to use values from other xml tags. (addr:city for example)

Regards

Michal

Hello Liosha,
I finally succeeded converting a .osm extract to .mp; I opened the file with MapEdit and then exported it to Navitel .nm2 format; I was happy with the process, but when I tried to open the file in Navitel 5.5.0.1, I see no map and after restarting Navitel, the message “Generating Maps” stays there forever. Is there something I am doing wrong? I am seeing all the data correctly displayed in MapEdit (ver 1.0.66.7); even the addresses and building numbers. So, it looks like the process of converting the .osm data into .mp is done correctly. Any ideas on this? I’ll greately appreciate any help on this.
Thanks for your work!

Hi Liosha,

Thank you for your great osm2pm.pl! It’s helping me a lot with maps for 7ways. I need your help with a problem I’m having here (Brazil). It seems that some long roads are not being split by osm2pm.pl, despite using max_road_nodes=N, and I added the condition in bold as an workaround. It seems to fix my problem and I can now convert the resulting mp to 7w, but I’m not sure if t’s OK. Would please comment on that? Also, I didn’t understand what the first condition below does, I’d much appreciate if you could explain that.

            elsif ( $rnod == 1 + $values->{max_road_nodes} // 999 ) {
                $countlong ++;
                $break = $prev;
                push @breaks, $break;
                $rnod = 2;
            }

** elsif ( ($i % 2000 ) == 0 ) {
$countlong ++;
$break = $i;
push @breaks, $break;
$rnod = 2;
}
**

Thanks in advance,
– Fidelis Assis