转载:https://blog.csdn.net/qq_912917507/article/details/85057400
首先的一个疑问,OSM上有历史数据吗?有的话,去那里下载?
方法一
官方网址https://planet.openstreetmap.org/planet/full-history/
官方的方法不推荐
需要注意的事,你一次就将会把全球的历史存档数据下载下来
而且数据转换速度慢到令人发指,时间上也就保留5年
bzip2 -cd full-planet-110115-1800.osm.bz2 | bzip2 -c> full-planet.new.osm.bz2
这可能需要很长时间(在具有8GB RAM的2.66Ghz Intel Core i7上大约需要36小时)。生成的文件将略小于原始文件。
此处找到的文件是OpenStreetMap.org数据库的完整副本,包括编辑历史记录。这些是在Open Data Commons Open Database License 1.0许可下发布的。
完整的历史行星文件包含XML和自定义PBF格式的OpenStreetMap数据库的完整编辑历史记录。
方法二
http://download.geofabrik.de/asia/china.html#
可以下载整个国家,时间从140101到现在,可以直接下载shp格式,还算不错
务必点一下raw directory index
方法三
使用Osmium工具(没有实测,不知效果)
Osmium lets you extract data from OSM history files for a given point in time or a time range or a polygon or a bounding box. See osmium-tools and its extract command which can handle history dump files in various formats (see the --with-history option).
Osmium允许从OSM历史文件中提取给定时间点、时间范围、多边形或边框的数据。参见锇工具及其提取命令,该命令可以处理各种格式的历史转储文件(请参见—with-history选项)。
工具说明
https://wiki.openstreetmap.org/wiki/Osmium
多种语言可以选择
实例EXAMPLES
https://docs.osmcode.org/osmium/latest/osmium-time-filter.html
Extract current planet file from history planet:
从历史行星中提取当前行星文件:
osmium time-filter -o planet.osm.pbf history-planet.osh.pbf
Extract planet data how it appeared on January 1 2008 from history planet:
从历史行星中提取行星数据2008年1月1日它是如何出现的:
osmium time-filter -o planet-20080101.osm.pbf history-planet.osh.pbf 2008-01-01T00:00:00Z
有用过的朋友可以给我们讲一讲
欢迎互相交流学习,作者微信 w912917507