OSMDownloader

从OSM下载矢量数据并将其存储到文件

描述

该应用程序连接到Open Street Map服务器,下载与支持图像的空间范围相对应的数据,并基于OSM标签过滤几何图形以生成矢量数据文件。

该应用程序可用于下载参考数据以执行机器学习模型的训练(例如,参见 [1] )。

默认情况下,将下载整个层。应用程序有一种特殊的模式来提供层中可用类的列表。通过给OSM标签‘key’来过滤下载的功能。此外,用户还可以选择这个键应该有什么‘值’。有关OSM项目的更多信息,请访问 [2] 。

参数

Output vector data -out vectorfile Mandatory
Vector data file to store downloaded features

Support image -support image Mandatory
Image used to derive the spatial extent to be requested from OSM server (the bounding box of the extent is used). Be aware that a request with a large extent may be rejected by the server.

OSM tag key -key string
OSM tag key to extract (highway, building...). It defines a category to select features.

OSM tag value -value string
OSM tag value to extract (motorway, footway...). It defines the type of feature to select inside a category.

高程管理

这组参数允许管理高程值。

DEM directory -elev.dem directory
This parameter allows selecting a directory containing Digital Elevation Model files. Note that this directory should contain only DEM files. Unexpected behaviour might occurs if other images are found in this directory. Input DEM tiles should be in a raster format supported by GDAL.

Geoid File -elev.geoid filename [dtype]
Use a geoid grid to get the height above the ellipsoid in case there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles. A version of the geoid can be found on the OTB website (egm96.grd and egm96.grd.hdr at https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/master/Data/Input/DEM).

Default elevation -elev.default float Default value: 0
This parameter allows setting the default height above ellipsoid when there is no DEM available, no coverage for some points or pixels with no_data in the DEM tiles, and no geoid file has been set. This is also used by some application as an average elevation value.


Displays available key/value classes -printclasses bool Default value: false
Print the key/value classes available for the selected support image. If enabled, the OSM tag Key (-key) and the output (-out) become optional

实例

从命令行执行以下操作:

otbcli_OSMDownloader -support qb_RoadExtract.tif -key highway -out apTvUtOSMDownloader.shp

来自Python的评论:

import otbApplication

app = otbApplication.Registry.CreateApplication("OSMDownloader")

app.SetParameterString("support", "qb_RoadExtract.tif")
app.SetParameterString("key", "highway")
app.SetParameterString("out", "apTvUtOSMDownloader.shp")

app.ExecuteAndWriteOutput()

局限性

此应用程序需要互联网访问。