Zh-hans:JOSM

From OpenStreetMap Wiki
(Redirected from Cn:JOSM)
Jump to navigation Jump to search
JOSM
JOSM 17013 screenshot en.png
作者:
执照: GNU General Public License
平台: Windows、​ Linux和 macOS
版本: 18822 Changelog (2023-08-30)
语言: 阿斯图里亚斯语、​保加利亚语、​加泰罗尼亚语、​巴倫西亞語、​捷克语、​丹麦语、​德语、​希腊语、​英语、​加拿大英语、​澳大利亚英语、​英国英语、​西班牙语、​爱沙尼亚语、​巴斯克语、​芬兰语、​法语、​加利西亚语、​匈牙利语、​印度尼西亚语、​意大利语、​日语、​高棉语、​书面挪威语、​荷兰语、​波兰语、​葡萄牙语、​巴西葡萄牙语、​俄语、​斯洛伐克语、​瑞典语、​土耳其语、​乌克兰语、​乌兹别克语、​中文(简体)和繁体中文
网站: http://josm.openstreetmap.de
源代码: http://josm.openstreetmap.de/svn/trunk
编程语言: Java

离线的高度可扩展地图编辑器

JOSM Screenshot, showing the geo-tagged images feature.
JOSM Screenshot with (outdated) landsat.jar and mappaint.jar plugin.

JOSM 是一个由 Immanuel Scholz 开发和 Dirk Stöcker 维护的基于Java的"Java Open Street Map Editor"。 本地图编辑软件的主页在http://josm.openstreetmap.de/, 你可以在这里下载

Download josm-tested button.png
josm-tested.jar JOSM 稳定版
josm-latest.jar 最新的开发版
java web-start 在网页上直接启动
josm-setup.exe Windows Installer

你应该选择什么编辑器

除了JOSM外,还有其他地图编辑软件可以编辑OpenStreetMap的数据, 例如Potlatch在线编辑软件或者Merkaartor. 那么到底什么时候应该使用JOSM什么时候应该使用其他的地图编辑软件呢?恩,JOSM是一个给有经验的OSM地图制作人员使用的功能众多的编辑软件。在使用它之前,你需要安装和配置。但如果你想成为一个“万人景仰”的OSM地图制作者,花些时间去熟悉JOSM是很值得的。

你可以用这个离线地图编辑器做以下的工作:

  • 改变大范围的地图数据。
  • 不想你的改动立即生效(只是测试)。
  • 在记录航迹的同时拍了照片,而且你想看看他们是在对应航迹的什么地方照的。
  • 因为你正在修改的一个区域正好现在也有人在修改,你想使用离线编辑工具。JOSM支持整合和解决改变区域的冲突(记得每次上载之前要先下载)。

这些情况不适用于JOSM:

  • 你只是想更改一条街道的名字,那么你可以使用网站提供的在线编辑器。
  • 你不想安装一个应用程序。
  • 你所处的网络环境JOSM不能正常工作,在防火墙后(公司内)。现在可以支持http的代理,相信在大多数公司的防火墙后也可以正常使用。
  • 你的电脑不符合以下软硬件需求。

运行JOSM的软硬件需求

为了能够运行JOSM,你使用的电脑需要以下配置:

  • Java 8或者更高的版本(现在Java 1.5还不支持Mac OS X 10.3, JOSM在OS X 10.4上运行正常)
  • 至少256 MB 内存
  • 显示器分辨率1024*768以上(800*600是不足够的)
  • 一个带2D加速的显卡。如果显卡只支持OpenGL, 请设置
    -Dsun.java2d.opengl=true
    如果你使用以上设置有问题(false图标和background, dialog。在WinXP + nVidia FX1500 + 双显示器上测试) 使用:
    -Dsun.java2d.opengl=true -Dsun.java2d.opengl.fbobject=false

还请注意,opengl选项可能会在Linux上的window managers发生问题。

下载和安装

要运行JOSM你的电脑需要先安装Java 8以上的运行环境。遗憾的是,暂时还没有支持Mac OS 10.3.x的Java 1.5。

然后你只需要在主页下载JOSM的jar文件。

有很多人已经开始改进JOSM, 所以你可以找到有很多插件。While the main JOSM trunk is at http://josm.openstreetmap.de/, you can download modified versions of JOSM, plugins or external tools that enhance JOSM.

安装Java

首先请确认你的电脑上已经安装了Java运行环境。

Linux

Ubuntu
  • 输入:
    $ sudo aptitude install sun-java6-jre
Debian "pure"
  • 输入 (使用root):
    $ apt-get install sun-java6-jre

注意: 如果你还安装了其他的JVM。你需要指定sun java vm的执行路径(/usr/lib/jvm/java-6-sun/java)或者使用"update-java-alternatives -s java-6-sun"更新系统配置。

Gentoo

标准安装:

emerge josm

If you are interested in latest josm-development and plugins use the OpenStreetMap Gentoo Overlay. By using the "x86"-keyword you get a stable release, the "~x86"-keyword installs the svn-version.

There are many plugins already available as ebuilds. Look at https://svn.openstreetmap.org/applications/utils/gentoo/ for a complete list.

openSUSE

JOSM packages are available in the openSUSE's build service, in the home:rodrigomoya repository:

zypper ar http://download.opensuse.org/repositories/home:/rodrigomoya/openSUSE_10.3
zypper ref
zypper in josm

Windows

  • 从这里安装Java运行环境: Java SE

Mac OS X

  • OS X 10.4以上的版本已经包括了Java 1.5。

JOSM插件

JOSM/Plugins页面中有一个JOSM插件的列表。同时JOSM Wiki中也有一个列表。安装方法如下:

Linux & Mac OS X

  • 请先安装Java运行环境
  • 如要安装插件,请保存于~/.josm/plugins(例如/home/$USER/.josm/plugins/wmsplugin.jar

Windows

  • 如果没有安装过,请先安装Java运行环境.
  • 对于最新版本的JOSM (2007年4月),将插件放置于一下路径C:\Documents and Settings\你的用户名\Application Data\JOSM\plugins

运行JOSM

The jar file needs to be passed to the Java 1.5 runtime. This step is different to the various platforms:

Linux

Just type java -jar josm.jar in a shell. There are also some tutorial videos. One describes the steps to set up KDE for starting JOSM by clicking on the JAR file. Get the tutorials from one of the mirrors listed at openstreetmap.de.

Ubuntu users have a good tutorial at UbuntuForums.

If you need to use it from behind a proxy, you can tell it to the java runtime like java -Dhttp.proxyHost=192.168.1.1 -Dhttp.proxyPort=3128 -jar josm.jar, with the IP and port of your proxy.


If you need ipv6, you can tell it to the java runtime with -Djava.net.preferIPv6Addresses=true

e.g. java -Djava.net.preferIPv6Addresses=true -Dhttp.proxyHost=proxy.ipv6.uni-leipzig.de -Dhttp.proxyPort=3128 -jar josm/josm-snapshot-xxx.jar

The proxy here is only mentioned because the openstreetmap-server doesn't support ipv6 yet.

Windows

一般来说,你只需要双击josm.jar文件就可以运行JOSM软件.

在某些情况下,如果双击不能运行,你就需要创建一个简单的文本文件(文件名字为:start_JOSM.bat,或者任意你喜欢的以.bat结尾的文件)。文件内容只需要包含以下简单的一行:

java -jar josm.jar

然后把这个bat文件保存在和josm.jar同一个目录下。现在你就可以通过执行这个bat文件来运行JOSM了。

You can also set up a shortcut to the JOSM.jar file which allows the inclusion of additional parameters. I have the following as the short cut "Target" in my Start Menu which starts a control prompt window (useful to see progress of uploads/downloads), loads JOSM in its separate window, and assigns 512mb of memory for the process which dramatically speeds up operation when editing dense data. Change "path" to the full path of your josm-latest.jar file.

C:\WINDOWS\system32\java.exe -jar -Xmx512M "C:\path\josm-latest.jar"

Mac OS X系统

你需要 Mac OS 10.4 或者更高的版本。10.3的版本下JOSM将无法正常运行。在10.4.x版本下,simply double click on the jar file and Java 1.5 should load the JOSM jar file. If you need to allocate more memory to JOSM (in order to edit larger files), the following script will help:

java -jar -Xmx256M -XX:MaxPermSize=256M josm-latest.jar

开始使用JOSM

  • If you have a GPX tracklog file of the ways you want to map, start JOSM. Choose File → Open to select and load your track. JOSM will automatically fit the workspace to the bounding box of your track.
  • If you don't have a GPX tracklog file then you may want to use data collected from other users. See Korea Mapping Guide
  • If you want to play around while learning how to use JOSM without changing the data on the server then just don't upload (downloading is OK), delete the layers you changed, and then start over.
  • Always download before editing even if you are using data stored on your own computer.
  • To exchange data with the server ensure you have entered your username and passphrase in the preferences of JOSM. Your username is not your wiki username but the email address you used for registering.
  • Now choose File → Download from OSM. In the following dialog ensure that the checkbox to get OSM data is enabled and press the OK button. Always download before uploading.
  • If the track is too long, the server will refuse to send you the OSM data for that area. Zoom in a bit to restrict the request to a reasonable size.
  • Wait a bit until all the data has been received. If there are existing ways of your area in the database, you will now see them in JOSM.
  • Now start your editing session. Be careful when changing existing data, as streets and nodes can have lots of tags assigned.
  • The JOSM manual is available online here, and these pages can also be accessed by pressing F1 from within JOSM. If you really mess things up simply delete the layers that have been changed before you do an upload and then start over.
  • See here for a list of default shortcuts.

使用技巧

查看更多:JOSM/Advanced Tricks(更多给经验丰富用户的技巧)

  • 安装插件后,你需要访问偏好配置,在这里你可以单独启用或禁用某些插件。
  • 对于OSM的新用户,更推荐的做法是在简单编辑时使用预设文件。Ask for one in the mailing list or User:SlowRider
  • To see the ways in different colours and thicknesses, install the mappaint plugin
  • 如果你没有带滚轮的鼠标,你可以使用组合键Ctrl-.(句号键)和Ctrl-,(逗号键)缩放
  • 如果你编辑了一条高速公路的其中一条路径,点击这里可以获得一个工具,帮助你创建一条相反的路径。


自动将照片对应GPS轨迹

One of the problems when out mapping with a GPS is trying to keep accurate notes about the street names as you pass each junction. If you have a digital camera to take out with you, JOSM can help.

  • take a photo of your GPS screen/display showing the time (on the GPS) when you start

As you are travelling around, take a picture at appropriate places/junctions/road signs. Then, when you get home with your completed GPS track uploaded into JOSM:

  • In the "Layers" box, top right
  • Right click on the GPS track layer, for the layer you have just uploaded. Note: you must do it from a layer you have just uploaded, and not from data that was downloaded from OSM, as that apparently no longer has a timestamp.
  • Select "Import Images" (or possibly "import photos")
  • Right click the photos layer,
  • Sync the clocks using the (camera's timestamp on the) photo you took at the start (of the GPS screen/display clock)
    • If you do not have a picture of the GPS for some reason, turn on the camera and GPS now. Work out the time difference between them. Now, subtract or add this to the time shown in the 'sync clocks' photo dialog.

自动将录音对应GPS轨迹

As of build 549 there is a similar facility for applying and synchronising sound recordings.

  • Dictate details of the streets names and points of interest as you pass them. If you are conveniently able to, just before you dictate a description of each feature, put a named/numbered waypoint into your GPS. If you can see the display, ideally also note the waypoint name/number in you audio description. Make sure you put a waypoint at the beginning at the same time as saying "NOW" or some such so you can align the two in JOSM. If you aren't making waypoints, put yourself at a location such as a junction that you'll be able to identify from the GPS track.
现在你向JOSM上传了完整的GPS轨迹,回家处理数据。如果你有分离的路径节点:
  • Load your waypoints from the GPX file in a Marker layer. Usually this is an automatic side effect of opening the GPX file, but if your GPS stores these as named trackpoints, you can convert these to waypoints by right clicking on the GPX layer and selecting Markers from Named Points. You should see the names of the markers on the map display.
  • In the "Layers" box (top right) right click on the Marker Layer that got created and select Apply Audio, and choose the WAV file for the audio commentary. (JAVA doesn't support all audio formats so you may have to convert the file, e.g. using Audacity: 8,000 samples per second at 16 bit samples will work).
  • You should now see audio icons for each waypoint, which you can click to play the audio. You can also use the Audio menu.
如果你没有分离的路径节点 (n.b. applies from build 551 only):
  • In the "Layers" box (top right) right click on the GPX layer and select Make Sampled Audio Layer, and choose the WAV file for the audio commentary. Limitations as above.
  • You should now see audio icons spaced out at reasonable intervals along your track, which you can play by clicking them. These will be spaced a minimum of 15 seconds and 75m apart. (These defaults are suitable for a cyclist at 5m/s - 11mph or 18km/h; they can be altered in Advanced Preferences with the values for "marker.audiosampleminsecs" and "marker.audiosampleminmetres" respectively. In a car in an urban environment you might want 7 seconds, on the open road maybe only 3 seconds, and if walking, perhaps 75 seconds; and for higher or lower density overall, obviously adjust both).
无论哪种情况,你都可以:
  • You can play, pause, resume, jump forward and back, and go to the next or previous waypoint, from the Audio menu. Using the button bar controls in the Preferences pane you can also put these bttons on the button bar in a familiar arrangement. Full stop (period) is a keyboard equivalent for play/pause/resume.
  • Synchronize the audio with the waypoints or identified location by clicking the marker for which you synchronised until you hear your cue ("NOW") and pause. Then select Sychronize Audio by right clicking on the Marker Layer. Synchronization only applies to that and later points, so if you did pause part way through, you can also resync on a later point.

JOSM错误信息

解析错误。一个错误发生。

The most likely cause of the above error is that the server is slow and has not sent the required response back to JOSM. If this occurs just try uploading the data again, and JOSM will resume from where it left off.

If you get error 412 precondition failed, it means that something changed on server in unexpected way. Try deleting affected objects.

JOSM看上去打开成功了,但窗口是空的

If you have the fancy, compiz/beryl graphics stuff enabled, then this may happen. The solution is simple, add the following line to the user profile:

export AWT_TOOLKIT="MToolkit"

新人提示

这里有几条给使用JOSM编辑器,刚开始编辑OSM数据几天的新人的提示。

Mac OS的注意点

  • 在OS X上安装JOSM极其简单,只需要下载并双击jar文件就行了。
  • 使用一个双键带滚轮的鼠标(请不要购买苹果鼠标),这会使工作更简单。按住右键来移动地图,用滚轮来缩放。
  • 或者,使用command-click,又名"Apple-click",来执行右键操作,Ctrl+方向键来移动地图,Ctrl+逗号以及Ctrl+句号来缩放。
  • 因为文件名前有个点,所以你的josm文件目录会被隐藏。你得从命令行把插件移进去,或者使用“前往文件夹…”打开文件夹。
  • 在Edit → Preference目录,有一个“Mac OS X look and feel”。这不改变任何功能但让软件与Mac更相适应。

全平台的注意点

  • Get the "mappaint" rendering mode. It makes it far easier to see what's going on in your maps (and even work out where on earth you are), at the expense of slightly higher processor load on your machine (my PowerBook 12" copes fine).
  • Upload and download small areas, frequently. The less time you've got unstored or unchecked changes, the lower the risk of conflict with other users.
  • Always download an area before you start work on it, even if you have your own GPX data.
  • Always download the area you are going to upload before doing so, to get any modifications made by other users and avoid overwriting data.
  • When downloading an area you get all the data within the rectangular bounding box you choose, and also, where any way within that bounding box extends outside the box it is completely downloaded. It therefore becomes difficult to precisely know which areas you have downloaded full data for. If you check the "Draw boundaries of downloaded data" box (found in Display Preferences), a yellow rectangle is drawn around all the areas for which full data has been downloaded. Caution should be exercised when adding new data to areas outside these rectangles as it may duplicate already existing data, which you have not downloaded.
  • A "small area" to start with might either be that from a short GPX track you've taken, or about a 1-km square around a known location. This equates to about 0.06° of latitude/longitude (give or take polar distortion), so enter an area about that size into the File → Download from OSM → Bounding Box.
  • Rural areas with less detail might work better with larger areas — the 1-km recommendation is about right for a suburb of London.
  • Once you're viewing an area in JOSM, at whatever zoom level, the JOSM download dialog box will default to the currently viewed area.
  • It's very easy to select more than you expect to, particularly when making "ways". Open the "Current Selection" panel (Alt-e, fifth button up on the left) to keep an eye on what you've selected.
  • Switch back to "select" mode regularly and click on nothing or type Ctrl-Shift-A to clear your select list.

我的编辑为什么没有显示?

  • 查看地图特征来了解如何区别你的路径的类别和级别。如果你不确定级别,保守一点,选择更低的级别(比如说你不确定一条道路是主要道路还是次要道路,请选择次要道路)。

参考资料

相关页面

外部链接