从 PostGIS 查询未公开的属性

Query not exposed attributes from PostGIS

我使用 osm2pgsql 将 osm 文件加载到 PostGIS 中。现在,我想查询具有特定属性的特征。例如:"highway is not null" 和 "maxspeed is not null"。 PGadmin returns: "ERROR: column "maxspeed" 不存在"

我从 overpass-turbo 知道,我感兴趣的领域提供了这样的特性。 所以应该在场。

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

我希望查询结果带有 "maxspeed" 的附加属性列,但是 PGadmin returns: "ERROR: column "maxspeed" 不存在"

看到一个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.