[OSM-dev] osm2pgsql: avoid addition to planet_osm_point when importing ways?

Sarah Hoffmann lonvia at denofr.de
Mon Sep 28 22:25:26 UTC 2015


Hi,

On Mon, Sep 28, 2015 at 10:25:26PM +0200, Stefan Keller wrote:
> I have to check that.
> 
> I addmittedly enabled hstore as well as osm_timestamp, osm_changeset,
> osm_version and osm_uid in the osm2pgsql style file.
> 
> But I never expected to get constituent nodes added to
> planet_osm_point as Nick asked in the initial thread.

The algorithm is to keep an object when any of the normal
columns are filled. If you put one of the special osm_* values
in your style file, then a column will be created for it which
by default is always filled. Consequently all objects get imported.

If that is not what you want, simply leave the values out of
your style file (but keep the -x parameter) and the values will
only appear in the hstore. Filtering is then only done according
to tags.

If you still need the osm_* attributes as columns you can use
lua scripts to fine-tune the filtering.

We could also discuss if the current default behaviour is sensible
but I suggest opening an issue on github for that.

> I also observed that planet_osm_polygon alternatively leaves out
> osm_timestamp and osm_changeset when querying for
> osm_id;osm_timestamp;osm_changeset;osm_version;osm_uid: E.g.
> 69915513;"";5332183;1;110450
> 85344383;"2015-07-21T19:23:41Z";;3;3068030
> 173060743;"";16080891;4;122489
> ...

I cannot reproduce that. Please provide more details: osm2pgsql
version, input data, osm2pgsql commandline and exact query you
used to get the results above (e.g. are quering regular columns
or the hstore column).

Kind regards

Sarah

> 2015-09-28 13:25 GMT+02:00 Frederik Ramm <frederik at remote.org>:
> > Hi,
> >
> > On 09/27/2015 05:24 PM, Stefan Keller wrote:
> >> And: I can't imagine who needs these "way supporting" coordinates
> >> there (since there's osm_nodes).
> >
> > Nodes which have none of the tags defined in your osm2pgsql.style will
> > not end up in planet_osm_point (if they do, it's a bug, or a careless
> > use of the hstore facility).
> >
> > Bye
> > Frederik
> >
> > --
> > Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"
> >
> > _______________________________________________
> > dev mailing list
> > dev at openstreetmap.org
> > https://lists.openstreetmap.org/listinfo/dev
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list