GeoTools : Custom Symbols for MIL2525B and EmergencyResponse

One of the off-shoots of the OWS-3 was an understanding of how to hook smbology into our code base.

This page is the result of a conversation with Theuns (who may be available for testing); written up for the amusement of Andrea Aime (and also so when the next 20 people ask I can point you to this page).

There were four solutions considered:

  1. create a custom web app to generate the symbol; refer to it as an external url ""
  2. create a custom URL format "internal:foo"
  3. create a GeoTools function that produces an Icon directly; and modify the renderer to expect a URL or Icon
  4. create a plug-in system allowing the definition of additional "WellKnownName"s

The last one ends up looking the best in practice.

(warning) Some MIL2525B symbols need to interact with Feature contents; they end up displaying the "width" of an advancing unit etc...

interface WellKnownNameIconFactory {
  boolean isKnown( String wellKnownName );
  Icon getIcon( Feature feature, String wellKnownName );
class WellKnownNameIconFinder {
  Icon findIcon( String wellKnownName );