[OSM-dev] osm2pgsql and bbox imports
Stephan Knauss
osm at stephans-server.de
Fri Oct 12 17:12:17 BST 2012
Peter Wendorff writes:
> osm2pgsql has to store nodes outside the bbox because geometries that
> overlap the borders etc. should be included in the result, too.
how certain are you regarding this?
in parse-primitive.c::EndElement() I see a call to node_wanted() which only
returns true if the coordinates of the node are inside the bounding box.
it later calls osmdata->out->node_add
in output-pgsqlo.c this is pgsql_add_node which calls pgsql_nodes_set.
This is calling a prepared statement which inserts the node in the
planet_osm_nodes table.
My question is: is this code path also used during initial import?
Is this code path used during incremental updates?
My previous imports had used the xml extract as the debian protobuf library
did not work as expected. I have now also updated protobuf and using now
pbf as an input file.
The code in parse-pbf::processOsmDataNodes() does not call node_wanted().
Could it be it's simply missing there?
after this line
lon = lon_offset + (node->lon * granularity);
doing the node_wanted call and only then process the node?
Stephan
More information about the dev
mailing list