Hello I am using a PostGis Database with OSM Data. After importing the data with osm2pgsql in slim mode I found a table named Planet_osm_nodes that has places also. It seems really compressed and has all the metadata in the tags field. Now I don't really know which of these two tables I should use regarding completeness of the data and performance. If anyone of you has any thoughts and experiences on this topic it would be great!
2 Answers
planet_osm_node contains the point data in the same way they are stored in the OSM database. These nodes can contain attribute information, or are just part (vertices) of ways.
planet_osm_point is a subset of the node table, containing only the points with attributes, but not the vertices. Furthermore, it has a geometry column to use with GIS applications. That's why a postgis connection only shows this table, unless you allow for geometryless tables too. Spatial indices are built on this table, not the node one.
-
thank you for the clear and good explanation, but aren't there more entries in the point table than in the node? So how is point a subset of node?– ShachtyCommented Feb 5, 2015 at 10:19
-
No, in my database there are 47838972 nodes and 1360617 points (not the whole world).– AndreJCommented Feb 5, 2015 at 15:39
The planet_osm_point table is used much more often (than node) in documentation and examples, transforms the OSM data from an EPSG 4326 production to EPSG 900913 projection, and I've never used planet_osm_node in my work of using OSM data in applications Tilemill and qgis using the osm_point
This schema page on the osm wiki has some vague answers on the use of planet_osm_node. I'd suggest that unless you're seeking a particular reason to NOT use planet_osm_point, you should use it instead.