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));
Martin.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users