Coder Social home page Coder Social logo

notes01's Introduction

Notes01

With the "-do_notes" command line argument it obtains the opening comments of "notes" from OSM from within a bounding box and creates a small file from them that will fit on a Garmin eTrex.

With the "-do_fixmes" command line argument it obtains "fixme" tags for nodes and ways from the Overpass API.

Although the notes API http://wiki.openstreetmap.org/wiki/API_v0.6#Map_Notes_API supports a "notes.gpx" endpoint that allows a GPX file to be downloaded directly, it's not formatted in a way that can be understood by old Garmin GPSs.

Building

If you don't want to just download one of the releases, you can import it into Eclipse if you want to (although, given that it's only a couple of .java files, there's really no need to). If you're not using an IDE, install a JDK (e.g. from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html), then just ensure that the javac that you have just installed is on the PATH, and javac Notes01.java in order to create Notes01.class. Notes01Test.class contains some unit tests and isn't needed to export notes.
You can either java Notes01 ... or export Notes01.jar. A build.xml file is also provided for ant users - ant build will create the .jar file. To include support for the unit tests in the jar, place a junit.jar and a hamcrest jar into the "lib" directory and use ant buildtest instead.

Usage examples

java -jar Notes01.jar -do_notes -bbox=-1.2022,53.1365,-1.1882,53.1435 -output_gpx=notes.gpx

This obtains only open notes from the OSM live API in this bounding box:

http://tools.geofabrik.de/calc/#type=geofabrik_standard&tab=1&bbox=-1.2022,53.1365,-1.1882,53.1435

and creates a GPX file of them which can then be uploaded to a Garmin GPS via either Mapsource or gpsbabel:

gpsbabel -i gpx -f notes.gpx -o garmin -F usb:

Because the number of characters that can be included in Garmin eTrex notes is limited, only the first line is used, so note 57081 becomes:

<wpt lat="53.141339" lon="-1.1949134">
<name>S N0057081</name>
<cmt>this area of land has been turned into a car park</cmt>
<desc>this area of land has been turned into a car park</desc>
<sym>Shipwreck</sym>
</wpt>

The name is currently hardcoded to "S N" + the note number and the default Garmin symbol used is "Shipwreck".

Other supported parameters include -notes_symbol=W (to use Garmin symbol W), -notes_limit=X (to change the download limit from the API default of 100) to X, -notes_closed=Y (to download also notes closed in the last Y days), -output_txt= (to output a text file as well to complement the short Garmin comments) and -notes_display_name=Z (to download only notes opened or commented on by the user with display name Z). Only valid Garmin symbols without spaces in (such as Shipwreck or Forest) are currently supported. Therefore:

java -jar Notes01.jar -do_notes -bbox=-1.2022,53.1365,-1.1882,53.1435 -notes_symbol=Forest -notes_closed=7 -notes_limit=3 -notes_display_name=SomeoneElse -output_gpx=notes2.gpx -output_txt=notes2.txt

This obtains up to 3 notes (open, and those closed in the last 7 days) from the OSM live API in the same bounding box, opened or commented on by user "SomeoneElse". It writes a GPX file that can be sent to a Garmin device and also a text file that you can e.g. also email yourself for reference.

java -jar Notes01.jar -do_fixmes -bbox=-1.2022,53.1365,-1.1882,53.1435 -notes_symbol=Forest -output_gpx=notes2.gpx -output_txt=notes2.txt

Similar to the above, but creates waypoints for nodes with "fixme" tags and for the first node of each way that has a fixme tag. It doesn't process differently spelt tags (e.g. FIXME or Fixme) and doesn't process relations with "fixme" tags.

Supported Parameters

-input=some_input_file.txt

Process notes from an input file Notes XML previously obtained from a server rather than making an API call.

-output_gpx=some_output_file.gpx

Specifies an output file name for the GPX file to be sent to the device.

-output_txt=some_output_file.txt

Specifies an output file into which a text about the notes can be written. Designed to be printed out or emailed, it contains more information than the GPX because it's not subject to the size limits of GPX (or GPI) comments.

-do_notes

Fetch OSM notes from the specified API and process them

-do_fixmes

Fetch OSM "fixme" tags from http://overpass-api.de/api/ and create waypoints for nodes with fixme tags, and the last node of every way that has a fixme tag.

-notes_display_name="Some User Name"

Specifies a user's display name to search for notes created by. It will be URLencoded before being passed to the API

-notes_uid=112

Specifies a user's userid to search for notes created by.
Useful for when display names change, or when they contain characters that can't easily be passed from the command line.

-notes_dev

Use the dev server (api06.dev.openstreetmap.org) instead of the live one to retrieve OSM notes from.

-debug=0

A number between 0 and 8, used to control the amount of debug written to stdout as processing occurs.
The higher the number, the more debug.

-notes_closed=0

Specifies the number of days a bug needs to be closed to no longer be returned. Defaults to 0.

-notes_limit=100

Specifies the maximum number of entries returned. A value of between 1 and 10000 is valid; 100 is the default.

-notes_symbol=Forest

Specifies the symbol to use when creating Garmin waypoints.

-bbox=-2.123,52.809,-0.331,53.521

The bounding box to check notes and fixmes against, in normal OSM format (west, south, east, north).

notes01's People

Contributors

someoneelseosm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

notes01's Issues

SAXParseException

After starting the jar with
java -jar Notes01.jar -do_notes -bbox=-22.09033,64.04443,-21.63253,64.18436 -output_gpx=notes-Reykjavik.gpx
I get the following output:

[Fatal Error] :1:50: White spaces are required between publicId and systemId.
Exception in thread "main" org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 50; White spaces are required between publicId and systemId.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
        at Notes01.process_notes_url_common(Notes01.java:1046)
        at Notes01.process_notes(Notes01.java:1092)
        at Notes01.main(Notes01.java:1605)

I use the release version from 2016-08-14.
Maybe the api changed since then?
It would be great if I could use this downloader but I am not able to fix this myself.

Hi i have a problem

If the GPX, created with Notes01, has waypoints with something like <--> or


, it is impossible to open this GPX with some other programs like routeconverter, kmarble and maybe basecamp.

is it possible to remove this tags with your tool?

sorry for my bad english, it isn't my native language

Bernd

Incomplete notes in GPX file

Hi,

I build my notes.gpx using

java -jar Notes01.jar -do_notes -bbox=9.5,46.5,11.5,48.5 -output_gpx=notes.gpx -closed=0 -notes_limit=10000 -notes_symbol='Flag, Red'

I noticed that many of the notes nearby have several comments but only the original note gets displayed on my Garmin Oregon.

Here a few examples:
S N0137713 reads only "baerenseetrails gämgige bezeichnung" on the Oregon

but on OSM you also find my additional comment
https://www.openstreetmap.org/note/137713#map=17/47.85785/10.66210&layers=N

Ich weiß nicht ob das eine gängige Bezeichnung ist.
Wenn man da mit dem Mountainbike unterwegs ist trifft es allerdings den "Nagel auf den Kopf"

same problem with notes Nr. 528872 , 524705 and many others

Shouldn't the answering comments also be added to the GPX file ?

Ciao,
Franco

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.