Coder Social home page Coder Social logo

osmimport_02's Introduction

osmimport_02

This processes a GPX file from a Garmin GPS, and generates unique track files from it, each containing all of the new waypoints in the GPX.

The waypoint handling allows an extract of "places to go" to be sent to the GPS beforehand, with places visited removed from the list on the GPS (by renaming the first letter of the place from "S" to "D").

Waypoints renumbered by a previous run of this routine will have a name such as XYYnnnnnn where "X" is an initial letter, "YY" is a "2-letter abbreviation" for a series of waypoints (such as a long distrance trail) and "nnnnnn" is a unique number.

Waypoints with an intiial "S" or "V" are assumed to be existing "places to visit" and aren't added to the produced track files.

Waypoints named "D" or "E" are assumed to be "ticked off" places - they're included, and a GPX file on disk starting "base_data" is updated with their details.

Waypoints named something else are assigned a new number depending on their type - green ones (which I use for "places where paths meet that don't need a future survey") are numbers "DTRnnnnnn"; red and blue ones ("places where paths meet that do need a future survey") Syynnnnnn, where "yy" is geographically derived from hardcoded internal values; most others "DOAnnnnnn". The exception to the "DOA" rule is where "-t=ZZ" is passed on the command line - in this case a file on disk SZZ_yyyymmdd_hhmmss.gpx is created or updated (where yyyymmdd_hhmmss is the current date and time).

In each case the number "nnnnnn" is read from a file.

New Garmin waypoints will tend to be a 3-digit number such as "123". It's also possible to pass a description file containing lines such as:

123 More information than can be entered in a Garmin GPS comment

This extra information is appended to the waypoint in the resulting track files ready for upload to OSM.

Example command line:

java -jar c:\Utils\osmimport_02.jar -c=c:\Temp\osm\cntr.txt -d=c:\temp\osm\20140525a.eml -k=c:\temp\osm\ -i=c:\temp\osm\20140525b.gpx -t=RH -b=5

This means use "c:\Temp\osm\cntr.txt" as the counter file, use "c:\temp\osm\20140525a.eml" as the description file containing comments and "c:\temp\osm\20140525b.gpx" as the input GPX containing Waypoints, Routes and Tracks. "-t=RH" means that a file SRH_yyyymmdd_hhmmss.gpx will be created (using the current data and time) incorporating any new "Trail" points ("-t" is interpreted as "Trail") and also the contents of the most recent existing SRH_yyyymmdd_hhmmss.gpx file. "-b=5" is just the level of debug output produced (the higher the number, the more verbose).

Building

Originally (many years ago) this was built within Eclipse - files such as the .jardesc describe how this works.

To build locally from the command line with e.g. OpenJDK:

cd src
javac -Xlint:deprecation uk/org/atownsend/osmimport_02/*.java
jar cmvf META-INF/MANIFEST.MF ../osmimport_02.jar  uk/org/atownsend/osmimport_02/*class

To test that the resulting .jar file runs:

java -jar ../osmimport_02.jar

That won't do anything as there are no command line arguments, but it will confirm that the manifest in the .jar is working correctly.

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.