Dashboard > GeoTools 2.5 Users Guide > ... > 01 Welcome > 02 Meet the GeoTools Library
GeoTools 2.5 Users Guide
02 Meet the GeoTools Library
Added by jgarnett , last edited by jgarnett on Nov 25, 2007  (view change)
Labels: 
(None)

This page answers the question "What jars do I need" - the answer depends on what you are doing. This page introduces the you to the parts of the GeoTools library and how they fit together, we have isolated the parts into individual jars - so you can use just the right amount of GeoTools in your next project.

The examples (03 First Project and 04 How to Read a Shapefile) are writen with the maven build system in mind. The maven build system is very good at sorting out dependencies between lots of little jars - and is the recommended way to start using GeoTools.

Traditionally users just dump all the jars into their IDE and have a go, please be advised that some of the jars will be in conflict.

  1. Dump everything from a binary distribution of GeoTools into your IDE
  2. Remove all the jars that say epsg in them - except for the gt2-epsg jar.
  3. Ensure your JRE has JAI and ImageIO installed if you are going to do raster work
  4. Ignore the rest of this page

Using maven in concert with your IDE, and looking over the pictures on this page is recommended since there are often two many jars to manage by hand.

Meet the Library

The GeoTools library is constructed as a series of layers.

Layer Jar Purpose
Render gt2-render Draw a map (just to a Graphics2D)
JDBC gt2-jdbc for reading spatial information from a database
Data gt2-data for reading spatial data
Main gt2-main implements filter, feature, etc...
Coverage gt2-coverage read raster information
API gt2-api our public interfaces
Referencing gt2-referencing defines where coordiantes show up on a map
Metadata gt2-metadata identity, description, and so on.

Not all of these layers are provided by us - where other projects are willing to do the work we are happy to benefit.

Project Purpose
GeoAPI interfaces for coordinate reference systems, geometry, etc..
JTS provides an implementation of Geometry

This is the software stack!

Each layer of the stack is built on the ones below it:

  • To work on referencing you need geoapi, gt2-metadata and gt2-referencing modules. They will function on their own!
  • To read data you need jts, gt2-data, gt2-main, gt2-api, gt2-referencing, gt2-data along with geoapi, gt2-metadata and gt2-referencing.

Meet the Plugins

Of course that is not the complete picture - just by itself the GeoTools library does not do anything. There are plug-ins to for different data formats (so the data module can work), different coordinate reference system authorities (so the referencing module can work) and so on.

Plugin JDBC Layer
postgis Work directly with a PostGIS database
db2 Work directly with a DB2 database
oracle Work directly with an Oracle database
Plugin Data Layer
shape Adds the shapefile read/write support
wfs Adds WFS read/write support
arcsde Communicate with ArcSDE
Plugin Coverage Layer
geotiff Work with geotiff rasters
arcgrid Work with the arcgrid format
mig Work with the MIF format
Plugin Referencing Layer
epsg-access Work with the offical EPSG database as shipped in Access format
epsg-hsql Pure solution for working with the offical EPSG database
epsg-wkt Lightweight solution working with unoffical EPSG codes
epsg-postgresql Work with the offical EPSG database loaded into Postgresql
epsg-oracle Work with the offical EPSG database loaded into Oracle

Usually at least one plug-in is needed for each layer for GeoTools to do something. As an example every time you use the referencing module please make sure you have an epsg plugin around (or the referencing module will not know that "EPSG:4326" is the world as we know it).

Meet the Extensions

We have gone a bit further and implemented some interesting functionality on top of the GeoTools library. This code is kind of fun and may be useful in your own project.

Extension Purpose
validation Use to define and enforce constraints on your spatial data
graph Build networks from your spatial data, find the shortest route between two points
shapefile-renderer A really fast renderer just for shapefiles
mappane A Swing widget as an example for your own application

How good is this Stuff

The GeoTools library is live and online! So you can check up on modules, plugins and extensions you are about to use:

This page includes a description of how good each module is (more stars is better). If there are any serious problems (ie a red star) you may want to click on the module name to find out more information.

The Module Matrix also lists some cool unsupported stuff - this falls into the "not ready" category.

Site running on a free Atlassian Confluence Open Source Project License granted to The Codehaus. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.2 Build:#919 Nov 26, 2007) - Bug/feature request - Contact Administrators