This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

GEOFABRIK Import to Postgres Missing Data/Roads

1

I'll first start by saying that I'm new to the GIS world. I apologize if this has been posted before but I tried searching a lot and couldn't find the answer. Maybe I'm searching the wrong terms.

I am playing around with visualizing some traffic information. I've been using GEOFABRIK to download large data sets for OSM (which I believe is the suggested way of doing it). So I'll download an entire state in the US (like Michigan) in the .osm.pbf format. Next, I use a standard osm2pgsql command to import all the data into a postgres gis db.

osm2pgsql --create --latlong --slim --drop  -U myusername -d gis wisconsin-latest.osm.pbf

All this seems to go fine. Imports run well. I am now trying to run some select statements to check on the data that has been loaded. It seems to me that many of the smaller side streets are missing from this data but are present in the OSM main site. For example, the way/road with Way: Ontario Road (21447015) (https://www.openstreetmap.org/way/21447015)

But a query of:

select * from planet_osm_roads where osm_id=21447015;

results in 0 rows.

I feel like I'm just missing something. Does anyone have any guidance? I seem to be missing a lot of these side roads (which seem to exist on the OSM site). Thanks in advance!

asked 29 Mar '16, 15:33

sbryfcz's gravatar image

sbryfcz
56558
accept rate: 0%

edited 29 Mar '16, 15:42

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


One Answer:

2

The "roads" table is a misnomer and should really be called "stuff we likely draw on lower zoom levels". https://github.com/openstreetmap/osm2pgsql/blob/master/tagtransform.cpp#L38-L54 determines what gets stored in the roads table - residential roads aren't! You will find them in planet_osm_line. (The roads table is a subset of the line table.)

answered 29 Mar '16, 15:44

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

1

Thanks a ton. Changed that 1 table name and everything worked perfect.

(31 Mar '16, 22:45) sbryfcz

Source code available on GitHub .