【问题标题】:Extract country specific OpenStreetMap extract into MySQL spatial table将特定国家/地区的 OpenStreetMap 提取到 MySQL 空间表中
【发布时间】:2017-01-28 05:24:13
【问题描述】:
【问题讨论】:
标签:
mysql
gis
geospatial
openstreetmap
【解决方案1】:
因为您的目标是将下载的数据从网站加载到 MySQL 空间。然后我认为最直接的方法是从网站下载 shapefile (.shp) 并使用 OSGEO4W 加载到您的空间数据库中。
gdal ogr2ogr 中有一个用于将 shapefile 数据加载到 MySQL 的数据驱动器。有关 OSGEO4W 中驱动器的更多详细信息(著名的 gis 工具包集):OSGEO4W official website
命令示例:
ogr2ogr –f MySQL MySQL:database_name,host=localhost,user=database_username, password=database_password path/to/shapefile -nln datatable_name -update -overwrite -lco engine=MYISAM.
有关命令行的更多详细信息:http://www.gdal.org/ogr2ogr.html