Search code examples
postgisopenstreetmapqgisosm2pgsql

Query not exposed attributes from PostGIS


I loaded an osm-file into PostGIS by using osm2pgsql. Now, I would like to query features with specific attributes. For example: "highway is not null" with "maxspeed is not null". PGadmin returns: "ERROR: column "maxspeed" does not exist"

From overpass-turbo I know, my area of interest provides such characteristics. So should be present.

select * from planet_osm_line
where highway is not null and maxspeed is not null

I expect a query result with a additional attribute column of "maxspeed", but PGadmin returns: "ERROR: column "maxspeed" does not exist"


Solution

  • See a similar question at gis.stackexchange.com. Quoting the answer:

    The default.style file https://github.com/openstreetmap/osm2pgsql/blob/master/default.style does not pick maxspeed into its own column. Edit default.style or use the --hstore option for writing all the tags into hstore.