JA:Maperitive

この記事は翻訳記事ですが、翻訳が不完全であり、抜けや誤り、未翻訳の部分があります。
英語版の記事の内容が分かる方は、翻訳の完成にご協力ください。このウィキの翻訳方法についての説明をお読みください。
現時点では、誰もこの記事の翻訳に取り組んでいないようですので、あなたが取り組めます。

Maperitive
作者: Igor Brejc
ライセンス: Proprietary (無償)
動作環境: Windows、 Linux および macOS
版数: 2.3.35 (2015-12-23)
言語: 日本語
ウェブサイト: http://maperitive.net
プログラミング言語: C#

Desktop based

Maperitive は OSM データなどを使って、リアルタイムにマップを描画(レンダリング)するデスクトップアプリケーションです。

http://maperitive.net/

It is a successor to Kosmos. Renaming explained on igorbrejc.net blog

The full documentation (under construction) is at http://maperitive.net/docs/. The instructions here are just to get you going while the full documentation is being written and are the "discoveries" of the early adopters and the Author's helpful emails.

You can download the latest version of Maperitive from http://maperitive.net/download/ (requires .NET Framework v4.0). Keep in mind that it is still in the beta stage of development and as of now it has just a simple GUI and is controlled via a command console. Please attend when using the command line the different use of / under Linux and \ under Windows.


インストール

Windows

http://maperitive.net/download/より、Maperitiveのzipファイルの最新版をダウンロードして下さい。そして、適当なディレクトリに解凍してください。(it is probably sensible to remove the version number, because updates will go to the same place).

maperitive.exe をダブルクリックして、実行してください。(デスクトップにショートカットを作成しておくと便利です。)

Ubuntu 10.04 - 12.10

Download the latest version of the Maperitive zip file from http://maperitive.net/download/ and unzip it into a directory of your choosing. Maperitive also requires a couple of dependencies. These can be installed by opening a Terminal window and running:

sudo apt-get install libmono-winforms2.0-cil mono-devel

Once these have downloaded and installed, navigate to the directory in which you unzipped Maperitive, mark the Maperitive.sh file as executable and run it. This can be done by right-clicking the file and changing the properties to "Allow executing file as program", alternatively run the following lines in Terminal:

chmod +x ./Maperitive.sh
./Maperitive.sh

Ubuntu 10.04

Since Maperitive uses a proprietary file name extension for its rules files (.mrules), editing them using edit-rules may fail. To fix this, create the appropriate custom MIME type and mailcap entries. The following commands define a new MIME type for mrules files for the current user and set gedit as default application to edit them:

echo "text/vnd-maperitive-rules  mrules" >> ~/.mime.types
echo "text/vnd-maperitive-rules; gedit '%s'; description=\"Maperitive rules file\"; test=test -n \"\$DISPLAY\"" >> ~/.mailcap

Fedora 14

Download the latest version of the Maperitive zip file from http://maperitive.net/download/ and unzip it into a directory of your choosing (it is probably sensible to remove the version number, because updates will go to the same place).

As root execute

yum install mono-winforms

and then go to the directory where you unzipped Maperitive and make it executable with

chmod +x ./Maperitive.sh

To start Maperitive type

./Maperitive.sh


Mac OS X

Download the latest Mono installation and install it.

X11 has to be installed on the Mac. Download it from XQuartz.

Download Maperitive, unpack it and move the whole directory to the programms directory (or to any other place).

To launch Maperitive open a terminal and swicht to the Maperitive directory using

cd /Applications/Maperitive

Launch Maperitive:

mono Maperitive.exe

The starting of Maperitive may take a while, just wait.

データの取得

OSMデータが必要となります。コレを取得するにはいくつかの方法があります。

  • JOSMを使ってエリアのダウンロードし File>Save As で保存する
  • Geofabrikで .bz2 ファイルを取ってくる

Maperitive はすべてのデータをRAMに読み込むので、あまりに大きなエリアは使わないほうが良いです。 OsmosisOsmconvert で不要なデータを削除してください。

It's a good idea to set up a directory for your working files with (for example) data, rules, scripts and outputs sub-directories.

以降の例は、データが c:\users\igor\documents\osm\maperitive\data\test.osm にあると仮定して進めます。

Basic Instructions

コマンドを入力しウィンドウ下の灰色のバーをクリック(もしくはEnterを入力)すると、バーが黄色に変わります。メニューから使えるコマンドもあります。 Maperitive はコマンドをただ一つに特定できる文字を要求します。 It fills in what it can as you go along.

デフォルトでは、背景にMapnikの地図タイルが表示されます。(インターネットに接続されている場合)表示したい場所に移動する場合は、次のようにします。例えば、ロンドン中心部に移動する場合は:

move-pos x=-0.11 y=51.52

データをMapnikの地図タイルの背景の上に描画する場合、もしくは空白のページを用いる場合:

clear-map

あなたのデータが別のディレクトリにある場合は、そのディレクトリをデフォルトにすると便利です。これは、次のようにします。

change-directory c:\users\igor\documents\osm\maperitive\

地図データを読み込む場合:

load-source data\test.osm

すると、地図は読み込まれ、デフォルトのルールにしたがって描画されます。(このルールはMaperativeと同時に解凍された、rules\default.txt ファイルにあります。)これらの描画ルールはMapnikの描画に似たものです。これを保存するには次のように入力します。:

export-bitmap zoom=15 file=outputs\test.png width=3000 height=3000 scale=3

おめでとうございます。これであなたもレンダラーの一員です。

描画ルールを変える

描画ルールを変えるには、アクティブになっているルール(のファイル)を開いて、次のコマンドを実施します。ここで、あなたの作業ディレクトリにコピーを作っておきましょう(rules\test.mrules に別名保存するのがベストです。):

edit-rules

編集する際、インデントの保存が必要です。色付けの変更を試してみましょう。(一般的な色は、言葉での入力が可能です。)変更して保存するには:

use-ruleset location=rules\test.mrules as-alias=test
apply-ruleset

変更を保存して、次を実行すると、あたらしい描画ルールにしたがって色付けがされます。

reload-ruleset

Maperativeは数秒新しいルールの効果を示します。 デフォルトのルールに戻すには、エイリアスを使います。:

use-ruleset alias=default
apply-ruleset

Maperitive はあなたの描画ルールのありかを覚えています。ですので、再読込する必要はありません。もしエイリアスを再使用する場合は、古い場所を上書きしてください。

The "wireframe"-Ruleset is a useful ruleset. It renders all lines whatever tags they have. This ruleset is pre-defined and has the alias "wireframe". You can use it with use-ruleset alias=wireframe followed by apply-ruleset

Examples for user modified or created rules can be found here in the Wiki in the Category Maperitive/Rules and some rendered samples can be found here: Maperitive/SampleRenderings.

スクリプト(Scripts)

一連のコマンドをテキストファイルで保存しておくことができます。例えば

move-pos x=-0.11 y=51.52
clear-map
change-directory c:\users\igor\documents\osm\maperitive\
use-ruleset location=rules\test.txt as-alias=test
load-source data\test.osm
export-bitmap zoom=15 file=outputs\test.png width=3000 height=3000 scale=3

一度にこれらのコマンドを実行させることができます。

run-script c:\users\igor\documents\osm\maperitive\scripts\myscript.txt

これらの保存するために、Maperitiveを解凍した際にできた、scripts\default.txt にchange-directoryを記述しておきます。(ただし、アップデートの際には上書きされるかもしれません。)もしくは、作業ディレクトリにWindowsのバッチファイル(.bat)を作ります。: maperitive.exe scripts\myscript.txt をバッチファイルとしてつくり、デスクトップにショートカットを置きます。ショートカットファイルのプロパティに、maperitive.extの場所へのStart In をセットする必要があります。You can also use the maperitive.ico icon (same place as maperitive.exe).

描画ルールファイルの理解

ルールのファイルのレベル構造は以下のとおりです。

features
        ...
        areas
                ...
        lines
                ...
        points
                ...
properties
        ...
rules
        target : feature1
                ...
        target : feature2
                ...

features section は Maperitive にどの地図デーを使って欲しいかを指示します。つまり、どのエリアや線、点だけを対象として欲しいのか、もしくはすべてをチェックさせたいのか定義します。

properties section はMaperitive's defaultsを上書きします。 (例えば使用フォントなど).

rules sectionではMaperitiveにfeatures(で定義した一連のデータ)にたいしてどのように描画するかを指示します。通常はいくつかのプロパティを定義し、それらを使って描画します。You can change the rendering within each rule based on further tests, which makes it very flexible indeed.

Commands

The full list of commands can be seen by typing help-commands. They scroll past really quickly and the window is very narrow, so here they are listed as at version 809 (28 March 2010).

CommandAction
add-web-map background=<draw the map in background (true/false)> intensity=<intensity of the web map (from 0 to 1)> provider=<name of the web map provider (mapnik, osmarender, osm cyclemap>adds a web map provider to the map
apply-ruleset [sourceindex]applies the active ruleset to the map
change-directory <directory>changes the current directory
check-updateschecks for new updates in Maperitive software
clear-cache webmap=<clear cached web map tiles>clears the application cache
clear-command-historyclears the command history
clear-mapclears the map (removes all map sources)
clear-resultsclears the search results
dump-boundsdumps the map view bounds to the command log
dump-entrailsdumps Mapertivie's entrails to the command log (for debugging purposes)
dump-posdumps the current map position to the command log
exitcloses the Maperitive application
export-bitmap aspect=<preserve aspect ratio> scale=<scale> zoom=<zoom level> file=<bitmap file name> width=<bitmap width> height=<bitmap height>exports the current map view to a bitmap file, also creates a worldfile
export-command-history <outputfilename>exports the command history to a text file
export-osm <filename> [sourceindex]exports the current map view to an OSM file (just the OSM data)
find <specificationtext>searches for map data using a query language
find-here <specificationtext>searches for map data using a query language but restricts the search to the visible map window
find-nextmoves to the next item in search results
find-prevmoves to the previous item in search results
generate-contours [elevationinterval]generates relief contours for the current map view
get-infodisplays detailed information about the currently focused map object
helpdisplays basic help information
help-commandsdisplays a list of all Maperitive commands
help-keyboarddisplays a list of all Maperitive keyboard shortcuts
help-propertiesdisplays a list of all rendering rules properties in Maperitive
list-resultsdumps search results list in the command log
list-rulesetsdisplays a list of all registered rulesets
list-sourcesdisplays a list of all map sources on the map
list-viewpoints
load-source <filename>loads a map source from a file (OSM, GPX or IBF file)
move-pos <x> <y> [zoom]moves the map to a new position
promptsets the focus on the command prompt
remove-ruleset index=<ruleset index> alias=<ruleset alias> location=<ruleset location>removes (deregisters) a ruleset
remove-source [sourceindex]removes a specific map source from the map
run-script <scriptfilename>runs a Maperitive script from the specified file
save-map-script <scriptfilename>saves the current map as a Maperitive script
save-source <sourceindex> <destfilename>saves a specific map source to the specified file
send-feedbackopens your mail client and prepares a mail message to Maperitive's author
use-ruleset index=<ruleset index> as-alias=<new alias> location=<ruleset location> alias=<ruleset alias>activates a specific ruleset
zoom <zoomfactor>sets the zoom level of the map view
zoom-allzooms to the extents of the map
zoom-bounds <minx> <miny> <maxx> <maxy>zooms to the specific map bounds
zoom-inzooms in
zoom-outzooms out
zoom-selectionzooms to the currently focused element

キーボードショートカット

The full list of Keyboard-Shortcuts can be seen by typing help-keyboard. They scroll past really quickly and the window is very narrow, so here they are listed as at version 1154 (April 2nd, 2011)

> help-keyboard
   F3 (global): find-next
   Shift+F3 (global): find-prev
   Ctrl+A (map): zoom-all
   Ctrl+Shift+C (global): generate-contours
   Ctrl+Shift+D (global): download-osm
   Ctrl+E (global): export-bitmap
   Ctrl+H (global): go-home
   Ctrl+M (global): focus-map
   Ctrl+N (global): clear-map
   Ctrl+Q (global): exit
   Ctrl+R (global): reload-ruleset
   + (map): zoom-in
   = (map): zoom-in
   - (map): zoom-out
   Left (map): move-screen-pos x=-0.1
   Right (map): move-screen-pos x=0.1
   Up (map): move-screen-pos y=-0.1
   Down (map): move-screen-pos y=0.1
   Ctrl+Enter (global): prompt

Icons

Mapnik icons are included with Maperitive, but others are available (some of them may be subject to license, so at your own risk!) at:

Maperitive copies icons to the cache\images\ directory, and then simply refers to the filename. So once the rules have been used once, there is no need to be connected to the internet.

How to

How to use Maperitive to work off line and display different options simply for the end user.

How to use Maperitive's find command.

Example for rulesets can be found under

  • Category Maperitive/Rules

Example for scripts can be found under

  • Category Maperitive/Scripts
This article is issued from Openstreetmap. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.