Hi Matthias; the CSAuthorityFactory has changed a bit over time; I confirm that the functionality you are looking for is not available on trunk. The intention of the getAuthorityCodes method was not to look up codes for a Unit; but to look up codes for a specific kind of object being managed. ... ie IdentifiedObjects all of a code - this method is supposed to return a list of all the codes for that kind of object.

Identified objects in the system right now:
- CoordinteOperation
- CoordinateSystem
- CoordinateAxis
- Datum
- Ellipsoid
- ReferenceSystem (including CoordinateReferenceSystem)
- etc...

Now your request to look up units is also valid ... units have switch over to JSR-275 so let us explore what they have going on. I am used to looking up units as static constants (NonSI.FOOT and SI.METER for example) but I know there is some run time facilities as well...

The best I can find is the SystemOfUnits.getUnits() Set<Unit<?>> method ... which both SI and NonSI extend.

I am not sure however about discovering all the SystemOfUnits implementations on the classpath...however they must have something because hey have parsing methods around ...

Jody

Matthias Basler wrote:
Hi all,

today I decided I should upgrade GISWidgets to use the latest GeoTools version, 
namely 2.5 RC1 (it used 2.3 before). Most changes seem cosmetical and can be 
solved easily, but I run into a problem where I am missing functionality in 
2.5. that existed (intended or not) in 2.3.x:

How to query all available units (length, angle) from an authority factory. In 
particular I want all units supported by EPSG.
I have never been able to retrieve linear and angular units separately, but 
with GeoTools 2.3 the following worked:
    CSAuthorityFactory csFactory = ...
    Set<String> codes = csFactory.getAuthorityCodes(Unit.class);
Now this method requires the interface "IdentifiedObject", which is not 
supported by the Unit class.

I had a look at the user guide, but all I found was related to 
"IdentifiedObject"s.

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to