Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for data generalization #1942

Merged
merged 2 commits into from
Mar 8, 2023

Commits on Mar 7, 2023

  1. Add support for data generalization

    This large commit adds a framework to generalize OSM data using
    different strategies and implements several strategies. The source is
    all in the new `src/gen` directory. It includes a new command
    `osm2pgsql-gen` to access this functionality. Future versions might
    integrate it with the `osm2pgsql` command, but because this is all
    experimental it is kept separate for now. Call `osm2pgsql-gen` with
    `-h` to get usage help.
    
    See also https://osm2pgsql.org/generalization/ and the chapter on
    Generalization in the manual:
    https://osm2pgsql.org/doc/manual.html#generalization
    
    For the raster support this adds two new library dependency: CImg and
    potrace. Both have been around for a long time and are readily available
    on all systems.
    
    The following strategies work on a tile-by-tile basis and operate on
    polygons:
    
    The "vector-union" strategy buffers and unionizes polygons using vector
    operations.
    
    The "raster-union" strategy does a similar thing but does it in raster
    space which is much faster. First the polygons are rendered into a
    raster, an open/close operation is called (which basically does the same
    thing as the buffering in vector space) and finally the resulting raster
    is vectorized again.
    
    The "builtup" strategy is intended to derive a layer of builtup areas
    from landuse=residential/industrial etc. as well as building cover and
    dense road networks.
    
    The following strategies always work on all data (not tile-based):
    
    The "discrete-isolation" strategy rates places based on some importance
    metric to get a more even distribution of places on the map.
    
    The new "rivers" strategy finds important rivers, this is still very
    much work in progress.
    joto committed Mar 7, 2023
    Configuration menu
    Copy the full SHA
    899c56a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ca7c006 View commit details
    Browse the repository at this point in the history