Coordinate Transformation Service

From OpenJUMP Wiki
Jump to: navigation, search

This page is intended for OpenJUMP and Coordinate Transformation Service developpers.

For a user guide of how to transform a layer with OpenJUMP, see CTS Extension.

What is a Coordinate Reference System (CRS)?

A Coordinate Reference System is a coordinate system that enables every location on the Earth to be specified by a set of numbers

It can be of 3 main sorts :

  • Cartesian - e.g. x,y,z - not much used except by geodesian and during transformation processes
  • Geographic - e.g. longitude, latitude, and sometimes elevation or height above ellipsoid
  • Projected - e.g. x-North, y-East - used for cartographic purposes, there are dozens of possible projection

Coordinate Reference System are defined by :

  • A Datum (WGS84, ETRS, ED50...) : mandatory for any CRS
  • An Ellipsoid and a Prime Meridian : mandatory for Geographic and Projected CRS
  • A Projection : mandatory for Projected CRS


There is a well established CRS registry called EPSG, including definitions of hundreds of CRS.


Most widely used formats to describe CRS are :

  • WKT (Well Known Text) : there is a format specified by OGC and several variants (like ESRI proj files) introducing compatibility problems.
  • proj text file used by the Proj4 library where each CRS is defined on a single line
  • EPSG database (using MS Access, hsql database or h2 database)

Coordinate Transformation Service library in non java language

There is popular and mature CRS transformation tool called Proj4 which is used by

  • PostGIS (spatial database)
  • ogr2ogr, based on the OGR library (a popular command line tool able to change coordinates and/or data format of a dataset)

Coordinate Transformation Service in/from Java

GeoAPI

It is a library including java interfaces conforming OGC Standards for Coordinate Transformation Service and some other topics. At the origin, it has been developped to make libraries like OpenJUMP and Geotools interoperable. Today, GeoToolKit is the only java library implementing the GeoAPI, but adapters have been developed for Proj4 so the GeoAPI can be a general interface for any CTS implementation.


GeoTools and GeoToolKit

  • GeoTools has developped a pure java Coordinate Transformation Service. It has been a GeoAPI implementation for a long time, but it is no more.
  • Ede has developped CTS Extension for OpenJUMP which makes GeoTools CTS accessible from OpenJUMP. It is based on a quite old version of GeoTools.
  • GeoToolKit is a fork of GeoTools. GeoToolKit is still a strict implementation of GeoAPI.


Port of Proj4 library into Java

JhLabs has ported Proj4 code into Java. It is not a complete implementation of GeoAPI and has much less classes than GeoTools or GeoToolKit. It is available from two places :

  • As Proj4J, hosted by OsGEO and maintained by M. Davis
  • As JMapProjLib, on sourceforge, maintained by B. Jenny


iGOR

ISA has developped a thin wrapper making ogr2ogr available from java (and from SkyJUMP). It is Mainly a java UI calling ogr2ogr.exe SkyJUMP com/isa/jump/plugin/igor package contains 4 classes which may be able to port IGOR to OpenJUMP quite easily.


CTS

I (Michaël) developped a CTS library which is an on-going work and which lies somewhere between Proj4J and GeoTools. Source code is available on OrbisGIS web site. I used an old version of this library to create JTransfoCoord, and I've refactored it several times since then. My goals would be to achieve it and to implement GeoAPI, but I have no deadline and only sparse time to do it ;-)