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](https://sourceforge.net/p/ojmapcoloring/wiki/Home/attachment/colored_world.png)
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:
- Select one or more layers
- Got to Plugins-->Map Coloring. A dialog will appear.
- 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.
- Press Run.
- 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.
- 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](https://sourceforge.net/p/ojmapcoloring/wiki/Home/attachment/colored_map_with_attributes.png)
Known bugs/issues
- 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.
- 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.
- 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
- Performance enhancements
- Better notification to OpenJump when a graph is not planar.
Project Members: