[Tile-serving] [osm2pgsql] Add area reprojection facility (#454)

Frederik Ramm notifications at github.com
Fri Oct 2 23:57:21 UTC 2015


This adds a command line option --reproject-area which is useful for those who do not import data in EPSG:3857, but a different projection, but who still want to use one of the open styles available for standard EPSG:3857 databases.

These styles will often rely on the way_area column in the polygon table for rendering decisions (e.g. draw larger lakes on smaller zoom levels, and only bring in smaller lakes later). Because way_area was, until now, computed in target projection units, styles written for EPSG:3857 would not work with a database imported, say, with the -l (ell) flag.

You can now use the --reproject-area flag which projects every polygon to EPSG:3857 temporarily to compute its way_area. 

This patch should not negatively affect the standard use case, but it will take more time on import if --reproject-area is used together with -l (ell) or -E.

A simple test is provided, covering the -l (ell) use case but not more exotic projections that should, in theory, also work, provided that the proj library is able to project from the target projection to EPSG:3857 which is not always guaranteed.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Add area reprojection facility

-- File Changes --

    M Makefile.am (6)
    M geometry-builder.cpp (86)
    M geometry-builder.hpp (8)
    M options.cpp (7)
    M options.hpp (1)
    M output-pgsql.cpp (2)
    M reprojection.cpp (38)
    M reprojection.hpp (1)
    A tests/area-reprojection.osm (27)
    A tests/test-area-reprojection.cpp (114)

-- Patch Links --

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

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


More information about the Tile-serving mailing list