在没有api的情况下将城市和街道读入数据库 [英] Read cities and streets into a database without api

查看:80
本文介绍了在没有api的情况下将城市和街道读入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法将osm文件下载并提取到mysql数据库中,例如:

I managed to download and extract an osm-file into a mysql-database, like:

osmosis --read-xml myfile.osm --write-apidb dbType ="mysql" host ="localhost" database ="osm" user ="osm"

osmosis --read-xml myfile.osm --write-apidb dbType="mysql" host="localhost" database="osm" user="osm"

我现在需要的是一种仅将城市及其街道纳入数据库并进行查询的方法.那么,如何限制从osm文件到数据库以及城市和街道的数据传递呢?我不需要任何其他数据.

What I now need is a way to get only cities and their streets into the database and query them. So how do I limit the data passed from the osm-file to the database to cities and streets? I don't need any additional data.

我不想只使用任何API或服务.

I do not want to use any only APIs or services.

推荐答案

渗透支持以下功能:称为数据处理任务,可用于过滤特定数据.为了只获取城市和街道,对 place place 高速公路标签(节点和区域).必需的参数似乎是--tf accept-ways place=* --tf accept-nodes place=* --tf accept-ways highway=* --tf accept-nodes highway=*,但我自己从未使用过渗透.

Osmosis supports so-called data manipulation tasks which can be used to filter for specific data. In order to get only cities and streets it should be sufficient to filter for both the place and highway tags (nodes as well as areas). The required parameters seem to be --tf accept-ways place=* --tf accept-nodes place=* --tf accept-ways highway=* --tf accept-nodes highway=* but I never used osmosis myself.

这篇关于在没有api的情况下将城市和街道读入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆