Hey Joe,
 
I had this same problem, and was suprised that I could not find a
statically defined reference to the UTM zones either. I used the WKT
(well known text) representation of the UTM zone and fed that into the
CRSFactory's createFromWKT method. Here's my code for getting UTM zone
10.

Also, I've been told that when dealing with UTM coordinate systems, you
only need to know the zone, and not the grid (i.e. 10 S or 10 R etc...)
is this not true? In what situation does the grid matter?
 
 
    public CoordinateReferenceSystem getUtm10CRS() {
        if (utm10 == null) {
            String wkt = "PROJCS[\"UTM_Zone_10N\", " +
"GEOGCS[\"WGS84\", "
                + "DATUM[\"WGS84\", "
                + "SPHEROID[\"WGS84\", 6378137.0, 298.257223563]], "
                + "PRIMEM[\"Greenwich\", 0.0], "
                + "UNIT[\"degree\",0.017453292519943295], "
                + "AXIS[\"Longitude\",EAST], " +
"AXIS[\"Latitude\",NORTH]], "
                + "PROJECTION[\"Transverse_Mercator\"], "
                + "PARAMETER[\"semi_major\", 6378137.0], "
                + "PARAMETER[\"semi_minor\", 6356752.314245179], "
                + "PARAMETER[\"central_meridian\", -123.0], "
                + "PARAMETER[\"latitude_of_origin\", 0.0], "
                + "PARAMETER[\"scale_factor\", 0.9996], "
                + "PARAMETER[\"false_easting\", 500000.0], "
                + "PARAMETER[\"false_northing\", 0.0], "
                + "UNIT[\"metre\",1.0], " + "AXIS[\"x\",EAST], "
                + "AXIS[\"y\",NORTH]]";

            CRSFactory csFactory = FactoryFinder.getCRSFactory(null);

            try {
                utm10 = csFactory.createFromWKT(wkt);
            } catch (FactoryException e) {
                e.printStackTrace();
                throw new RuntimeException(e);
            }
        }
        return utm10;
    }

Cheers,
Andrew 


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joe
McMahon
        Sent: Tuesday, February 28, 2006 7:11 AM
        To: [email protected]
        Subject: [Geotools-gt2-users] CRS factory question
        
        
        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 = 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).
        
        Thanks,
        Joe
        
        



-------------------------------------------------------
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&kid0944&bid$1720&dat1642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to