[Tile-serving] [osm2pgsql] osc apply not deleting nodes (#448)

Paul Norman notifications at github.com
Thu Sep 10 03:31:57 UTC 2015


> eleted nodes in .osc files have no coordinates anymore (since mid-2012), hence osm2pgsql cannot decide whether the node falls into your bbox or not.

It's probably safe to just delete then - if it's outside the bbox it won't touch any rows, and if inside, it'll delete it.

Perhaps something like this?

```c++
double lat = node.location().lat();
double lon = node.location().lon();

if (node.deleted()) {
    data->node_delete(node.id());
} else if (bbox.inside(lat, lon)) {
    proj->reproject(&lat, &lon);
    convert_tags(node);
    if (append) {
        data->node_modify(node.id(), lat, lon, tags);
    } else {
        data->node_add(node.id(), lat, lon, tags);
    }
}
```

Of course, I'd want to add a test case so we know the behavior is correct and if there's a regression.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/448#issuecomment-139106483
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150909/6bd58611/attachment.html>


More information about the Tile-serving mailing list