[Tile-serving] [osm2pgsql] Fix incorrect resizing of node cache in geometry processor (#322)

Sarah Hoffmann notifications at github.com
Wed Apr 1 20:31:20 UTC 2015


>          node_cache.resize(node_count);
> -    //get the node data
> +    // get the node data
>      mid->nodes_get_list(&node_cache.front(), node_ids, node_count);

Hmm, the return value of nodes_get_list() is ignored here, which is not good. The function returns the number of nodes actually copied in. If the geometry of some nodes is missing (think OSM data extract) the return value may be smaller than `node_count`. So there really is a second `resize()` necessary after the call that uses the return value or the vector still might be too large.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/322/files#r27608279
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150401/22d46bc1/attachment.html>


More information about the Tile-serving mailing list