Building a Geographic Application

To build a Geographic tool or application, a GeoDisplay can be used to provide the basic map display. An application should include geographic layers for data, usually obtained from one or more GeoReaders.

When designing a geographic application, first determine what the application is designed to do, and how it will be used. Most geographic applications simply display objects at a particular location, representing the object's location on the surface of the earth. More sophisticated applications may include tracking objects dynamically over time, manipulating regions, or displaying more complex data.

Map Data

The application, and the data used, will determine which map data you should use. Each of the different map data sets has different characteristics, and an application may use one or more sources of map data. Presently, Prajna supports geographic data sets, and more may be added in the future.

ESRI Shape Files

ESRI Shape Files are the geographic data format used by the ESRI suite of GIS tools. They provide vector data for maps. This data is separated into different files depending on geographic feature, such as coastlines, rivers, country borders. The shape files may also have a variety of data associated with each geographic element.

As a vector-based format, ESRI shape files may be easily projected into different projections. The vector format also may be used to determine whether a point is inside a particular geographic feature. However, the resolution of each shape file is fixed. Using a world-level map when you need to display the details of a small area creates inaccuracies as well as ugly maps.

Google Map Images

The Google Map data is an image format used by Google Maps and Google Earth, breaking the earth's surface into a square tile grid. Each tile is a standard size, and multiple levels of resolution are available, from the entire world all the way to street-level detail. The image formats are also aesthetically pleasing to most users, so they make an excellent background map image.

As an image-based format, the Google map images cannot be easily projected into different projections. They use the Mercator map projection by default, which has familiar though annoying distortion problems (e.g., Greenland looks larger than South America). The map data has no data included with it, and therefore is only useful as a background map. Furthermore, Google maps require access to the Google map server, which is not available on intranets.


KML, or Keyhole Markup Language, is a de facto standard for geographic overlays. It is an XML-based format Google developed to display additional data over Google Maps and Google Earth. KML is primarily a vector-based format, though imagery can be included as well. KML can also include a variety of data associated with the various geographic features.

As an overlay, KML does not normally provide complete sets of map objects. Instead, KML overlays are useful for representing places of interest or geographic events. KML is therefore useful for adding data on top of other map data.

Map Displays

A map may be easily displayed using the GeoDisplay classes such as GeoCanvas, GoogleGeoCanvas, or the GraphGeoCanvas in the prajna.geoviz package. These classes provide the functionality to display maps with different features, pan and zoom around the map, or change the projection.

Typically, static map features, such as coastlines, rivers or citiees, are organized into Geographic Layers. These map layers are composed of various geographic objects. The GeoDisplay classes render the layers in the order which they were added to the geographic display. In addition, the GeoDisplay classes include an implicit overlay layer which can include various geographic overlay objects. The overlay layer is rendered last.

The GeoDisplay classes are designed as Java Swing components, and can be added easily in a client application. You should design a user interface which provides the specific geographic functions needed for your application. Prajna includes some example geographic applications in the prajna.demo directory.

Another map display is the GoogleMapPopup class, which can be used to display a particular location. It is designed as a popup frame, rather than an embeddable component. You might consider using it if you do not want a map to be visible at all times, but might want a geographic display to provide additional context. The GoogleMapPopup also includes a locator function, though it may not recognize some geographic areas.