[GIS] How to export a postgis table to a pbf file

osm2pgsqlosm2popostgisqgis

I need a tool like osm2po or osm2pgsql but that does the opposite thing, convert a postgis table to a pbf file. I think qgis can do this but I can't find that option.

Best Answer

GDAL can only read pbf files, so no chance to write it with GDAL or QGIS.

Osmosis is able to read from a postgis database and write to pbf, but only for its own snapshot or simple data scheme. These schemes use nodes, ways and relations (like they are stored in the OSM database), while a "usual" Postgis data scheme uses points, lines, multilines, polygons and multipolygons.

Converting from one scheme to the other is one of the difficult and time consuming parts of osm2pgsql.

Related Question