Skip to end of metadata
Go to start of metadata

A HowTo for beginners

Note: Work in progress.

This section is thought to contain task-oriented code snippets useful for beginners. Explainations should be kept simple and without too many details on specs and implementation internals. Each snippet shall have a version tag to tell for which GeoTools version it was developed (e.g. GT2.0, GT2.1, ...). Information for the advanced user shall be geiven below each how-to in form of links to advanced tutorial/snippet pages or relevant specifications.

How to build a map?

As known from nearly every GIS a map consists of map layers. In GeoTools this is the same:

Creating a map (GeoTools2.1)

The exact method to add data to the map depends on the data type, e.g. raster or vector data. Some examples are given in the snippets below.

See also:
Tutorials: Putting everything together

How to load a shapefile into the map?

In order to load a shapefile its URL must be known. This can be a local or remote URL.

Loading shapefiles (GeoTools2.1)

See also:
Tutorials: Putting everything together

How to load a GeoTiff image into the map?

GeoTiff is an open and wellknown format for georeferenced images. Images can be viewed with almost any viewer supporting plain TIFF images, but usually only GIS programs can utilize the geographical metadata stored in GeoTiff. Loading such images in GeoTools requires the "geotiff" plugin, to be found in ".../plugin/geotiff/gt2-geotiff.jar" (in GeoTools2.1).
The GeoTiff is, in the GeoTools language, a "GridCoverage". A "coverage" delivers a value for every coordinate (within its bounds of course), and a grid coverage uses a grid (a raster image) to achieve that.

Loading shapefiles (GeoTools2.1)

See also:
Tutorials: Putting everything together
For styles and symbolizers:
Snippets: Use of external graphicsas symbols

  • No labels