18 | | javaws [run-options] -J[Java option] josm.jnlp |
19 | | }}} |
20 | | |
21 | | |
22 | | === Program arguments ===#Programarguments |
23 | | |
24 | | Also called ''Post jar arguments'' here or ''args'' by Oracle. |
25 | | |
26 | | The first argument is seen as ''command'' by JOSM. The possible commands are `runjosm` for normal launch (default), `render` for generating an image file and `project` converting coordinates. If JOSM can't recognize a command the default is assumed. |
27 | | |
28 | | The following arguments are ''options'' for JOSM. They are separated by spaces. They can be URLs, filenames, coordinates, simple options and option=argument pairs. The complete list of commands and options is shown below: |
| 18 | javaws [Run-options] -J[Java option] josm.jnlp |
| 19 | }}} |
| 20 | |
| 21 | The [wikitr:/Help/Action/ShowStatusReport Status Report] from the Help menu lists the given Program arguments and Java options. |
| 22 | Some [#Examples examples⤓] for both of them are shown below. |
| 23 | |
| 24 | **Note:** The term {{{josm.jar}}} is a common abbreviation for the file names ''josm-tested.jar'' and ''josm-latest.jar''. |
| 25 | The term ''josm.jnlp'' also stands for ''josm-latest.jnlp''. |
| 26 | As usual the command line arguments are separated by space from each other. |
| 27 | |
| 28 | |
| 29 | == Program arguments for JOSM ==#Programarguments |
| 30 | |
| 31 | The first argument can be a **command** for JOSM to make it work autonomous. |
| 32 | The commands are `render`, `project` or `runjosm` as default. |
| 33 | |
| 34 | The remaining arguments are **options** for JOSM. |
| 35 | They can be URLs, filenames, coordinates, simple options and option=value pairs. |
| 36 | |
| 37 | The options for runjosm are listed in the following. |
| 38 | At the bottom are the options for the commands [#Programargumentsrendering render⤓] and [#Programargumentsproject project⤓]. |
43 | | --help|-h Show this help |
44 | | --geometry=widthxheight(+|-)x(+|-)y Standard unix geometry argument |
45 | | [--download=]minlat,minlon,maxlat,maxlon Download the bounding box |
46 | | [--download=]<URL> Download the location URL which has |
47 | | coordinates like lat=x&lon=y&zoom=z |
48 | | [--download=]<filename> Open a file (same as Menu/File/Open) |
49 | | --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS |
50 | | --downloadgps=<URL> Download the location as raw GPS |
51 | | --selection=<searchstring> Select with the given search |
52 | | --[no-]maximize Launch in maximized mode |
53 | | --reset-preferences Reset the preferences to default |
54 | | --load-preferences=<url-to-xml> Import preferences from XML file |
55 | | --set=<key>=<value> Set preference key to value |
56 | | --language=<language> Set the language |
57 | | --version Displays the JOSM version and exits |
58 | | --debug Print debugging messages to console |
59 | | --skip-plugins Skip loading plugins |
60 | | --offline=[osm_api,][josm_website,][all] Disable access to the listed resources |
61 | | }}} |
62 | | |
63 | | The `--download=` part of the download option is optional. |
| 54 | --help|-h Show this help |
| 55 | --geometry=widthxheight(+|-)x(+|-)y Standard unix geometry argument |
| 56 | [--download=]minlat,minlon,maxlat,maxlon Download the bounding box |
| 57 | [--download=]<URL> Download the location at the URL (with lat=x&lon=y&zoom=z) |
| 58 | [--download=]<filename> Open a file (any file type that can be opened with File/Open) |
| 59 | --downloadgps=minlat,minlon,maxlat,maxlon Download the bounding box as raw GPS |
| 60 | --downloadgps=<URL> Download the location at the URL (with lat=x&lon=y&zoom=z) as raw GPS |
| 61 | --selection=<searchstring> Select with the given search |
| 62 | --[no-]maximize Launch in maximized mode |
| 63 | --reset-preferences Reset the preferences to default |
| 64 | |
| 65 | --load-preferences=<url-to-xml> Changes preferences according to the XML file |
| 66 | |
| 67 | --set=<key>=<value> Set preference key to value |
| 68 | |
| 69 | --language=<language> Set the language |
| 70 | |
| 71 | --version Displays the JOSM version and exits |
| 72 | |
| 73 | --status-report Show status report with useful information that can be attached to bugs |
| 74 | |
| 75 | --debug Print debugging messages to console |
| 76 | |
| 77 | --skip-plugins Skip loading plugins |
| 78 | |
| 79 | --offline=<OSM_API|JOSM_WEBSITE|CACHE_UPDATES|CERTIFICATES|ALL> |
| 80 | Disable access to the given resource(s), separated by comma |
| 81 | <OSM API|JOSM website|Cache updates|Certificates|All> |
| 82 | }}} |
| 83 | |
| 84 | The `--download=` part of the download option is optional. |
69 | | === Java options ===#Javaoptions |
70 | | |
71 | | The Java options are also called ''JOSM JVM options'' here or ''VM arguments'' in the [wiki:/Help/Action/ShowStatusReport Status Report]. In that report you can see them and also the Program Arguments. They control the Java virtual machine [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html (JVM)] and can set [https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html properties] inside it. JOSM reads some of them, for example `josm.home` and `user.language`. |
72 | | {{{ |
73 | | java options: |
74 | | -Djosm.dir.name=JOSM Change the JOSM directory name |
75 | | -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory |
76 | | Default: C:\Users\name\AppData\Roaming\JOSM |
77 | | -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory |
78 | | Default: /home/name/.local/share/JOSM |
79 | | -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory |
80 | | Default: <...> |
81 | | -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, |
82 | | user data and ./cache/. Lower precedence. |
83 | | Will get overridden from specific setting. |
84 | | -Xmx...m Set maximum Java heap size in megabytes. |
85 | | May avoid Out-of-Memory errors. |
86 | | }}} |
87 | | |
88 | | The `-Xmx...m` option may be useful when [wiki:/Download#Outofmemory Out of Memory] errors arise. |
89 | | If you set a common directory with `Djosm.home` then JOSM will create the subdirectories ''./autosave'', ''./cache'' and ''./validator''. |
| 90 | == Java options ==#Javaoptions |
| 91 | |
| 92 | They control the Java virtual machine [https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html (JVM)] and can set [https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html properties] inside it. JOSM reads some of them directly, for example `josm.home`. Others like `user.language` and `user.country` affect the default settings of the JVM which affect JOSM too. |
| 93 | |
| 94 | {{{ |
| 95 | Java system properties options: |
| 96 | -Djosm.dir.name=JOSM Change the JOSM directory name |
| 97 | -Djosm.pref=/PATH/TO/JOSM/PREF Set the preferences directory |
| 98 | Default (Linux XDG): /home/name/.config/JOSM |
| 99 | Default (Windows): C:\Users\name\AppData\Roaming\JOSM |
| 100 | -Djosm.userdata=/PATH/TO/JOSM/USERDATA Set the user data directory |
| 101 | Default (Linux XDG): /home/name/.local/share/JOSM |
| 102 | Default (Windows): C:\Users\name\AppData\Roaming\JOSM |
| 103 | -Djosm.cache=/PATH/TO/JOSM/CACHE Set the cache directory |
| 104 | Default (Linux XDG): /home/name/.cache/JOSM |
| 105 | Default (Windows): C:\Users\name\AppData\Local\JOSM\cache |
| 106 | -Djosm.home=/PATH/TO/JOSM/HOMEDIR Set the common directory for preferences, |
| 107 | user data and ./cache/. Lower precedence. |
| 108 | Will get overridden from specific setting. |
| 109 | -Xmx...m Set maximum Java heap size in megabytes. |
| 110 | May avoid Out-of-Memory errors. |
| 111 | }}} |
| 112 | |
| 113 | The `-Xmx...m` option may be useful when [wikitr:/Download#Outofmemory Out of Memory] errors arise. |
| 114 | If you set a common directory with `Djosm.home` then JOSM will create the subdirectories ./autosave, ./cache and ./validator. |
142 | | |
143 | | }}} |
144 | | Deleting temporary files will delete JNLP based icons from the Desktop too. |
145 | | |
146 | | |
147 | | === See also === |
148 | | * [wiki:Download#Troubleshooting Troubleshooting Java] |
149 | | * [wiki:InstallNotes Installation notes] |
150 | | * [wiki:Help/Preferences Preferences] - overview page about all "preferences" |
| 183 | }}} |
| 184 | |
| 185 | == Command line for Render and Project == |
| 186 | |
| 187 | === JOSM rendering Program arguments ===#Programargumentsrendering |
| 188 | |
| 189 | {{{ |
| 190 | Usage: |
| 191 | java -jar josm.jar render <options> |
| 192 | |
| 193 | Description: |
| 194 | Renders data and saves the result to an image file. |
| 195 | |
| 196 | Options: |
| 197 | --help|-h Show this help |
| 198 | --input|-i <file> Input data file name (.osm) |
| 199 | --output|-o <file> Output image file name (.png); defaults to 'out.png' |
| 200 | --style|-s <file> Style file to use for rendering (.mapcss or .zip) |
| 201 | This option can be repeated to load multiple styles. |
| 202 | --setting <key>:<value> Style setting (in JOSM accessible in the style list dialogue right click menu) |
| 203 | Applies to the last style loaded with the --style option. |
| 204 | --zoom|-z <lvl> Select zoom level to render. (integer value, 0=entire earth, 18=street level) |
| 205 | --scale <scale> Select the map scale |
| 206 | A value of 10000 denotes a scale of 1:10000 (1 cm on the map equals 100 m on the ground; display resolution: 96 dpi) |
| 207 | Options --zoom and --scale are mutually exclusive. |
| 208 | --bounds|-b auto|<min_lon>,<min_lat>,<max_lon>,<max_lat> |
| 209 | Area to render, default value is 'auto' |
| 210 | With keyword 'auto', the downloaded area in the .osm input file will be used (if recorded). |
| 211 | --anchor <lon>,<lat> Specify bottom left corner of the rendering area |
| 212 | Used in combination with width and height options to determine the area to render. |
| 213 | --width-m <number> Width of the rendered area, in meter |
| 214 | --height-m <number> Height of the rendered area, in metres |
| 215 | --width-px <number> Width of the target image, in pixels |
| 216 | --height-px <number> Height of the target image, in pixels |
| 217 | --projection <code> Projection to use, default value 'epsg:3857' (web-Mercator) |
| 218 | --max-image-size <number> Maximum image width/height in pixel ('0' means no limit), default value: 20000 |
| 219 | |
| 220 | To specify the rendered area and scale, the options can be combined in various ways: |
| 221 | * --bounds (--zoom|--scale|--width-px|--height-px) |
| 222 | * --anchor (--width-m|--width-px) (--height-m|--height-px) (--zoom|--scale) |
| 223 | * --anchor --width-m --height-m (--width-px|--height-px) |
| 224 | * --anchor --width-px --height-px (--width-m|--height-m) |
| 225 | If neither 'bounds' nor 'anchor' is given, the default value --bounds=auto takes effect and the bounds of the download area in the .osm input file are used. |
| 226 | |
| 227 | Examples: |
| 228 | java -jar josm.jar render -i data.osm -s style.mapcss -z 16 |
| 229 | josm render -i data.osm -s style.mapcss --scale 5000 |
| 230 | josm render -i data.osm -s style.mapcss -z 16 -o image.png |
| 231 | josm render -i data.osm -s elemstyles.mapcss --setting hide_icons:false -z 16 |
| 232 | josm render -i data.osm -s style.mapcss -s another_style.mapcss -z 16 -o image.png |
| 233 | josm render -i data.osm -s style.mapcss --bounds 21.151,51.401,21.152,51.402 -z 16 |
| 234 | josm render -i data.osm -s style.mapcss --anchor 21.151,51.401 --width-m 500 --height-m 300 -z 16 |
| 235 | josm render -i data.osm -s style.mapcss --anchor 21.151,51.401 --width-m 500 --height-m 300 --width-px 1800 |
| 236 | josm render -i data.osm -s style.mapcss --scale 5000 --projection epsg:4326 |
| 237 | }}} |
| 238 | |
| 239 | === JOSM projection Program arguments ===#Programargumentsprojection |
| 240 | |
| 241 | {{{ |
| 242 | Usage: |
| 243 | java -jar josm.jar project <options> <crs> +to <crs> [file] |
| 244 | |
| 245 | Description: |
| 246 | Converts coordinates from one coordinate reference system to another. |
| 247 | |
| 248 | Options: |
| 249 | --help|-h Show this help |
| 250 | -I Switch input and output crs |
| 251 | -r Switch order of input coordinates (east/north, lon/lat) |
| 252 | -s Switch order of output coordinates (east/north, lon/lat) |
| 253 | |
| 254 | <crs>: |
| 255 | The format for input and output coordinate reference system is similar to that of the PROJ.4 software. |
| 256 | |
| 257 | [file]: |
| 258 | Reads input data from one or more files listed as positional arguments. When no files are given, or the filename is "-", data is read from standard input. |
| 259 | |
| 260 | Examples: |
| 261 | java -jar josm.jar project +init=epsg:4326 +to +init=epsg:3857 <<<"11.232274 50.5685716" |
| 262 | => 1250371.1334500168 6545331.055189664 |
| 263 | |
| 264 | java -jar josm.jar project +proj=lonlat +datum=WGS84 +to +proj=merc +a=6378137 +b=6378137 +nadgrids=@null <<EOF |
| 265 | 11d13'56.19"E 50d34'6.86"N |
| 266 | 118d39'30.42"W 37d20'18.76"N |
| 267 | EOF |
| 268 | => 1250371.1334500168 6545331.055189664 |
| 269 | -1.3208998232319113E7 4486401.160664663 |
| 270 | }}} |
| 271 | |
| 272 | |
| 273 | == See also == |
| 274 | * [wikitr:/Download#Troubleshooting Troubleshooting Java] |
| 275 | * [wikitr:/InstallNotes Installation notes] |
| 276 | * [wikitr:/Help/Preferences Preferences] - Preferences overview |
| 277 | |
| 278 | ---- |
| 279 | Back to [wikitr:/Help Main Help] |