coastline_gen simple coastline generalization

Here you can find an implementation of a simple raster based technique to generalize coastlines and other polygon features for map rendering. You can find some background information on the purpose of this in my essay on coastline generalization. The newest version of this tool is available on github.
The program is written in C++ and uses the
CImg image processing library and should work on all
platforms supported by it.
The source package includes a makefile for building. It also contains a test target that demonstrates use of the tool by generalizing the coastline of Greece and the Aegean sea (see image on the right, move mouse over to see a generalized version) from the sample data set linked below. If you want to see how a generalized coastline looks like in a practical example you can do so in the demonstration map.
Version 0.5 includes new functions for generalizing inland waterbodies. The new functions are not yet properly documented and the demo in the makefile has not been updated either.
This program is licensed under the GNU General Public License version 3.
- Documentation (also included in the package)
- coastline_gen-0.5.zip (22kB) version 0.5 source package.
- greece.sqlite (7MB) Sample data from
OpenStreetMap processed using OSMCoastline. This data is Copyright OpenStreetMap contributors and licensed under ODBL. You do not need to download this separately,
make test
will do that using wget.
Visitor comments:
BTW, instead of only generalizing the coast-line, why not merging (union) the natural=water, riverbanks and coastlines so the Suez-Canal, Amazon also renders correctly?
Using your bitmap approach, the union operation would be very efficient (just add together the pixel-data of the corresponding vector sources) - I'm using a similar approach for fast union and reducing data to fixed-point coordinates.
the technique is not really suited for generalizing rivers since on a small scale map rivers are usually rendered as a single line and not as an area.
Lakes can be generalized using the same technique but need to be specifically separated from the ocean - that is what the '-f' option is for.
By submitting your comment you agree to the privacy policy and agree to the information you provide (except for the email address) to be published on this website.