Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Motivation:

JSR-108 has been replaced

Contact:

Martin Desruisseaux

Tracker:

http://jira.codehaus.org/browse/GEOT-1266

Tagline:

Excerpt

JSR-275 is ready

Table of Contents

Description

We make use of a Units library for keeping track of the difference between meters and feet etc... We have been making use of an offical JSR-108 jar.

There were two replacements available once we upgraded to Java 5

  • JScience
  • JSR-275

The JSR-275 jar is now officially available:

Status

The work has been completed.

Voting results:

Tasks

This section is used to make sure your proposal is complete (did you remember documentation?) and has enough paid or volunteer time lined up to be a success.

 

no progress

(tick)

done

(error)

impeded

(warning)

lack mandate/funds/time

(question)

volunteer needed

  1. Fix the dependency in GeoAPI, and deploy a new jar
  2. Fix any and all compile errors (mostly import statements; but may make use of the Quantity package with Java 5 generics and catch a few mistakes)
  3. Update the user guide; there is very little documentation on Units use so this will not take long.

API Changes

Change the import; use Quantity package.

There is one additional change related to Converter. I will document it in this page when I will make this change in GeoTools. Since I don't think that many use Converter directly, it will probably impact few peoples.

BEFORE

Code Block
import javax.units.SI;
import javax.units.NonSI;
import javax.units.Unit;
import javax.units.UnitFormat;
import javax.units.Converter;
import javax.units.ConversionException;

Unit PPM = Unit.ONE.multiply(1E-6);
UnitFormat.label(PPM, "ppm");

AFTER

Code Block
import javax.measure.unit.SI;
import javax.measure.unit.NonSI;
import javax.measure.unit.Unit;
import javax.measure.unit.UnitFormat;
import javax.measure.converter.UnitConverter;
import javax.measure.converter.ConversionException;

Unit PPM = Unit.ONE.times(1E-6);
UnitFormat.getInstance().label(PPM, "ppm");

Note the class name change from Converter to UnitConverter.

Documentation Changes

We will need to change the following:

  • Developers Guide references to JSR-108
  • User Guide references to JSR-108