Newbie Map Creator

ajoessen is right - you need to start with OSM data (in XML or PBF format) if you want to apply a style using mkgmap. See also my workflow here:
http://www.cferrero.net/maps/step_by_step.html

Thanks for posting that, I will now download these batch files and try and run them through. No doubt I will be back with some more questions. :slight_smile:

Hi
Right, I started off by going to Geofabrik and downloaded the latest copy of england.osm.pbf 310,463KB
Then renamed it to gcc_20120104.osm.pbf
Placed the splitter.bat file in my splitter-r195 folder and ran it.
This is the log from my command prompt window

Enter year_month_day of latest OSM data or hit 1 to accept gcc_20120104.osm.pbf:
1
cache=./cache
description=
geonames-file=cities15000.zip
legacy-mode=false
mapid=63247001
max-areas=255
max-nodes=1500000
max-threads=2 (auto)
mixed=false
no-trim=false
output=pbf
output-dir=
overlap=2000
resolution=13
split-file=
status-freq=120
write-kml=
Elapsed time: 0s Memory: Current 15MB (1MB used, 14MB free) Max 483MB
Time started: Wed Jan 04 19:20:00 GMT 2012
Map is being split for resolution 13:

  • area boundaries are aligned to 0x800 map units
  • areas are multiples of 0x1000 map units wide and high
    Processing gcc_20120104.osm.pbf
    Bounding box -7.748030000000001 48.97894 2.361859 56.08932
    10,000,000 nodes processed… id=700993596
    20,000,000 nodes processed… id=1234745152
    1,000,000 ways processed… id=35806743
    2,000,000 ways processed… id=81214974
    3,000,000 ways processed… id=122727201
    in 1 file
    Time: Wed Jan 04 19:21:17 GMT 2012
    Exact map coverage is (48.978939056396484,-7.748022079467773) to (56.08930349349
    9756,2.3618459701538086)
    Trimmed and rounded map coverage is (48.9990234375,-7.7783203125) to (56.1181640
    625,2.3291015625)
    Splitting nodes into areas containing a maximum of 1,500,000 nodes each…
    Area (48.9990234375,-7.7783203125) to (52.2509765625,-3.5595703125) contains 1,0
    10,022 nodes. DONE!
    Area (48.9990234375,-3.5595703125) to (52.2509765625,-2.5048828125) contains 1,2
    80,269 nodes. DONE!
    Area (49.1748046875,-2.5048828125) to (50.8447265625,-1.0107421875) contains 569
    ,149 nodes. DONE!
    Area (50.8447265625,-2.5048828125) to (51.2841796875,-1.0107421875) contains 1,3
    33,501 nodes. DONE!
    Area (51.2841796875,-2.5048828125) to (51.7236328125,-1.0107421875) contains 850
    ,193 nodes. DONE!
    Area (51.7236328125,-2.5048828125) to (52.2509765625,-1.0107421875) contains 1,0
    20,917 nodes. DONE!
    Area (49.2626953125,-1.0107421875) to (51.1083984375,2.2412109375) contains 726,
    801 nodes. DONE!
    Area (51.1083984375,-1.0107421875) to (51.5478515625,-0.5712890625) contains 678
    ,115 nodes. DONE!
    Area (51.1083984375,-0.5712890625) to (51.5478515625,-0.1318359375) contains 1,0
    04,954 nodes. DONE!
    Area (51.1083984375,-0.1318359375) to (51.5478515625,0.3076171875) contains 759,
    315 nodes. DONE!
    Area (51.1083984375,0.3076171875) to (51.5478515625,2.3291015625) contains 789,7
    72 nodes. DONE!
    Area (51.5478515625,-1.0107421875) to (52.2509765625,-0.3955078125) contains 795
    ,405 nodes. DONE!
    Area (51.5478515625,-0.3955078125) to (52.2509765625,0.2197265625) contains 1,28
    6,042 nodes. DONE!
    Area (51.5478515625,0.2197265625) to (52.2509765625,0.8349609375) contains 757,3
    37 nodes. DONE!
    Area (51.5478515625,0.8349609375) to (52.2509765625,2.3291015625) contains 1,289
    ,869 nodes. DONE!
    Area (52.2509765625,-6.3720703125) to (53.3935546875,-2.5048828125) contains 561
    ,764 nodes. DONE!
    Area (52.2509765625,-2.5048828125) to (52.6025390625,-1.9775390625) contains 395
    ,921 nodes. DONE!
    Area (52.2509765625,-1.9775390625) to (52.6025390625,-1.5380859375) contains 1,3
    75,758 nodes. DONE!
    Area (52.6025390625,-2.5048828125) to (53.3935546875,-1.5380859375) contains 1,2
    53,716 nodes. DONE!
    Area (53.3935546875,-7.7783203125) to (55.5908203125,-2.7685546875) contains 800
    ,487 nodes. DONE!
    Area (53.3935546875,-2.7685546875) to (53.6572265625,-1.5380859375) contains 617
    ,643 nodes. DONE!
    Area (53.6572265625,-2.7685546875) to (54.1845703125,-1.5380859375) contains 1,0
    28,516 nodes. DONE!
    Area (54.1845703125,-2.7685546875) to (56.1181640625,-1.5380859375) contains 1,1
    64,307 nodes. DONE!
    Area (52.2509765625,-1.5380859375) to (52.6904296875,-0.3076171875) contains 604
    ,599 nodes. DONE!
    Area (52.6904296875,-1.5380859375) to (53.1298828125,-0.3076171875) contains 1,1
    60,427 nodes. DONE!
    Area (52.2509765625,-0.3076171875) to (53.1298828125,0.7470703125) contains 672,
    804 nodes. DONE!
    Area (52.2509765625,0.7470703125) to (53.1298828125,2.3291015625) contains 846,5
    23 nodes. DONE!
    Area (53.1298828125,-1.5380859375) to (53.6572265625,2.3291015625) contains 1,39
    5,349 nodes. DONE!
    Area (53.6572265625,-1.5380859375) to (55.8544921875,2.3291015625) contains 1,23
    5,248 nodes. DONE!
    Error opening or reading file java.io.FileNotFoundException: cities15000.zip (Th
    e system cannot find the file specified)
    java.io.FileNotFoundException: cities15000.zip (The system cannot find the file
    specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.(FileInputStream.java:138)
    at java.io.FileInputStream.(FileInputStream.java:97)
    at uk.me.parabola.splitter.Utils.openFile(Utils.java:86)
    at uk.me.parabola.splitter.geo.CityLoader.load(CityLoader.java:49)
    at uk.me.parabola.splitter.Main.nameAreas(Main.java:315)
    at uk.me.parabola.splitter.Main.split(Main.java:167)
    at uk.me.parabola.splitter.Main.start(Main.java:118)
    at uk.me.parabola.splitter.Main.main(Main.java:107)
    Time finished: Wed Jan 04 19:21:17 GMT 2012
    Total time taken: 76s
    Press any key to continue . . .

Seems like I’m missing something. Any help would be most appreciated. This is turning into a real challenge now!!

Yes, you’re missing the cities15000.zip file which you can get from here:
http://download.geonames.org/export/dump/

This contains coords for major cities around the world and means splitter can name each tile it creates according to the largest city it contains.

See also the bottom of
http://www.cferrero.net/maps/splitter_advanced.html (the bit about --geonames)

Thanks for that. Success, I have now split the england map…
Now for the next part.
Think I am having some path issues, I will explain my paths.
c:/mapping/mkgmap-r2148 is where I am running the next stage. At this level I have placed all the *.osm.pbf files along with
template.args, options_GCC_GPS.args (copied from your webpage), mkgmap.jar.
Style files etc are located c:/mapping/mkgmap-r2148/examples/styles/munky_styles (this is a style I found that should give me everything I am after) inside this folder is also the munky.typ file.
The first 30 lines of the mkgmap batch file look like this:

@echo off
REM Batch file to launch mkgmap and compile GCC basemap tiles
setlocal

REM set mkgmap version
set mkgmapVer=-r2148

REM set inputs
set stylefile=/examples/styles/munky_styles
set optionsFile=options_GCC_GPS.args

REM TYP file
set typfile=“/examples/styles/munky_styles/munky.typ”
rem set typfile=“…/…/TYP files/mapnik/mapnik2.TYP”

call :GETDATEPARTS “%date%”
call :GETTIMEPARTS

REM run mkgkap
@echo Running mkgmap

@echo on
rem enable logging properties
java -Xmx1500m -ea -Dlog.config=logging.properties -jar mkgmap.jar --style-file=%stylefile% -c %optionsFile% %typfile%
rem standard compile
REM java -Xmx1500m -ea -jar mkgmap.jar --style-file=%stylefile% -c %optionsFile% %typfile%
rem default style, no TYP
rem java -Xmx1500m -ea -jar mkgmap.jar -c %optionsFile%

@echo off
@echo mkgmap finished: copying gmapsupp

I have tried modifying some of the paths to hopefully match my set up.
Then when I run this is the log file:

C:\mapping\mkgmap-r2148>mkgmap.bat
Running mkgmap

C:\mapping\mkgmap-r2148>rem enable logging properties

C:\mapping\mkgmap-r2148>java -Xmx1500m -ea -Dlog.config=logging.properties -jar
mkgmap.jar --style-file=/examples/styles/munky_styles -c options_GCC_GPS.args “/
examples/styles/munky_styles/munky.typ”
Failed to open logging config file logging.properties
Could not open file: 63247001.osm.gznull
Exception in thread “main” java.lang.NullPointerException
at uk.me.parabola.mkgmap.combiners.FileInfo.getFileInfo(FileInfo.java:13
9)
at uk.me.parabola.mkgmap.main.Main.endOptions(Main.java:413)
at uk.me.parabola.mkgmap.CommandArgsReader.readArgs(CommandArgsReader.ja
va:126)
at uk.me.parabola.mkgmap.main.Main.main(Main.java:112)

C:\mapping\mkgmap-r2148>rem standard compile

C:\mapping\mkgmap-r2148>REM java -Xmx1500m -ea -jar mkgmap.jar --style-file=/exa
mples/styles/munky_styles -c options_GCC_GPS.args “/examples/styles/munky_styles
/munky.typ”

C:\mapping\mkgmap-r2148>rem default style, no TYP

C:\mapping\mkgmap-r2148>rem java -Xmx1500m -ea -jar mkgmap.jar -c options_GCC_GP
S.args
mkgmap finished: copying gmapsupp
The system cannot find the file specified.
Finished!!!
Press any key to continue . . .


So it seems like it fails to open logging config file logging.properties?

Sorry to be a pain with this, its a great example for someone who is struggling to get to terms with mapping, your splitter instructions and batch files were great and a massive help. I think I need to set my paths up to match your batch files and I guess we should be away.

The TYP-file should always be named xyz.TYP, not .typ. Thats a big difference for the Garmin unit!

But your current problem is:

which has to do with the script you use.

HTH,
ajoessen

That’s right - either you enable the standard compile mkgmap call (the one that is currently REMed out below the call you’re currently making) or you add a file called logging.properties to the working directory
http://www.cferrero.net/maps/downloads/logging.properties

I have made up my workflow wikout your scripts, and found out that I can use several config-files in the same call. So I put my mkgmap-commands in one, and the template.args from the splitter separately behind:


cd img
java -Xmx1500M -jar D:\Karten\OpenStreetMap\mkgmap\mkgmap.jar -c ..\myTopo.cfg -c ..\myTopo-osm\template.args ..\myTopo.TYP

I wonder if anyone else uses that method.

Greetings,
ajoessen

Hi
Pretty close now I think. I have now added logging.properties file. When I run I now get

C:\mapping\mkgmap-r2148>mkgmap.bat
Running mkgmap

C:\mapping\mkgmap-r2148>rem enable logging properties

C:\mapping\mkgmap-r2148>java -Xmx1500m -ea -Dlog.config=logging.properties -jar
mkgmap.jar --style-file=/examples/styles/munky_styles/ -c options_GCC_GPS.args "
/examples/styles/munky_styles/munky.TYP"
Could not open file: 63247029.osm.pbfnull
Could not open style /examples/styles/munky_styles/

C:\mapping\mkgmap-r2148>rem standard compile

Firstly it does not appear to be able to open 63247029.osm.pbf? Where is the “null” at the end of my file name coming from. Secondly, it does not appear to be able to load the style file which seems strange.
Massive learning curve going on here :slight_smile:

So splitter is splitting files and using names 63247001 onwards? And mkgmap has no problem until it gets to 63247029? Is that the last file? If so, make sure there is at least one empty line after it in your option_GCC_GPS.args file (i.e. the last line in that file should be empty about from a hard return) - that might be the source of the null issue. As far as not being able to open the styles file, there must be something wrong with your relative paths. Can you post your folder structure?

Oh, and try removing the trailing / from your definition of the style file path

I like that - I’ll probably integrate that into how I do things as it saves having to copy the details from the template.args whenever the split list changes.

Yes, that was a point that was annoying me. Here in Germany the number of tiles is increasing almost every week.

Greetings,
ajoessen

cool, I didnt know this mkgmap option, I used this in a windows script:
type parameters\mkgmap.args > %argsfile%
type parameters\template.args >> %argsfile%
type parameters\contours.args >> %argsfile%

So this thread is also for a not-so-newbie interesting :wink:

And how did you get the splitter to output in mkgmap.args and contours.args?
I let him split in different folders to avoid overriding template.args.

(Just to ask a question by myself :wink: )

Greetings,
ajoessen

The only file that varies is the template.args file that the splitter produces, the mkgmap.args and contour.args are every update basically the same (unless you want to change it of course).
Contour files I only have to make once and after that you can feed those img’s into the workflow, so you dont need to split them again and again. Of course those tiles dont match anymore with your osm tiles so a better way would be to merge them with the osm data before the splitter process, but thats another discussion.

Does it really matter if the contour tiles don’t exactly match the road tiles? I’m sure I’ve worked in the past with non-overlapping tiles without a problem.

It doesnt matter, but maybe ajoessen can comment on this why he splits contours and osm data:

I think it is a better way to integrate them into one map so you dont have overlapping tiles anymore (confusing for the user).
If you have separate tiles on the other hand, the user can decide whether include contours or not in the gmapsupp.
Like a famous Dutch football player quotes, every disadvantage has its advantages :wink:

Off course I do the contour splitting only once for a specific region. Renaming that template.args might also work. I keep the contour osm.gz in a seperate folder, but the img all togeher in one, so they can be used in baseCamp.

I dont like integrating the contours in the main osm data. For my region I have 7 contour tiles and 27 OSM-tiles.
The first I dont have to compile in future runs. Putting the data together will also make the tile areas even smaller, leading to problems with cross-tile-routing.

While planning a days walking trip, I build a seperate map only for that area, which needs only one osm tile and one contour tile. That way the Garmin unit is easier to handle instead of a nation-wide Map.
For that workflow osm and contours have to be run every time, as the area changes.

Greetings,
ajoessen

@ajoessen: you mentioned earlier in this thread that the TYP extension from the typfile should be in capitals, but I see no problems with typ in lowercase letters. Is this not working good in a specific unit or OS?

It works on BaseCamp and QLandkaretGT, but on the Garmin unit it will not be recognized. You will get a map with standard Garmin type lines and POIs. If your typfile is not much away from that, you might not see it.

Greetings,
ajoessen