GithubHelp home page GithubHelp logo

wouter1 / osm-garmin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openstreetmap/mkgmap

1.0 1.0 0.0 30.68 MB

Modified mkgmap's Subversion repository using mvn for build

Home Page: http://svn.mkgmap.org.uk/mkgmap

Makefile 0.05% Java 99.07% NSIS 0.14% HTML 0.42% Roff 0.03% XSLT 0.28%

osm-garmin's Introduction

OSM-Garmin

Tools to convert [openstreetmap.org OSM maps] to Garmin maps. Modified to get it building with maven.

Build both mkgmap and splitter with mvn clean package

The original, manuals other versions etc are on https://svn.mkgmap.org.uk/mkgmap/mkgmap. There is a github copy on https://github.com/openstreetmap/mkgmap

See the doc directories, readme and licence files in the modules for more details.

Sample Walkthrough

This example walkthrough shows how to compile an OSM map of your choice. It is assumed you have java8 sdk, maven, git installed already. This walkthrough assumes you want to use the "grey" style. Substitute "grey" with the style of your choice.

  1. Download this project
  2. cd osm-garmin
  3. mvn clean package
  4. download a YOURCOUNTRY pbf file from https://download.geofabrik.de to the working directory (root of osm-garmin)
  5. mkdir work
  6. java -jar splitter/target/splitter-412-jar-with-dependencies.jar --output-dir=work YOURCOUNTRY.osm.pbf
  7. java -jar mkgmap/target/mkgmap-4855-jar-with-dependencies.jar --family-id=35 --output-dir=work stylefiles/grey/style/typ/grey.txt work/*.pbf
  8. java -jar mkgmap/target/mkgmap-4855-jar-with-dependencies.jar --output-dir=work -c stylefiles/grey/grey_options --style-file=stylefiles/grey/style/grey work/*.pbf stylefiles/grey/style/typ/grey.typ

In command 8, the map will be built without sea. To incorporate sea in your final map if needed, you need to download the latest sea information as well and replace command 8 :

  1. go to https://www.mkgmap.org.uk/download/mkgmap.html and download the latest-sea.zip to your current directory
  2. java -jar mkgmap/target/mkgmap-4855-jar-with-dependencies.jar --output-dir=work -c stylefiles/grey/grey_options --style-file=stylefiles/grey/style/grey/ --precomp-sea=sea-latest.zip work/*.pbf stylefiles/grey/style/typ/grey.typ

Now a gmapsupp.img should be in your work dir, ready to be copied to the Garmin.

NOTE1 if you put multiple maps generated this way on your garmin, only one may show up. I think this is due to the name or id of the generated maps to be equal, causing a conflict.

NOTE2 Since 2022, to use the converted maps you seem to need software rev 9.2.9 on the Garmin Edge. Maybe some earlier versions work as well but 7.10 seems not, and most (or all) of the map will be invisible. The only explanation I can think of is that since early 2022 the OSM maps contain some new information. The new information seems correctly translated by this converter, but the older Edge software can not handle it.

osm-garmin's People

Contributors

wouter1 avatar

Stargazers

 avatar

Watchers

 avatar

osm-garmin's Issues

optimize "grey" style

There are a number of things to improve on this

  • farmland is now grey. Maybe better use something yellow-brownish?
  • Buildings now appear dark green. Better maybe something like grey or blueish
  • space between houses now brown. Better make this grey
  • Bike paths now are black lines. Need to be light grey or white
  • There are dashed purple-black lines, need to change the purple color it's too bright for wat seems an irrelevant item (need to check what it really si)
  • Why are there black lines along white roads. This reduces the visibility of the roads. Better leave out the black line and just have white line.
  • Sea now looks grey

NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer

Sorry bad title, it's getting late...
]
Current mkgmap does not work if you split and mkgmap a "real" map

java -jar ../mkgmap.jar --gmapsupp -c template.args 
Time started: Wed Jan 26 22:31:02 CET 2022
java.lang.NoSuchMethodError: java.nio.ByteBuffer.position(I)Ljava/nio/ByteBuffer;
	at uk.me.parabola.imgfmt.sys.ImgHeader.createHeader(ImgHeader.java:147)
	at uk.me.parabola.imgfmt.sys.ImgFS.createInitFS(ImgFS.java:372)
	at uk.me.parabola.imgfmt.sys.ImgFS.createFs(ImgFS.java:123)
	at uk.me.parabola.imgfmt.sys.ImgFS.createFs(ImgFS.java:102)
	at uk.me.parabola.imgfmt.app.map.Map.createMap(Map.java:99)
	at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:98)
	at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:56)
	at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:290)
	at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:1)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

grey style zoomout

If you zoom out on the grey style to the 2km level or further out, all area becomes grey. No area seems rendered at all., as hovering over the grey area does not show any area name ("grass", "built-up area") as usual. The roads and water appear fine but I'd like to see some rough outlines of city shapes

Error in style

I get an error when I try to convert the /home/wouter/Desktop/test/cyprus-latest.osm.pbf

Just doing the standard conversion works

But when trying to apply the opentopomap style options I get

 java -jar mkgmap.jar -c opentopomap_options --style-file=style/opentopomap --generate-sea --output-dir=output 6324*.pbf style/typ/opentopomap.typ 
Time started: Fri Jan 28 20:25:07 CET 2022
Error in style: Error: (points:145): Expecting ), instead saw landuse
Error in style: Error: (points:145): Expecting ), instead saw landuse
Could not open style 
Number of ExitExceptions: 1
Time finished: Fri Jan 28 20:25:08 CET 2022
Total time taken: 254 ms

This might also be an issue with the style file which I picked up from https://github.com/der-stefan/OpenTopoMap
I roughly did this

cd style/typ/
java -jar ../../mkgmap.jar --family-id=35 opentopomap.txt 
cd ../..
java -jar mkgmap.jar -c opentopomap_options --style-file=style/opentopomap --generate-sea --output-dir=output 6325*.pbf style/typ/opentopomap.typ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.