JA:JOSM/Plugins/WMSPlugin

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
Deutsch English Italiano 日本語 Русский

Using the WMS plugin with a Yahoo! Aerial Imagery imagery (with a downloader installed)
Using the WMS plugin to trace woodland areas over Landsat imagery (bottom left), and comparing road layouts with 1950s NPE maps (top right)
screenshot needs updating since the new WMS plugin does continuous tile downloading

WMS Plugin は、全てのWMS ソースから画像を取ってきて、それをJOSM の背景画像として表示します。また、これYahoo!(USA) 航空写真や、MetacartaGeothing のような、修正された/ゆがんだ画像の 整形用に、重ねて表示します。


現在、背景画像機能はJOSMの基本機能として統合され、'画像'メニューからWMS配信元を指定できるようになりました。そのため、JOSMに以下プラグインを導入する必要はありません。

Contents

インストール

wmsplugin.jar をダウンロードするか、一般的な インストールの説明に従ってください。インストールが成功したら、JOSMのメインメニューに、新しく、WMSというエントリが現れます。Landsat か OpenAerialMap を使って試してみてください。

次の節でのステップを実行するまで、Yahooオプションは動作しません。

Yahoo! 航空画像ダウンローダのインストール

Yahoo!航空画像を使うためには、タイルをダウンロードするためにYahooとインタフェースを取るためのツールをインストールする必要があります。

Windows

webkit-image

window上では、以下のように、 webkit-imageという、WebKitベースのダウンローダを使います

Yahoo!画像を入手するために開始します(表示開始までに、30秒くらいかかるかもしれません)。もしもうまくいかない場合は、DLLファイルをうまく見つけられないのかもしれません。

注意: もしも、システムパス上か、JOSMディスク中にwebkit-imageを置きたくないのであれば、これを行ってはなりません。ダウンロードプログラムを編集することによって、webkit-image実行形式への絶対あるいは相対パスを指定することが出来ます。例は以下の通りです:

GNU/Linux

Linux上では、異なったダウンローダを使う事が出来ます。それは、gnome-web-photo か webkit-image です。

gnome-web-photo

gnome-web-photoは、FedoraとUbuntuを含む、いくつかのディストリビューション用にあらかじめパッケージされていています。

Ubuntu 8.10 'Intrepid Ibex' 上
  1. (version used 0.3-0ubuntu2) の、gnome-web-photoをインストール
  2. Select gnome-web-photo --mode=photo --format=png {0} /dev/stdout as the downloader at the bottom of the WMS preferences pane. Then you can choose the "Yahoo Sat" option from the WMS pull down menu to get the background to download. You might have to zoom out a bit if data is not available at the current zoom level.
On Ubuntu 9.04 'Jaunty Jackalope'

The gnome-web-photo package in Ubuntu 9.04 has introduced bugs with JOSM, resulting in mis-aligned and distorted WMS imagery. This can be rectified by installing an older version of gnome-web-photo.

While the common suggestion has been to compile and manually install gnome-web-photo, you can get away with installing the version from Ubuntu 8.10 instead.

  1. Uninstall any existing version of gnome-web-photo using Synaptic, or by issuing the following command on the command line: sudo apt-get remove gnome-web-photo
  2. Download an older version of gnome-web-photo from the Ubuntu Mirror.
    • gnome-web-photo_0.3-0ubuntu2_amd64.deb for 64 bit Ubuntu systems.
    • gnome-web-photo_0.3-0ubuntu2_i386.deb for 32 bit Ubuntu systems.
  3. Once the file has downloaded, double click it to install it to your system. If for some reason this doesn't work, you can install it from the command line using sudo dpkg -i gnome-web-photo_0.3-0ubuntu2_*.deb
    • Note, this may introduce problems when you upgrade to later versions of Ubuntu, so you may need to uninstall this package before you do so. You can do this by following the instructions in step one.
    • Every time you update your packages Ubuntu will attempt to update this package to the broken version. To stop this from happening add the following three lines to your /etc/apt/preferences (you may have to create this file)
      Package: gnome-web-photo
      Pin: version 0.3*
      Pin-Priority: 1001
    • This may introduce dependencies problems, the package requires libxul0d. Run the command sudo apt-get -f install and it should fix any problems.
  4. Select 'gnome-web-photo --mode=photo --format=png {0} /dev/stdout' as the downloader at the bottom of the WMS preferences pane. Then you can choose the "Yahoo Sat" option from the WMS pull down menu to get the background to download. You might have to zoom out a bit if data is not available at the current zoom level.
On Ubuntu 9.10 'Karmic Koala'

The gnome-web-photo package in Ubuntu 9.10 does not seem to download any data.
Repeat the steps listed above for 9.04 by installing the old version of the package and it works.

Troubleshooting: if you see white stripes
sudo cp gnome-web-photo-fixed /usr/local/bin
sudo chmod a+x /usr/local/bin/gnome-web-photo-fixed

webkit-image (QT)

WebKit has some flavors, the main ones are QT-WebKit and WebKit-GTK+. See below for the GTK+ version.

wget http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin/webkit-image.cpp
moc webkit-image.cpp > webkit-image.h
g++ -I /usr/include/qt4/ webkit-image.cpp -o webkit-image -lQtCore -lQtWebKit -lQtGui -s -O2
svn co http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin
cd wmsplugin
make webkit-image
sudo cp -v webkit-image /usr/local/bin/
[1] 4.2.1 from current Debian stable/etch is missing files, you'll absolutely need to compile. These files appear not before 4.4.3-1, that is in testing/lenny (checked in Ubuntu archives). You'll have to leave the "clean" state of our stable system to get the Debian testing or unstable package and it's dependencies. To do so, you'd like to add at least one line like
http://ftp.debian.org/debian/ testing main contrib non-free
into your /etc/apt/sources.list file, or you'll not be able to even see the needed packages. Think twice before allowing any upgrade of existing packages to a more recent testing or unstable version, however, you'll have no choice to get Yahoo imagery working again with current JOSM revisions ...
[2] Running aptitude I found following packages as mimimum additional install: libqt4-xml, libqt4-dbus, libqt4-script, libqt4-designer, libqt4-sql, libqt4-qt3support, libqt4-svg, libqt4-xmlpatterns, libqt4-help, libqt4-assistant, libqt4-test, qt4-qmake, libqt4-dev (all 4.4.3-1), but your experience may vary.

webkit-image (GTK+)

It requires GTK+ 2.14+ and WebKit. Compile and install webkit-image-gtk.c.

Libraries required: libgtk2.0-dev libwebkit-dev.

To compile it, run: gcc -W -o webkit-image webkit-image-gtk.c `pkg-config --libs --cflags gtk+-2.0 webkit-1.0`

(note: it builds but fails with "image == null" errors on Mandriva Linux, whereas Qt version works)

Mac OS X

Prerequisites

Installation

Download Intel-only binary from http://www.lassitu.de/osm/webkit-image-r13262-qt-4.5-osx10.5.6.zip (MD5 checksum ecf2e2f044ce259af702247729468be1)

Download PPC-only binary from http://westpol.dnsalias.org/webkit-image-r16071-qt-4.5-osx10.5.7.zip (MD5 checksum 2d00c2dbb1222b0293f7eaeccb1d5e8c)

Or compile from source:

1. Use svn to check out the wmsplugin from http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin

$ svn co http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin

2. In the Makefile, change the LDFLAGS line to read:

LDFLAGS=-framework QtCore -framework QtGui -framework QtWebKit -framework QtNetwork

3. Build the program with make:

$ make

if it fails with webkit-image.h:15:2: error: #error "(The moc has changed too much.)" update the header files with

$ moc webkit-image.cpp > webkit-image.h

4. Copy the webkit-image program to a directory that is part of the PATH. If you're not sure which directory to use, try this:

$ sudo mkdir -p /usr/local/bin
$ sudo cp webkit-image /usr/local/bin
Unix programs (and Mac OS X) look for programs to execute in a list of directories. This search list is kept in the PATH environment variable. By default, PATH is set to /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin. To check the current value of the PATH environment variable, use echo $PATH. You can copy the webkit-image program to any of the directories listed in PATH, and JOSM and the wmsplugin will automatically find them.

Configuration

Since July 2009, no further configuration is necessary. If you've installed webkit-image in a directory not in the PATH, you need to modify the path given in the Downloader text box at the botton of the wemplugin preferences page.

FreeBSD

If you have JOSM installed from ports collection, then you already got webkit-image (QT) compiled and installed, and Yahoo imagery will work out of the box.

Source

You can get source of the WMS plugin from Subversion:

svn co http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin/


WMS プラグインを使う

As you pan around it will download more tiles. It also seems to remove tiles which are out of viewing area, to free up memory.

To remove the imagery and stop all WMS downloading, select the layer and click the trash can button. You can also temporarily toggle visibility of the layer (keeps imagery in memory). Right click on the layer (in the layers panel) to access further WMS layer options.

When your WMS layer is selected, the data layer is shown as deselected (dark grey). Simply select your data layer again (often called 'unnamed') to restore normal colours. It is also possible to display the WMS layer "above" the data layer, which will hide the data layer completely. Use the up/down arrows to fix the ordering.

You can adjust the positioning of the imagery by clicking Adjust WMS-Layer.png button on the left. In this mode you can drag and drop the WMS layer. Press the button again to lock it in place. This can be useful if the imagery appears to be offset from reality, but note that your GPS unit isn't perfect. A bad GPS signal can cause an entire trace to have an offset from reality.

You may need to adjust your map colours ('Edit' menu -> 'Preferences') to be darker or lighter, to contrast with the images you are using.

Basic troubleshooting

Things to try in case of problem.

no image appears, even after waiting a bit

images at bad resolution from Yahoo

Exception occurred red tiles

error : bad parameters red tiles

gray tiles

dir /x "C:\Documents and Settings"

In its output the column to the left of your name should contain short version of your name, let it be for example 9335~1. Add a line to the batch file starting JOSM:

rem   Contents of start_JOSM.cmd
set APPDATA=C:\Documents and Settings\9335~1\Application Data
start javaw -jar josm.jar

"Plugin requires JOSM update: wmsplugin" at JOSM startup

Using a "Rectified Image"

Do not use copyrighted material, unless you have the right/permission to do so (see the Licensing section below)!

Before you start with your own images, it might be a good idea to start with Landsat data so you'll learn how to work with these downloaded images.

To work with your own images in JOSM:

If the "clipping range" was wrong, you might see just nothing. In this case zoom out and retry the download.

Adding "Your Own" WMS Server

Do not use copyrighted material, unless you have the right/permission to do so (see the Licensing section below)!

To add a new WMS Server, use the Menu: 'Edit' menu -> 'Preferences' and click on the WMS tab. Now you can add / remove WMS server URL's.

A WMS server typically can provide different projections, subsets of data, etc., so you may need to experiment with the URL settings to get the best results.

Adding presets for objects and source=yahoo_wms

It can be useful to let other users know what your data is based on by adding source=yahoo_wms. This can be quickly done by creating a JOSM tagging preset for roads, woodland, etc and source=yahoo_wms.

Once this is setup, it is simple to apply custom combinations of tags to an node, way or area in JOSM:

<annotations>
  <item name="road-source" icon="[PATH TO ICON]\Yahoo-road.png">
      <key key="source" value="yahoo_wms" />
      <key key="highway" value="road" />
  </item>
</annotations>

ライセンス

Warning.png
その画像がパブリックドメインやそのほかOpenStreetMap ライセンスと互換なでなければ、どんなソースからの航空写真や衛星写真もトレース(なぞり描き)してはいけません

画像をなぞり描きするのは、下にひいた画像の派製作品(二次著作物)を作っていると一般にはみなされます。

これはまた、(明らかに著作権で保護されている)地図の仕上げに使う航空写真の場合は特にです。もしあるソースからのその画像が著作権で保護されていたり、画像の著作権の状態が不確かなら、そのイメージを OpenStreetMap のトレース及び修正には使ってはいけません。

使用可能なソースは

潜在的なデータソースにもっと詳しい情報がかかれています

これらの情報源は使ってはいけません
Personal tools
Namespaces
Variants
Actions
site
Toolbox