User talk:Higa4/OSM book Japan/Understanding the OpenStreetMap data model

From OpenStreetMap Wiki
Jump to navigation Jump to search

原文: http://en.flossmanuals.net/openstreetmap/the-osm-data-model/

The OpenStreetMap data model

OpenStreetMapデータモデル

The OpenStreetMap data model is a powerful yet simple way to represent geographic information. Understanding the data model enables you to interact with OpenStreetMap data in its raw form so that you can manipulate it into formats that are more useful for what you're trying to do. You'll want to understand the data model if you are interested in writing a map editor, converting the raw OpenStreetMap data into a format for use in an application, or if any of the existing software tools don't provide functionality that you want.

OpenStreetMapデータモデルは地理情報を表現するパワフルでありながらシンプルな方法です。データモデルを理解することで、あなたはOpenStreetMapの生データを対話処理できるようになり、あなたの目的により役立つ形式に加工することができます。生のOpenStreetMapデータをアプリケーション内で利用する形式に変換するために、あるいは既存のソフトウェアツールの機能に飽き足らない場合、必要なマップ用エディタの作成に興味をお持ちなら、データモデルを理解したいと思うでしょう。

In traditional GIS the map data is represented in three different ways: a point is a single location in space defined by coordinates, a linestring is a linear feature representing a road or a border, and a polygon is an enclosed area. Data describing these geographical features is usually attached as an afterthought in a secondary database. In OpenStreetMap, these three concepts are distilled down into nodes, ways, and relations with tags being a way to describe each feature. This chapter discusses these core OpenStreetMap concepts in more detail.

伝統的なGISではマップデータは3つの異なるやり方で表現されます:ポイントは座標で定義される空間上の単一の位置であり、線分は道路や境界を表わす線形のフィーチャーであり、ポリゴンは閉じたエリアです。これらの地理的なフィーチャーを書き表すデータは通常、二次的なデータベース内の補足として添付されます。OpenStreetMapでは、これら3つの概念は、各フィーチャーを表現する方法としてのタグを付けて、ノード、ウェイ、そしてリレーションとして抽出されています。この章では、これらコアなOpenStreetMapの概念をより詳細に議論します。

This is an advanced topic that will help you if you decide to delve deeper into working with OpenStreetMap data, perhaps to implement something interesting that does not already exist, or improve a current tool. It will help you if the task requires low level control of map data, either when working with static datasets or interacting with an OpenStreetMap API, such as the live REST API used to edit the OSM data. To learn more about the REST API, visit the wiki page at http://wiki.openstreetmap.org/wiki/API_v0.6.

これは高度なトピックで、OpenStreetMapのデータを深く探求すると決めた場合、おそらく従来に無い何か面白いものを実装したり、現在のツールを改善するのに手助けとなるでしょう。タスクがマップデータの制御を低レベルで必要とするなら、静的なデータセットで作業したり、OSMデータ編集のために使われるライブREST APIのようなOpenStreetMap APIを操作したりする手助けとなるでしょう。REST APIについての詳細は、次のWikiページを参照。 http://wiki.openstreetmap.org/wiki/API_v0.6

Tags

タグ

Tags are "key-value" pairs of strings optionally attached to each geographic element in OpenStreetMap. These tags describe the feature they are attached to, and can be any pair of strings up to a maximum of 255 characters in length (including spaces), with the only restriction that keys be unique inside one element. If there are no tags associated with a feature, most renderings of the data won't display that feature.

タグは"キーと値"の文字列のペアで、オプションとしてOpenStreetMap内の個々の地理要素に付加されます。これらのタグは、付加先のフィーチャーを説明し、スペースも含め最大255文字までの任意の文字列のペアであり、唯一の制限はひとつの要素内ではキーはユニークでなければならない、ということです。フィーチャーに関連するタグが無い場合、データのレンダリングはたいていその地物を表示しません。

Nodes

ノード

Points on Earth are called nodes and are represented by a latitude, longitude and as many tags as may be appropriate. For example, nodes are used to represent shops, bus stops, benches, and post boxes. A node without any tags will always be a subelement of another element.

地球上のポイントはノードと呼ばれ、緯度経度及び適切な数のタグで表現されます。例えば、ノードはお店、バス停、ベンチ、郵便ポストなどを表現するのに使われます。タグの無いノードは他の要素のサブ要素です。

Ways

ウェイ

An ordered list of nodes is called a way. A way has a maximum of 2000 nodes to ensure that tools and users are not overwhelmed with very large structures that are difficult to manipulate. They are used for representing linear features like footpaths, roads, rail lines, and power lines.

ノードの並びはウェイと呼ばれます。ウェイは、ツールやユーザが操作しずらいとても大きな構造に圧倒されないように、最大2000ノードまでです。歩道、道路、鉄道、電力線などのような線形のフィーチャーを表わすのに使われます。

Areas do not have a specific data type, and are simply a kind of closed way where the first node is the same as the last node. They are used to represent building outlines, parks, and landuse.

エリアは特別なデータタイプを持っていない、シンプルな閉じたウェイの一種で、最初のノードが最後のノードと同じものになります。建物の外周、公園、土地利用などを表現するのに使われます。

Relations

リレーション

Relations are ordered lists of nodes, ways or relations. Each member of a relation has an optional role that gives an additional piece of information about that subelement. These roles are strings up to 255 characters long, like tag values. Relations can represent road or bicycle routes, turn restrictions, and administrative boundaries, again depending on the set of tags attached.

リレーションはノード、ウェイあるいはリレーションの並んだ一覧です。リレーションの各メンバーはそのサブ要素についての情報の付加的な一部を提供するオプションのロールを持っています。これらのロールは、タグ値に似た255文字長までの文字列です。リレーションは道路や自転車のルート、方向転換制限、行政界を表現でき、再び付加されたタグのセットに依存します。

You should remember that relations are not categories and should not be used solely to group things together. You should probably use a tag to group things together instead. For more information about this topic, visit http://wiki.osm.org/wiki/Relations/Relations_are_not_Categories.

リレーションはカテゴリではなく、単に物事をグループ化するために使うべきではないということに注意してください。物事をグループ化するのであればタグを使ってください。このトピックについてより詳細な情報は http://wiki.osm.org/wiki/Relations/Relations_are_not_Categories を参照してください。

Identifiers

識別子

Any element in an OpenStreetMap dataset, of any of the three types above, is identified by a unique numerical id. These numbers have no other purpose than to allow referencing of individual features, and have no special meaning. A relation or a way uses these identifiers to reference its subelements. Two ways are said to meet only if they reference the same node identifier, rather than two nodes with identical coordinates. Closed ways representing areas need to reference the same node Id twice.

上記3種のOpenStreetMapデータセット内の任意の要素は、ユニークな数値のIDにより識別されます。これらの数値には個々のフィーチャーの参照を許可する以外の目的はなく、特別な意味はありません。リレーションやウェイはこれらの識別子を使ってそのサブ要素を参照します。2つのウェイが接続されるのは、識別される座標を持つ2つのノードというより、同じノード識別子を参照している場合だけです。エリアを表すクローズドウェイは同じノードIDを2回参照する必要があります。

OpenStreetMap file formats

OpenStreetMapファイル形式

OpenStreetMap data files are traditionally distributed in an XML format representing the node, way, and relation concepts using a simple schema. Without compression, this XML format can be extremely large, so it is usually distributed using an efficient compression algorithm like gzip or bz2. Most of the tools designed to work with the OSM XML data format can also handle the compressed XML.

OpenStreetMapデータファイルは伝統的に、シンプルなスキーマでノード、ウェイ、リレーションの概念を表現するXML形式で配布されます。圧縮なしだと、このXML形式はとてつもなく大きくなりえるため、通常はgzipやbz2のような効率的な圧縮アルゴリズムを使って配布されます。OSM XMLデータ形式を扱えるように設計されたツールの多くは、圧縮されたXMLを操作できます。、

To solve the size and XML parse speed problem of XML, a separate format using Google's Protocol Buffers project was created to pack as much OSM data into a binary file as possible. The PBF format allows the data to be compressed even further than gzip and bz2 and allows much faster processing than compressed XML. There are libraries for several languages to help read this file format.

サイズとXMLパース速度の問題を解決するために、GoogleのProtocol Buffersプロジェクトを使った別の形式が作成され、できる限りのOSMデータをバイナリーファイルにパックすることができます。いくつかの言語向けに、このファイル形式の読み込みを手助けするライブラリがあります。