Statistics
| Revision:

svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / cts / gt2 / CSLambertCC.java @ 2312

History | View | Annotate | Download (2.54 KB)

1
/*
2
 * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
3
 * 
4
 * Copyright (C) 2004-5. 
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
 *
20
 * For more information, contact:
21
 * 
22
 * cresques@gmail.com
23
 */
24
package org.cresques.cts.gt2;
25

    
26
import org.geotools.cs.AxisInfo;
27
import org.geotools.cs.GeographicCoordinateSystem;
28
import org.geotools.cs.Projection;
29
import org.geotools.units.Unit;
30
import org.opengis.referencing.FactoryException;
31

    
32
/**
33
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
34
 * 
35
 */
36
public class CSLambertCC extends CoordSys {
37
        public CSLambertCC(CSDatum datum, double meridian, double origin,
38
                double sp1, double sp2, double est, double nort) {
39
                super(datum);
40
                
41
                geogCS = new GeographicCoordinateSystem(
42
                                datum.getName(null), 
43
                                datum.getDatum());
44
                        Unit linearUnit = Unit.METRE;
45
                        
46
                        javax.media.jai.ParameterList  params = 
47
                                csFactory.createProjectionParameterList("Lambert_Conformal_Conic_2SP");
48
                        params.setParameter("semi_major", datum.getDatum().getEllipsoid().getSemiMajorAxis());
49
                        params.setParameter("semi_minor", datum.getDatum().getEllipsoid().getSemiMinorAxis());
50
                params.setParameter("central_meridian", meridian);
51
                params.setParameter("latitude_of_origin", origin);
52
                params.setParameter("standard_parallel_1", sp1);
53
                params.setParameter("standard_parallel_2", sp2);
54
                params.setParameter("false_easting", 0.0);
55
                params.setParameter("false_northing", 0.0);
56
                try {
57
                                Projection projection = 
58
                                        csFactory.createProjection("Lambert", "Lambert_Conformal_Conic_2SP", params);
59
                                projCS = csFactory.createProjectedCoordinateSystem(
60
                                                projection.getName().toString(), geogCS, projection, linearUnit, AxisInfo.X, AxisInfo.Y);
61
                        } catch (FactoryException e) {
62
                                // TODO Bloque catch generado autom?ticamente
63
                                e.printStackTrace();
64
                        }
65
        }
66
        
67
        public String toString() {
68
                return projCS.toString();
69
        }
70
}