I tried to use different ways to get road osmid database, for same region. The bounding box of that region with north latitude, south latitude, east longitude, west longitude are equal to 30.7302492849 30.6552968187 104.127065029 104.039651731 (in WGS84 system) respectively.
1st approach: export .xml file (name it as map) from "https://www.openstreetmap.org/export (use Overpass API)", install "https://github.com/pgRouting/osm2pgrouting", create postgresql database using the command
osm2pgrouting --f map --conf /usr/share/osm2pgrouting/mapconfig.xml --dbname road_network --username postgres --password *** --addnodes --clean
In the created database, there are 2 tables (at least from name) that I think might contains all the roads in that region, one table named osm_ways
, which is an empty table, the other table named ways
, which is a table with 3682 lines.
2nd approach: use osmnx.core.graph_from_bbox
function in python package osmnx to get map and corresponding database, the database contains 4665 lines.
Not alone the 2 databases have different lines, some road osm id in table in 1st approach can't be found in database in 2nd approach. I thought since this 2 approaches both use openstreetmap on same region, and also will all updated if openstreetmap updated, they should get exact same database. Can someone tell me why is this the case?