Carry out the following steps:
- First, check out how the OSM .pbf file is built using ogrinfo. PBF is a binary format intended as an alternative to the OSM XML format, mainly because it is much smaller. As you must have noticed, it is composed of several layers—you will export the lines layer to PostGIS as that layer contains the street names that you will use for the overall geocoding process:
$ ogrinfo lazio.pbf Had to open data source read-only. INFO: Open of `lazio.pbf' using driver `OSM' successful. 1: points (Point) 2: lines (Line String) 3: multilinestrings (Multi Line String) 4: multipolygons (Multi Polygon) 5: other_relations (Geometry Collection)
- Export the lines' OSM features to a PostGIS table, using ogr2ogr ...