[Tile-serving] [osm2pgsql] Cleanup of node-cache implementation (#358)

Sarah Hoffmann notifications at github.com
Sat May 30 13:58:42 UTC 2015


The main changes are:

* Better separation of write and read cache in flatnode store. They must not be used at the same time and the read cache must not be written when multiple threads are used. Both is now enforced with assertions.
* Hide FIXED_POINT conversion logic in ramNode. This means that now there is one single place where the conversion between double coordinates and int storage happens.
* Move force-encoding of node coordinates that did not go through the cache from the output modules to osmdata. Ensures that the encoding happens for all output modules including gazetteer.

Next to making the code more readable this fixes at least two issues. One is an off by one error in the coordinates of ways because node coordinates have been double encoded when being moved from dense to sparse node cache. The other is #158 because the ram cache now uses INT_MIN as invalid node marker, just like the flatnode store.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/358

-- Commit Summary --

  * better separation of read and write cache in flatnode store
  * check split position with comparison instead of division
  * make ramNode a class and move fixed point logic there
  * remove scale everywhere but in ramNode
  * initialize block counter
  * also int convert changed nodes
  * adapt regression tests to changes in ram cache
  * documentation

-- File Changes --

    M geometry-builder.cpp (5)
    M geometry-processor.cpp (3)
    M middle-pgsql.cpp (20)
    M node-persistent-cache-reader.cpp (16)
    M node-persistent-cache.cpp (354)
    M node-persistent-cache.hpp (18)
    M node-ram-cache.cpp (100)
    M node-ram-cache.hpp (77)
    M osmdata.cpp (11)
    M output-multi.cpp (2)
    M output-pgsql.cpp (2)
    M processor-point.cpp (10)
    M processor-point.hpp (5)
    M table.cpp (13)
    M table.hpp (3)
    M tests/regression-test.py (2)
    M util.hpp (7)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/358.patch
https://github.com/openstreetmap/osm2pgsql/pull/358.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150530/3d8c9a49/attachment.html>


More information about the Tile-serving mailing list