Added by jgarnett, last edited by Adrian Custer on Sep 14, 2008  (view change) show comment

Labels

 
(None)

About the Referencing Module

What does referencing do

You will eventually care about this as it defines how 2D data actually means 3D data.

You can take a measurement (ie a coordinate) plus a coordinate reference system (the meaning) and figure out where a position on the earth is in 3D space.

Coordinates are an array of double. Like like X/Y - but we only wish they were X,Y. They are actually LAT/LONG or LONG/LAT or angle,angle,angle or something crazy like time. Given two CoordinateReferenceSystems you can make a math transform from one to the other. So you could take angle/angle/angle and munch it into something you like for 3D.

We will get into this again when you actually have some data - the CoordinateReferenceSystem will tells you what the data "means".

Much like 3.0 and "three meters". The first is a number, and the second one means a length.

Can I just use Referencing without the rest of GeoTools

Yes, you will need to use the metadata module, and one of the epsg modules. Along with their dependencies such as units.

Problems defining a CoordinateReferenceSystem

Cannot find an EPSG Code

You need to have one of the epsg plugins on your CLASSPATH. We recommend epsg-hsql for most uses.

I cannot re-project my shapefile (missing "Bursa wolf parameters")

This error occurs when you try to re-project a shapefile with a custom coordinate reference system:

MathTransform transform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, moroccoCRS)

This problem often occurs when working with a custom coordinate reference system, if you look in your shapefile's prj file you will see that the contents is normal "well known text".

The "Bursa-Wolf parameters" define the relationship (and a transformation) between the spheroid being used by your shapefile and the normal WGS84 spheroid.

The GeoAPI javadocs has some help for you here:

You may need to review the math (see 3.5.2.5 Helmert Transformation on this page):

Your best bet is to look up the normal EPSG code for your area; and update your prj file to include the official definition.

How do I Transform

The MathTransform interface is used to transform (or "re-project") one DirectPosition at a time.

How to Transform a Geometry

You can use the JTS utility class to create a new geometry in the desired projection:

How to Transform an Envelope

You can use the JTS utility class to create a new Envelope in the desired projection:

How to Transform a GridCoverage

You can use a resample operation to produce a GridCoverage in the desired projection: