Zh-hans:Planet.osm

From OpenStreetMap Wiki
Jump to navigation Jump to search

Planet.osm是单文件版本的OpenStreetMap数据:所有组成我们地图的节点,路径和关系。每周,新版本都会放出。这是一个很大的文件(在2022-04-01,从113.5GB的bzip2压缩格式或62.4GB的PBF压缩格式下载数据解压后,单一的OSM XML文件需要超过1561.5GB的空间)。

OSM也有包含单个大洲,国家及大城市的OpenStreetMap数据的叫做导出(Extracts)的文件。

格式

PBF或者bzip2压缩的OSM XML是主要使用的两个文件格式。PBF(Protocol Buffer Format(协议缓冲格式))是一种更小但处理更迅速的紧实二进制格式,并且应当被尽可能使用。大多数使用OSM数据的普通工具都支持PBF。

查看OSM数据格式以获得所有OSM数据格式全览。

如果您在使用传统的GIS工具,您可能想查看已处理数据提供者

下载

查看下载数据以获得让下载更简单的工具,包括可立即使用全部镜像的选项,自动进行md5验证,以及其他特性。

BitTorrent

2020年11月,官方Torrent种子正式上线了

如果您安装了任何BitTorrent客户端,那么您只需要前往您感兴趣的文件夹(比如pbf/),然后点击.torrent文件即可下载!

BitTorrent RSS/Atom 种子

OSM现在支持 Broadcatching

若您拥有多余的带宽及硬盘空间,并且安装了支持Broadcatching(RSS)的BitTorrent客户端,同时您愿意帮助减少OSM服务器的负载并提升所有人的下载速度,请使用以下RSS种子加入我们的BitTorrent群组(第一二个可能是最火爆的,但如果您有资源请全部分享):

现在没有迫切的需求继续分享超过一个月前的旧文件,除非您真的想这样做(最有帮助的文件期限为7到14天)。

如果您的客户端不支持RSS,但是您运行着一个GNU/Linux系统,您可以在您的cron中使用像https://github.com/osm-hr/planet-mirror这样的脚本以自动加入我们的BitTorrent群组并移除旧文件。

Planet.osm镜像

安全起见,请尽可能使用HTTPS源,而不是HTTP或FTP。当一些互联网用户的网络连接(尤其是移动网络)仅提供通过IPv6的本地路由,并且IPv4仅被他们的ISP使用通过代理的临时NAT会话 (which may not be reliable for very large file downloads, even if HTTPS is used)支持时,他们可能会在使用仅IPv4源时产生问题。

Mirrors are encouraged to support connections from IPv6, and to support secured protocols to reliably authenticate their sources (encryption is not required as the data is published, so this should not be a performance issue on servers, but this requires installing server-side certificates and renew them regularly before they expire). The support of RSYNC on these sources is also useful to allow fast incremental synchronization to other local mirrors, and it should be secured as well. Some mirrors also support peer-to-peer delivery with BitTorrent protocol as active webseeds.

All files also come with a .md5 signature file. Use it to check your downloads (especially when using FTP: using RSYNC or Torrent will generally avoid download issues such as truncated files) ! You should first check for the existence of the .md5 file before trying to download actual data (which may sometimes be in a transient state while a mirror is being synchronized with a recent dump). Also make sure your browser or downloader client supports the transfer of large files over 2 GB, as well as your local OS and file system for storing such files.

镜像 可用数据 网络协议
推荐URL 位置 更新 增量更新 .osm.pbf .osm.bz2 HTTP HTTPS FTP RSYNC Torrent IPv6
planet.openstreetmap.org/ (original source, use another mirror below as much as possible)
GB
(Source) 是 是 是 没有 是 是 是 是 是
ftp5.gwdg.de/pub/misc/openstreetmap/planet.openstreetmap.org/
DE
每日 是 是 是 是 是 是 是 是 是
free.nchc.org.tw/osm.planet/ (source: gwdg.de)
TW
每日 是 是 是 是 是 是 是 是 是
download.openstreetmap.fr/
FR
每分钟 是 没有 没有 是 是 没有 没有 没有 是
planet.maps.mail.ru/
RU
每分钟 是 是 是 是 是 没有 是 是 没有
ftpmirror.your.org/pub/openstreetmap/
US
每日 是 是 是 是 是 是 是 是 是
ftp.fau.de/osm-planet/
DE
每日 没有 是 没有 是 是 是 是 是 是
mirror.init7.net/openstreetmap/
CH
每日 没有 是 是 是 是 没有 是 是 是
ftp.snt.utwente.nl/pub/misc/openstreetmap/
NL
每周 没有 是 是 是 是 是 是 没有 是
ftp.spline.de/pub/openstreetmap/
DE
每周 没有 是 是 是 是 是 是 是 没有
ftp.osuosl.org/pub/openstreetmap/
US
每周 没有 是 是 是 是 是 是 没有 是
download.bbbike.org/osm/planet/
DE
每周 没有 是 是 没有 是 没有 没有 没有 没有
downloads.opencagedata.com/planet/
DE
每周 没有 是 是 是 是 没有 没有 是 没有
ftp.nluug.nl/maps/planet.openstreetmap.org/
NL
每周 没有 是 是 是 是 是 没有 没有 是
planet.passportcontrol.net/pbf/
JP
每周 没有 是 没有 没有 是 没有 没有 没有 没有
archive.org/details/osmdata (Internet Archive, available under various items. Instructions on searching items is available in the "About" tab. Not part of official torrent swarm)
US
每周 是 是 是 是 是 没有 没有 是 没有
osm.cquest.org/torrents/ Since 2021-04-21 does not act as (hidden) webseed anymore, and publishes regular torrents
FR
每周
but in test and manual update.
没有 是 没有 是 是 没有 没有 没有 没有
planet.osm-hr.org Last 15 days
HR
每日 没有 是 是 是 是 没有 没有 是 是

导出国家和地区

全球导出资源

镜像 地区 更新 增量更新 HTTPS 元数据包含
www.overpass-api.de Overpass API excerpts up to ~300MB uncompressed 每分钟 是,从v0.7.50 是 Optional
download.openstreetmap.fr/ Minutely diffs and daily extracts in PBF:
  • Entire continents
  • Many countries in all continents
  • Sub-country admin regions for several countries
每分钟 是 是
download.geofabrik.de Daily extracts in PBF stripped from personal metadata (user names, user IDs, changeset IDs):
  • Entire continents
  • Most countries
  • Sub-country admin regions for Brasil, Canada, France, Germany, Italy, Japan, Poland, Russia, UK, US

Note: Extracts are not suitable for editing.

每日 是 是 Version and timestamp only
osm-internal.download.geofabrik.de Same as download.geofabrik.de but with full personal metadata:
  • Weekly full history extracts for all regions mentioned above (no diffs)

Note: Login with OSM account required. Files are subject to data protection regulation.

每日 是 是 All fields
OSM Today.com 欧洲、亚洲、南北美洲、非洲和澳大利亚的 1000 多个子区域。 每日 没有 是
download.bbbike.org/osm/ Different extracts offered:
  • more than 200 cities and regions worldwide
  • extract your own individual area

Note: Extracts are not suitable for editing OSM, because they omit metadata such as version number. See the FAQ.

每周 没有 是 No metadata
protomaps.com/extracts Extracts up to ~100 million nodes in PBF
  • extract rectangular area or draw polygon
  • updated minutely
每分钟 没有 是 Version for all objects; Timestamp for ways, relations and tagged nodes

地区性导出资源

镜像 地区 更新 增量更新 HTTPS 元数据包含
osm.kewl.lu/luxembourg.osm/ Luxembourg(Beta测试) 每小时 Yes but not Osmosis/Pyosmium compatible directory structure 是 Partially
planet.osm.ch Swiss extract from the Swiss OpenStreetMap association. Including all lakes crossing the Swiss boundary and a few km of the surrounding countries. 每小时 是 是 All fields
osm.fit.vutbr.cz/extracts/czech_republic/ Czech Republic 每日 没有 是 version and timestamp only
data.osm-hr.org Croatia, Slovenia, Bosnia and Herzegovina, Montenegro, Macedonia, Serbia, and Kosovo, Albania, Bulgaria, Hungary, Romania
  • daily extracts in PBF
  • daily Garmin maps
  • daily Osmand maps
  • Croatia archive
  • Croatia diffs
  • planet thematic extracts
每日 是 是 all fields
osmit-estratti.wmcloud.org Italy; daily extracts for Italian regions, provinces and municipalities; supported file formats: PBF, GeoPackage and OsmAnd OBF (Regions only). 每日 没有 是 Partially
osm.kcwu.csie.org/download/tw-extract/ Taiwan; only o5m format 每日 Yes but not Osmosis/Pyosmium compatible directory structure 是 all fields

Global thematic extracts

  • OpenStreetMapData provides shapefiles of global coastlines, land polygons or water polygons.
  • osmdata.xyz provides monthly, global GeoPackages of each primary feature key.

IPFS

  • (currently not working, contains incomplete and outdated files only) A weekly mirror of the continents-files from download.geofabrik.de is made available on IPFS at `/ipns/ipfs.placebazaar.org`, Accessible with any IPFS client, or via a gateway. For example ipfs.io/ipns/ipfs.placebazaar.org. A server is dedicated to seeding this data for a week.

原文件

The originating URL is https://planet.openstreetmap.org/. Please use a mirror or BitTorrent if you can.

更新频率

A new version of planet.osm is released weekly (currently every Wednesday morning). We have these, going back to the start of April 2006.

The size of a planet.osm file can be seen in the header information on the planet download page. Planet files are very large (tens of GBs) so please check the size before starting to download.

The weekly dump normally starts at around 01:10am UK time on Monday morning and is guaranteed to contain all updates prior to that time. The dump is constructed from a database dump using conversion software, and the result should ensure referential integrity. Please note that this doesn't always apply to extracts. The dump and conversion normally takes around 48 hours to complete, in total, and the result is usually ready on Wednesday morning.

Note: The timestamp of the file is recorded in it like this : <osm version="0.6" generator="OpenStreetMap planet.c" (...) timestamp="2013-01-02T01:10:14Z"> it will be useful to decide what "diffs" to use if you want them :

Additionally we offer regular diffs. These are produced daily (under the 'daily' subdirectory) and more recently we also offer hourly diffs and minutely diffs. These have been produced with Osmosis and can be used to reconstruct the full dataset (see examples at OSM Wiki pages Osmosis and osmupdate). Since these only contain the differences, they are much smaller files; A daily diff is generally about 40 MB compressed. For more information please see Planet.osm/diffs

技术性提示

Small region OSM DB-only copy

Q: I would like to set up a copy of OSM DB only for a small region and then keep it up to date with the replicates

You will need to apply the full diffs and afterwards cut off anything you're not interested in.

If you intend to do it for a rather small area then it is really quite easy and performs well with Osmosis. Assuming you have a current extract of your area in "current.osm" and you have the Osmosis replication set up properly (--rrii), then you simply run

 osmosis --rri --simc --rx current.osm --ac --bb left=42 right=42 top=42 bottom=42 
 clipIncompleteEntities=yes --wx new.osm && mv new.osm current.osm

as often as you like (adapt the 42's in the bounding box).

处理文件

See Databases and data access APIs#Database Schemas for loading a planet file into a database.

See OSM file formats#Map-data for a list of tools which are able to manipulate osm files.

See Frameworks for accessing osm files from your software.

解压.bz2文件

Osmosis and osm2pgsql allow you to use the files in bz2-compressed form. If you need to unpack it from bz2 format, use 7-zip on Windows; on Linux just type bzip2 -d planet.osm.bz2; or your OS may support double-click unpacking. See Wikipedia's list of compression programs.

If you are handling the compression yourself with libbzip2, then note that the files are compressed with pbzip2 and contain multiple streams that need to be handled as described in section 3.4.8 of the bzip2 documentation.

During download, the network will be your bottleneck. Once you have the file you will need to unpack it, and then disk I/O will be your bottleneck. Or you can work with the bzip'ed file, but then the CPU will be your bottleneck. If you have sufficient space to unpack the full planet file, you can save a lot of time and disk thrashing by unpacking it on the fly while downloading it: try curl -L https://planet.openstreetmap.org/planet_latest.osm.bz2 | pbzip2 -cd >planet_latest.osm.

In most cases, using import tools supporting the PBF format will be a faster and more efficient solution. They can be processed directly without unpacking to plain OSM XML format and PBF-compressed OSM files are always smaller than bzip2-compressed OSM files and faster to download.

更多技术性提示

wget: Alternatively to curl, wget -O - may be used. Due to the size of the planet files, older distributions of wget may fail to work since they may not support file sizes larger than 2 GiB, and attempting to download files larger than that will report a negative file size and fail.

pbzip2: may be replaced by the single-threaded bzip2 -cd / bzcat as well.

引用

丢失节点

Note that planet download have ways that reference nodes that are not in the same file.

Due to performance reasons it isn't possible oto get a fully consistent snapshot of the database. Although the dump is run in a transaction, the isolation level required for a "snapshot"-style dump dramatically increases the running time. You might find that, if you have been editing while the export has been running, that the way may be in there but the nodes are not. You can take a planet file and apply the daily diffs using Osmosis to create a consistent planet file (however you may still have some problems with old bad data in OpenStreetMap from before the introduction of the API 0.6).

国家导出

Country extract may have ways that reference nodes that are not in the same file.

This is perfectly normal depending on the settings used in the extraction process. There are two options; either the ways at the boundary have been truncated (such as in the GeoFabrik downloads), or the nodes are just left out and the ways are left as is (for example the CloudMade downloads).

处理丢失的引用点

This really depends on what you are doing with the data. You can either drop the node references or you can go to another data source, such as the API, to fetch the missing nodes.

其他planet文件

执照

Planet files remain licensed under the same license as the master OpenStreetMap geo-database from which they are extracted - currently this is the Open Database License. Planet files from before September 12, 2012 have a Creative Commons Attribution-ShareAlike 2.0 license.