Is there a way with the current set of APIs (looks like some are in flux
with opengis) to instantiate a CoordinateReferenceSystem for a particular
UTM zone. In other words, I have a UTM zone designation (either as UTM 10
North or down to the grid, i.e. UTM10R) and I need a
CoordinateReferenceSystem object to do a CoordinateOperation (transform a
point from one CRS to the other).
The example in the Tutorials has a line like:
CoordinateReferenceSystem targetCRS =3D utm10NCRS;
but the utm constant doesn't resolve for me...nor does it allow for a
dynamic value (i.e. no hardcoding of the targetCRS).
From: Martin Desruisseaux <martin.desruisseaux@no...> - 2006-03-03 08:51:12
> Is there a way with the current set of APIs (looks like some are in flux
> with opengis) to instantiate a CoordinateReferenceSystem for a
> particular UTM zone.
There is no explict API for doing this task. However, if you are using the EPSG database, you can
use the following trick. A look in the EPSG database show that there is a logic between EPSG code
and UTM zone. For example
32601 WGS 84 / UTM zone 1N
32602 WGS 84 / UTM zone 2N
32603 WGS 84 / UTM zone 3N
32604 WGS 84 / UTM zone 4N
32605 WGS 84 / UTM zone 5N
32606 WGS 84 / UTM zone 6N
32701 WGS 84 / UTM zone 1S
32702 WGS 84 / UTM zone 2S
32703 WGS 84 / UTM zone 3S
32704 WGS 84 / UTM zone 4S
32705 WGS 84 / UTM zone 5S
32706 WGS 84 / UTM zone 6S
There is also similar code ranges for UTM using WGS72, NAD27, ED50, etc. datum.
So you can use for example:
int utm_zone = 10;
CRSAuthorityFactory f = FactoryFinder.getCRSAuthorityFactory("EPSG", null);
crs = f.createCoordinateReferenceSystem("EPSG:" + (32600 + utm_zone));
Get latest updates about Open Source Projects, Conferences and News.