[Java-collab] Re: [Geotools-devel] GeoTools moving forward

Paul Austin mail-lists at revolsys.com
Fri Oct 10 11:49:07 EDT 2008


I think the best way to identify a coordinate system is a CoordinateSystem
object which models the WKT CoordinateSystem. The one issue with this is
EPSG vs. ESRI have different naming for projection parameters. Internally
you can standardize on the EPSG values and get all the values from
spatialreferencing.net. Then if you're reading say a shape file you read in
the .prj file using the ESRI values and then have a factory which would
return the srid (EPSG) for the CoordinateSystem. You can then use the
EpsgCoordinateSystemFactory to get a CoordinateSystem object by srid. This
would just be done once on load.

Then when it comes to get your projection operation you would do something
like ProjectionFactory.getGeometryOperation(cs1, cs2) it would return a
GeometryOperation object with the following method

public <T extends Geometry> T perform(T geometry);

Behind the scenes this using a OrdinatesOperation to do the say inverse
projection from UTM to Geographics and then the projection from Geographics
to Mercator. The ordinates operation may have a siganture such as the
following.

public double[] perform(double... ordinates) ;

You'd implement ordinates operations for all the different projections.

At least this is the way I've been doing it in my new coordinate systems
library.

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/java-collab/attachments/20081010/23175360/attachment.html


More information about the Java-collab mailing list