【问题标题】:How to export OSM to database with all cities and street names?如何将 OSM 导出到包含所有城市和街道名称的数据库?
【发布时间】:2016-10-21 00:48:48
【问题描述】:

我下载了我县的 osm 地图并创建了空间 pg 数据库。我使用以下命令通过 osm2pgrouting 导出的 osm 文件:

osm2pgrouting -f myCity.osm -c mapconfig.xml -d postgis_db -U postgres -W postgres --addnodes --clean 

导出表后,我有了这个架构:

osm_node:
   -node_id
   -osm_id
   -lon
   -lat
   -numofuse
   -the_geom

osm_relations:
   -relation_id
   -type_id
   -class_id
   -name

osm_way_classes
   -class_id
   -type_id
   -name
   -priority
   -default_max_speed

osm_way_tags
   -class_id
   -way_id

osm_way_types
   -type_id
   -name

pointcloud_formats
   -pcid
   -srid
   -schema

relation_ways
   -relation_id
   -way_id
   -type

spatial_ref_sys
   -srid
   -auth_name
   -auth_srid
   -srtext
   -proj4text

ways
   -gid
   -class_id
   -length
   -length_m
   -name
   -source
   -target
   -x1
   -y1
   -x2
   -y2
   -cost
   -reverse_cost
   -cost_s
   -reverse_cost_s
   -rule
   -one_way
   -maxspeed_foward
   -maxspeed_backward
   -osm_id
   -source_osm
   -target_osm
   -priority
   -the_geom

ways_vertices_pgr
   -id
   -osm_id
   -cnt
   -cnt
   -chk
   -ein
   -eout
   -lon
   -lat
   -the_geom

你能告诉我我做错了什么吗?如何使用城市和街道等所有节点将 osm 文件导入数据库?感谢您的回答。

【问题讨论】:

  • 你到底错过了什么?街道名称应该在ways.name 中。城市名称可能未导入。
  • 在某种程度上是没有街道号码的街道名称,是否可以添加城市名称?我需要像这样的 root 城市 1 > city2, city2 > city3, city3 > city 4
  • osm2pgrouting 根据线路(街道、道路等)生成路由网络。城市是点,你必须分开处理。

标签: postgresql openstreetmap postgis pgrouting


【解决方案1】:

osm2pgrouting 不导入门牌号、城市等。如上所述,它导入计算路线所需的数据。还有其他工具也可以将 OSM 数据导入 postGIS。见:http://wiki.openstreetmap.org/wiki/PostGIS

其中一些其他工具会导入更多数据和标签,但可能无法使表格适合路由。

【讨论】:

  • osm2pgrouting 导入 OSM ID,因此您可以使用其他工具链接导入的数据,例如使用 oms2psql。
猜你喜欢
  • 2013-10-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-01
  • 1970-01-01
  • 2011-06-12
  • 1970-01-01
  • 2011-03-03
相关资源
最近更新 更多