Minigeo is a lightweight Java library that allows one to plot geographical data (namely lines between points determined by geographic coordinates — a latitude-longitude pair), using Universal Transverse Mercator (UTM) projections.
The display is done using a Swing JFrame. The user may pan and zoom with the mouse à la Google Maps (i.e. drag to pan, scroll to zoom).
It is especially useful for educators, as students can very easily use this library during practical sessions.
Using Minigeo is really straightforward:
- Create a map window:
MapWindow window = new MapWindow();
- Add segments to the window:
window.addSegment(
new Segment(
new Point(48, 2),
new Point(45, -1),
Color.RED));
...
- Make the window visible:
window.setVisible(true);
That's it.
Have a look at MinigeoDemo.java: it loads coordinates from a text file (france.poly
) and draws a polygon (France's borders and coast lines) using Minigeo.