| | 1 | # <img height="40" width="40" src="resources/images/logo.svg" title="JOSM logo"/> JOSM - Java OpenStreetMap Editor |
| | 2 | |
| | 3 | JOSM is an extensible editor for [OpenStreetMap](https://www.openstreetmap.org/) (OSM) for Java 8+. It supports loading |
| | 4 | GPX tracks, background imagery, and OSM data from local sources as well as from online sources and allows to edit the |
| | 5 | OSM data (nodes, ways, and relations) and their metadata tags. |
| | 6 | |
| | 7 | |
| | 8 | ## I. Install & Launch |
| | 9 | |
| | 10 | ### Installation notes |
| | 11 | |
| | 12 | To run JOSM, you need: |
| | 13 | |
| | 14 | * The JOSM .jar file, e.g. `josm-tested.jar` or `josm-latest.jar` |
| | 15 | * Java Runtime Environment (JRE) 8, or later |
| | 16 | |
| | 17 | |
| | 18 | ### How to get Java Runtime Environment |
| | 19 | |
| | 20 | You need JRE Version 8, or later. |
| | 21 | |
| | 22 | - **Microsoft Windows** and **Apple macOS** users should visit https://www.java.com and |
| | 23 | download the latest Java executable for their system. |
| | 24 | - **Linux** users should visit http://www.oracle.com/technetwork/java/index.html There is a Linux binary installer, |
| | 25 | which you must execute from a console, or use the mechanism of your distribution's packaging system. |
| | 26 | |
| | 27 | |
| | 28 | ### How to launch |
| | 29 | |
| | 30 | - **Microsoft Windows** users launch by double-clicking on the .jar file. |
| | 31 | If this does not work, open a command shell and type |
| | 32 | ```shell |
| | 33 | java -jar josm-latest.jar |
| | 34 | ``` |
| | 35 | in the directory that holds the file. (Please replace josm-latest.jar with the name of your .jar file, |
| | 36 | if you aren't using the latest version.) |
| | 37 | |
| | 38 | - Under **Linux**, open a shell, go to the file directory and type |
| | 39 | ```shell |
| | 40 | java -jar josm-latest.jar |
| | 41 | ``` |
| | 42 | to launch. If this does not work, try to set your `JAVA_HOME` variable to the java executable location (the |
| | 43 | root location, not the bin). |
| | 44 | |
| | 45 | - **macOS** users just click on the .jar file icon. |
| | 46 | |
| | 47 | |
| | 48 | ## II. Development |
| | 49 | |
| | 50 | ### How to get the source code |
| | 51 | |
| | 52 | Download it directly from the subversion at |
| | 53 | https://josm.openstreetmap.de/svn/trunk. To use the command line subversion |
| | 54 | client, type |
| | 55 | ```shell |
| | 56 | svn co https://josm.openstreetmap.de/svn/trunk josm |
| | 57 | ``` |
| | 58 | |
| | 59 | |
| | 60 | ### Files & directories |
| | 61 | |
| | 62 | This is an overview of the files and directories in the JOSM code repository: |
| | 63 | ``` |
| | 64 | - build.xml ant build file (standard way to create a JOSM binary) |
| | 65 | - CONTRIBUTION list of major code contributors |
| | 66 | - gpl-2.0.txt, gpl-3.0.txt full text of the GNU General Public License |
| | 67 | - LICENSE the JOSM license terms |
| | 68 | - native/ OS-specific files |
| | 69 | - linux/ files useful for Linux distributions, including Appdata files, .desktop |
| | 70 | files, Debian/Ubuntu scripts, man pages, icons, etc. |
| | 71 | - macosx/ files needed to create the MacOS package |
| | 72 | - windows/ files needed to create the Windows installer |
| | 73 | - josm.jnlp Java Web Start launcher file (used on the website for the tested version) |
| | 74 | - josm-latest.jnlp Java Web Start launcher file (used on the website for the latest version) |
| | 75 | - nodist/ files not included in JOSM binary |
| | 76 | - data/ data files that are useful for development, but not distributed |
| | 77 | - exif-direction-example.jpg |
| | 78 | sample image, that contains direction information in the EXIF header |
| | 79 | (keys: Exif.GPSInfo.GPSImgDirectionRef, Exif.GPSInfo.GPSImgDirection) |
| | 80 | - filterTests.osm used for unit testing of the filter feature |
| | 81 | (see test/unit/org/openstreetmap/josm/data/osm/FilterTest.java) |
| | 82 | - Join_Areas_Tests.osm some examples to test the 'join areas' feature |
| | 83 | - *.* various other data files used for unit testing and as reference file |
| | 84 | - projection/ projection files |
| | 85 | - *.gsb NTv2 grid files for projection support, downloaded by the |
| | 86 | client on demand (see CONTRIBUTION) |
| | 87 | - CHENyx06-Distribution.pdf |
| | 88 | archive of terms of use for the CHENyx06.gsb file |
| | 89 | - epsg EPSG data file, taken from the proj.4 project |
| | 90 | (see https://github.com/OSGeo/proj.4/blob/master/nad/epsg) |
| | 91 | - esri ESRI data file, taken from the proj.4 project |
| | 92 | (see https://github.com/OSGeo/proj.4/blob/master/nad/esri) |
| | 93 | - josm-epsg customizations to the epsg file, used together with the epsg file |
| | 94 | to generate data/projection/custom-epsg |
| | 95 | |
| | 96 | - projection-reference-data.csv |
| | 97 | reference data for projection tests |
| | 98 | (see test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java) |
| | 99 | - projection-regression-test-data.csv |
| | 100 | regression data for projection tests |
| | 101 | (see test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java) |
| | 102 | - trans/*.lang translation data for files that are not distributed, but used |
| | 103 | by the server for localization of the services; |
| | 104 | currently contains plugin descriptions in order to include translations |
| | 105 | in the downloaded plugin list |
| | 106 | - images/ images, which are not for distribution, but may be useful later (e.g. high |
| | 107 | resolution and vector versions) |
| | 108 | - styles/ files needed for map style maintenance |
| | 109 | - potlatch2/README infos on how to update the Potlatch 2 style from upstream sources |
| | 110 | - README this file |
| | 111 | - resources/ resource files that will be included in the JOSM jar file |
| | 112 | - data/ data files that will be included in the JOSM jar file |
| | 113 | - fonts/ font files used for map rendering |
| | 114 | - gpx/ different color gradients for gpx drawing |
| | 115 | - projection/ projection files |
| | 116 | - custom-epsg list of projection definitions, auto-generated file created by ant task 'epsg' |
| | 117 | - security/*.pem certificates that we like to accept for TLS connections, but are missing in the |
| | 118 | default Java certificate store |
| | 119 | - validator/ data files used by the JOSM validator |
| | 120 | - *.cfg files designed for the old tagchecker, still in use |
| | 121 | - *.mapcss default validation rules for the MapCSS-based tagchecker |
| | 122 | - boundaries.osm OSM file containing boundary data for the states of the earth, including |
| | 123 | data for right and left-hand traffic |
| | 124 | - defaultpresets.xml data file for the core tagging presets |
| | 125 | - help-browser.css CSS file for the help sites (HTML content is downloaded from the website |
| | 126 | on demand, but displayed inside the programm in a Java web browser component.) |
| | 127 | - *.lang translation data |
| | 128 | - *.xsd xml schema files for validation of configuration files |
| | 129 | - images/ images distributed with the JOSM binary |
| | 130 | - icons images for the Potlatch 2 style |
| | 131 | - presets images for the main mappaint style and the internal presets |
| | 132 | - styles/ map styles included in JOSM |
| | 133 | - scripts/ various scripts used by JOSM developers |
| | 134 | - BuildProjectionDefinitions.java |
| | 135 | called from the ant build file to combine the files epsg and josm-epsg |
| | 136 | to create the custom-epsg file for distribution |
| | 137 | - geticons.pl tool to find all used icons and allows deleting unused icons |
| | 138 | searches also for images with incompatible svg code |
| | 139 | - optimize-images short script to decrease size of PNG images |
| | 140 | - since_xxx.py developer tool to replace "@since xxx" in Javadoc by the upcoming revision number |
| | 141 | - SyncEditorLayerIndex.java |
| | 142 | script to compare and analyse the differences of the editor layer index and the |
| | 143 | JOSM imagery list (see https://josm.openstreetmap.de/wiki/ImageryCompare) |
| | 144 | - TagInfoExtract.java extracts tag information for the taginfo project |
| | 145 | - src/ the source code of the application |
| | 146 | - start.html HTML page to run the applet version of JOSM |
| | 147 | - test/ automated software tests |
| | 148 | - data/ resources used for some tests |
| | 149 | - functional/ functional tests (source code) |
| | 150 | - lib/ libraries needed for (some of) the tests, including JUnit |
| | 151 | - performance/ performance tests (source code) |
| | 152 | - unit/ unit tests (source code) |
| | 153 | - tools/ libraries, tools and configuration files that help in the development process |
| | 154 | - checkstyle/ libs and config files for checkstyle (automatically detects code style |
| | 155 | problems in source code); can be launched as an ant target in build.xml |
| | 156 | - eclipse/ preconfigured Eclipse configuration files |
| | 157 | - ivy/ Apache Ivy binary, configuration file, and downloaded dependencies |
| | 158 | - jacocoant.jar used to include coverage data into JUnit test reports |
| | 159 | - japicc/ used to generate a compatibility report between optimized jar and normal one |
| | 160 | - netbeans/ preconfigured Netbeans project |
| | 161 | - pmd/ config files for PMD (source code analyzer, finds common programming flaws) |
| | 162 | - spotbugs/ libs and config files for spotbugs (automatically detects common bugs and potential |
| | 163 | problems in source code); can be launched as an ant target in build.xml |
| | 164 | ``` |
| | 165 | |
| | 166 | |
| | 167 | ### Third party libraries |
| | 168 | |
| | 169 | There are some third party libraries which are directly included in the source code tree, in particular: |
| | 170 | |
| | 171 | * jmapviewer `src/org/openstreetmap/gui` ([svn external](https://josm.openstreetmap.de/osmsvn/applications/viewer/jmapviewer/)) |
| | 172 | * Java component to browse a TMS map |
| | 173 | * Apache commons compress ([github](https://github.com/apache/commons-compress)) |
| | 174 | * Support for bzip2 compression when opening files |
| | 175 | * Apache commons validator `src/org/openstreetmap/josm/data/validation/routines` ([apache](http://commons.apache.org/proper/commons-validator)) |
| | 176 | * Improved validator routines |
| | 177 | * SVG Salamander ([github](https://github.com/blackears/svgSalamander)) |
| | 178 | * Support for SVG image format |
| | 179 | * Metadata Extractor ([github](https://github.com/drewnoakes/metadata-extractor)) |
| | 180 | * Read EXIF Metadata of photos |
| | 181 | * Signpost ([github](https://github.com/mttkay/signpost)) |
| | 182 | * OAuth library |
| | 183 | * MultiSplitPane `src/org/openstreetmap/josm/gui/MultiSplitLayout.java, MultiSplitPane.java` ([github](https://github.com/floscher/multi-split)) ([oracle](https://community.oracle.com/docs/DOC-983539)) |
| | 184 | * Small lib for GUI layout management |
| | 185 | * swinghelper `src/org/openstreetmap/josm/gui/util/CheckThreadViolationRepaintManager.java` ([github](https://github.com/floscher/swinghelper)) |
| | 186 | * Class CheckThreadViolationRepaintManager to find EDT violations |
| | 187 | * xz extractor ([website](https://tukaani.org/xz/java.html)) |
| | 188 | * OpeningHoursParser (MIT license) ([github](https://github.com/simonpoole/OpeningHoursParser)) |