Read cities and streets into a database without api

一曲冷凌霜 提交于 2019-12-08 10:49:07

问题


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"

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.

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


回答1:


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.



来源:https://stackoverflow.com/questions/14705063/read-cities-and-streets-into-a-database-without-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!