JA:JOSM/Plugins/WMSPlugin

From OpenStreetMap Wiki
Jump to navigation Jump to search

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に以下プラグインを導入する必要はありません。

インストール

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

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

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

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

Windows

webkit-image

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

  • webkit-image.zipをダウンロード
  • 解凍
  • "システムパス上"(例えば c:\Windows)のどこかに、DLLとEXEファイルを移動します。これを行う最もよい方法は、josm-latest.jar のそばに置くことです。'imageformats'フォルダもそばに置くことを忘れないでください(結局、zipファイルのすべての内容ということになります)。
  • JOSM を再起動します。
  • 'WMS' メニュー -> YAHOO (Webkit)を実行します。

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

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

  • webkit/webkit-image {0} - JOSMインストールディスクからの webkitという相対サブディレクトリからwebkit-image.exeをロード
  • D:/webkit/webkit-image {0} - D:\webkit\webkit-image.exeの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
  • install package netpbm
  • in JOSM -> Settings -> WMS, change "gnome-web-photo" to "gnome-web-photo-fixed" in the selection for download program.

webkit-image (QT)

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

  • Install the following packages: build-essential libqt4-dev (>= 4.4.3[1][2]) libqt4-webkit pkg-config (on Mandriva 2010.0: urpmi gcc-c++ webkitkde-devel libqt4-devel)
  • Download and compile (you may have to replace moc with moc-qt4, or /usr/include/qt4 with /usr/lib/qt4/include):
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
  • instead of the previous step, you can use the packaged Makefile:
svn co http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin
cd wmsplugin
make webkit-image
  • Copy it to somewhere in your path:
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 プラグインを使う

  • Load / Download openstreetmap data and go to your favourite area
  • Show the 'Layers' panel if it isn't showing already (Click the toggle button: JOSM-Icon-layerlist.svg)
  • Click the menu option "WMS → Landsat" (or whatever named WMS server you want to use) This should cause it to create a new imagery layer.
  • Wait a few moments for it to begin fetching image tiles.

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 JOSM-Icon-adjustxywms.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

  • adjust zoom level so that the scale in the top left says ~150m, delete the layer (trash can icon), add it again from the menu.
  • The plugin may not find the DLL files. Check you have placed all of the webkit-image zip file contents them somewhere on the system path.

images at bad resolution from Yahoo

  • adjust zoom level as decribed above. Note that in some regions Yahoo imagery has a lesser resolution than Google Maps.

Exception occurred red tiles

  • This can mean the WMS server is temporarily not available. Landsat and OpenAerialMap seem to be prone to periods of non-availability. Delete the WMS layer and try again 10 minutes later.

error : bad parameters red tiles

  • Check that configuration -> projection is set to EPSG:4326 or Mercator.

gray tiles

  • if you have non-ACSII symbols in the path to your plugin folder in Windows (e.g. cyrillic letters in your name in C:\Documents and Settings\your name\Application Data\JOSM\plugins), a possible solution is to change your name to an equivalent short filename. To find this open a command window and do
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

  • Update JOSM: see JOSM to last tested version.
  • If the message still appears, the problem is on our side - you have a newer version plugin version than your josm can hande. Go to the plugin preferences page and update there. This should install the last version which is usable in your josm (when necessary does a downgrade of the plugin).
  • If the error still appears file a bug report.

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:

  • upload your aerial image / scanned old map to either
  • rectify it on their site so it "fits with reality"
  • XXX - wait for the image to be processed?
  • remember the metacarta id (look at the URL in your browser)
  • in JOSM, load some openstreetmap data of the expected image area (to be in the right "clipping range")
  • click on WMS -> Rectified Image and enter the id in the upcoming dialog

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:

  • Download the Yahoo-road.png Yahoo road icon.
  • Open your favourite text editor and insert the following:
<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>
  • Save it as yahoo-presets.xml
  • Open JOSM
  • Open the Preferences, go to the Map Settings (3rd tab)
  • Add your file at the "Tagging Preset Sources"
  • Restart JOSM
  • If you want, you can put the preset in your toolbar for quick access (Preferences, Toolbar customization)
  • You might also want presets for things like Yahoo-farm.png landuse=farm and/or Yahoo-stream.png waterway=stream
  • Download the above icons and add new <item> entries to your yahoo-presets.xml file
  • Contact User:LeedsTracker if you want any more icons made --LeedsTracker 17:04, 28 February 2009 (UTC)

ライセンス

Nuvola apps important.svg

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

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

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

使用可能なソースは
  • NASA Landsat - Public Domain low resolution satellite imagery (Currently broken (2008-05-26), NASA site times out. There is a version available for testing that tries to avoid this problem by using "tiled WMS" as suggested on the Landsat server. see User:Bomm#JOSM-WMS-Plugin_-_Tiled_WMS.)
  • Yahoo! Aerial Imagery - 特殊許可 - We have been given special permission to derive our vector map data. See installation part how to get this working.
  • De:DOP Sources - List of DOP sources for Germany and their status of permission to use in OSM
  • New Jersey 2007 aerial photography. Only available within and slightly overlapping the borders of New Jersey. There are no restrictions on its use.
  • OpenAerialMap: This is currently offline, but if/when this project is resuscitated it provides open aerial imagery compiled from many sources/imagery donations.

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

これらの情報源は使ってはいけません
  • Google マップタイル - 著作権!
  • Google 航空写真 - 著作権!
  • Microsoft VirtualEarth - 著作権!
  • Yahoo マップタイル - 著作権!
  • 本当にたくさんの他の情報源があって、全部上記にリストされていません。