Menu

Home

Larry Reeder
Attachments
colored_world.png (82725 bytes)

Welcome

This OpenJump plugin provides a five color mapping feature for selected layers. When successful, it uses five colors to color all features so that no two adjacent features have the same colors.

Colored World Map

Plugin installation

Download the map coloring package, unzip it, and place all the files in the
unzipped folder in the $JUMP_HOME/lib/ext folder.

Plugin instructions

This plugin implements a five color mapping algorithm. Here's how to use it:

  1. Select one or more layers
  2. Got to Plugins-->Map Coloring. A dialog will appear.
  3. Check the Buffer checkbox if you want to buffer features slightly. Buffered features are not saved, they are just used for the coloring algorithm. If small slivers exist between features that should really be adjacent to each other, buffering may fix those slivers. However, buffering increases the time to run, and increases the chance that the graph of your map will be non-planar, which will prevent the coloring from working appropriately.
  4. Press Run.
  5. After a bit, a new layer will be generated that is a copy of the layers, with a new attribute called "autoclr". The autoclr attribute will have values 1 through 5, with each number representing a different color. If the map has many overlapping features or interlacing multipolygons, it may result in a non-planar graph, and some features will have an empty autoclr attribute.
  6. The new layer will have thematic coloring enabled. If you don't like the default color set, change Color Theming style to use a different set.

Colored Map With Attachments

Known bugs/issues

  1. The plugin doesn't handle cases where every feature in the map has five or more neighbors. This will be rare for most political maps, but might happen where layers contain many overlapping features or most features are adjacent multipolygons.
  2. The plugin does handle linestrings and point layers, but doesn't do much interesting with them. For linestrings, it will attempt to color overlapping ones in different colors. For points, it will color points that are on top of each other differently.
  3. For layers with thousands of features, you may encounter a stack overflow error. If you are not already using it, switching to a 64 bit JRE will help. Alternatively, you can change the thread stack size by adding -Xss512k to JAVA_OPTS in the OpenJump startup script.

Todo

  1. Performance enhancements
  2. Better notification to OpenJump when a graph is not planar.

Project Members: