[GIS] Difference between planet_osm_polygon and planet_osm_point tables

openstreetmaposm2pgsqlpostgis

What's the difference between the planet_osm_polygon and planet_osm_point tables? I find similar columns in both tables.

Best Answer

The difference is in the names: planet_osm_point contains point features from OSM, that is, nodes that have tags on them. Columns in both tables are tags, plus way for geometry.

Planet_osm_polygon contains polygons and processed multipolygons (so you don't need to collect multipolygons yourself). So, for example, building contours would be included in _polygon table, while shop nodes have to be collected from _point.

I don't know why it was decided to split points and polygons (and lines) into different tables. This probably allows disk space optimization, for tags allowed for those types of geometries are different (see default.style from osm2pgsql directory).