osm2mp.pl: OSM -> Polish format converter

Hi, I am having trouble using osm2mp_v065. When I try to convert the the osm file to mp I am having the following error:

Code In Terminal:
perl osm2mp.pl default.osm > file.mp

Error:

Can’t locate Template.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at osm2mp.pl line 88.
BEGIN failed–compilation aborted at osm2mp.pl line 88.

I am using Ubuntu 9.04. Any one has an idea what to do?

http://wiki.openstreetmap.org/wiki/Osm2mp

10x very much. it worked.

Hi all!

I’ve updated osm2mp, current version is 0.7 :sunglasses:
http://garminmapsearch.com/osm/osm2mp_v070.zip

  • added address search capability
  • updated turn restriction processing
  • basic coastline processing
  • many improvements and fixes

Address search works only for streets this time (not for house numbers).
Cities should have bound ways tagged “place=city/town” and “place_name=…”, like these:
http://openstreetmap.org/browse/way/30350510
http://openstreetmap.org/browse/way/25706594

Some screenshots:

Hello

I am having issue with always getting empty .mp file.

I run osm2mp.pl file.osm > file.mp

This is what I get:

Processing file file.osm

Loading nodes… 103746 loaded, 419 POIs dumped
Loading relations… 7 multipolygons, 0 turn restrictions
Loading cities… 20 loaded
Processing ways… 13462 roads and 0 coastlines loaded
145 lines and 33 polygons dumped
Merging roads… 386 merged
Detecting road nodes… 26070 found
Detecting duplicates… 72 segments, 11 roads
Splitting roads… 245 self-intersections, 3 long roads
Fixing close nodes… 41 pairs fixed
Writing roads… 13324 written
Writing restrictions… 0 written
All done!!

I creates file.mp but it has 0 size. What could be the issue?

thanks

Hi Liosha,

I have a little issue with roads and railroads, when they use the same nodes. Only the railways are generated.
Do you have an idea how to solve it?

Thanks and best regards,
Sockeye

Sockeye,
Do you have one way tagged highway=…, railway=… or two different ways?

liosha

I do not map myself. I just create the maps for Magellan users.

This issue uccurs when one Way is tagged with multiple values. The road on the image above is tagged in the following way:

  <way id="9584322" visible="true" timestamp="2009-03-16T21:59:04Z" version="6" changeset="819593" user="BiIbo" uid="3516">
    <nd ref="25681709"/>
    <nd ref="25682189"/>
    <nd ref="308532399"/>
    <nd ref="361218579"/>
    <nd ref="308532398"/>
    <nd ref="21262900"/>
    <nd ref="25664661"/>
    <tag k="name" v="Delnická"/>
    <tag k="highway" v="residential"/>
    <tag k="railway" v="tram"/>
  </way>

There are many roads with a centerline Tram, which are tagged this way.

Best regards,
Sockeye

this time only one object in .mp can be created for one way. in your case: road OR rails.
type is selected according to “type priority” in poly.cfg

highway         residential             r       0x06,2          0       1       2,0,0,0,0,0,0,0,0,0,0,0
                                                    ^^^
railway         tram                    l       0x14            0       1

many thanks liosha,

I now know how I can influence it. I prefer the roads…:slight_smile:

BR
Sockeye

liosha,

do you see a chance to change the way of processing “ways”.

I now use new hardeware (i7, 12GB RAM) to process larger OSM files. Processing of the ways of a 6GB file takes about 6hours. When I check the resources, only on core is at 100% the seven other cores are idle…

Possibly this could be changed, if your script could spawn child processes, which could be processd by each cpu…

Thanks and best regards,
Sockeye

Hi!

Maybe this is trivial for experienced users,
but I personal do not get osm2mp.pl (0.72a) working (Vista 64bit, ActivePerl 5.10.0.1005). Allthough I installed necessary packages by ppm (in ppm there is only ‘Math-Geometry-Planar-GPC’ available), conversion stops with following error message:
Can’t locate Math/Geometry/Planar.pm in @ing (@ing contains: C:/Perl64/site/lib C:/Perl64/lib .) at D:\ […] \osm2mp.pl line 16 …
With older versions of osm2mp.pl (i.e. 0.70a, XP 32bit) there are no problems: result looks fine and is very, very useful.

Any hint is garateful expected, Thanks in advance!

unfortunately PPM doesn’t install Math-Geometry-Planar, you need to install it manually.
http://search.cpan.org/~dvdpol/Math-Geometry-Planar-1.16/Planar.pm
see README file

many thanks liosha for your fast reply.

I tried to install manually some times, but really I don’t know excactly what to do. There are to many messages like: ‘Warning: prerequiste … not found’
Will use older version of osm2mp instead. ;-(

Hi all!

I’ve released new version of osm2mp: http://gpsmapsearch.com/osm/osm2mp_v075.zip

Main additions:

  • sea polygons from coastlines
  • custom-shape background (basic)
  • POIs of polygon objects
  • some minor updates (addressing, character conversion)

Screenshots:

Those sea areas look awesome when you’re used to those sealess maps we had up till now. Nice work!

I’ve released new version of osm2mp: http://gpsmapsearch.com/osm/osm2mp_v080.zip

Main additions:

  • advanced multipolygons support
  • routing: barriers support, vehicle-dependent turn restrictions, removing “parasite” U-turns
  • new objects: destination signs (garmin), building entrances (navitel), basic marine data (garmin)
  • better address search and in-city roads processing
  • lot of minor improvements

Hi there!
I’ve a problem trying to convert 3GB osm file. I’ve Mac with 8GB, I tweaked ulimit, but it still doesn’t work for me, i get an error - out of memory. Any ideas?

Nighthare, use any tile splitter to make smaller osm-files.

Hi liosha,

I have three ways I need to distinguish

Way 1

=> 0x0003

Way 2

=> 0x0004

Way 3

=> 0x0005


If I set in the following parameters in the “poly.cfg”

surface paved r 0x0004,2

all ways with “surface” “paved” are converted in 0x0004 also Way 1

is there any possibility to assign different mp types dependant on the combination of two tags?

Thanks and best regards
Sockeye