Statistics
| Revision:

root / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / cts / gt2 / CSLambertCC.java @ 2249

History | View | Annotate | Download (3.02 KB)

1
/*
2
 * Created on 21-jun-2005
3
 *
4
 * To change the template for this generated file go to
5
 * Window>Preferences>Java>Code Generation>Code and Comments
6
 */
7
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
8
 *
9
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
10
 *
11
 * This program is free software; you can redistribute it and/or
12
 * modify it under the terms of the GNU General Public License
13
 * as published by the Free Software Foundation; either version 2
14
 * of the License, or (at your option) any later version.
15
 *
16
 * This program is distributed in the hope that it will be useful,
17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 * GNU General Public License for more details.
20
 *
21
 * You should have received a copy of the GNU General Public License
22
 * along with this program; if not, write to the Free Software
23
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
24
 *
25
 * For more information, contact:
26
 *
27
 *  Generalitat Valenciana
28
 *   Conselleria d'Infraestructures i Transport
29
 *   Av. Blasco Ib??ez, 50
30
 *   46010 VALENCIA
31
 *   SPAIN
32
 *
33
 *      +34 963862235
34
 *   gvsig@gva.es
35
 *      www.gvsig.gva.es
36
 *
37
 *    or
38
 *
39
 *   IVER T.I. S.A
40
 *   Salamanca 50
41
 *   46005 Valencia
42
 *   Spain
43
 *
44
 *   +34 963163400
45
 *   dac@iver.es
46
 */
47
package org.cresques.cts.gt2;
48

    
49
import org.geotools.cs.AxisInfo;
50
import org.geotools.cs.GeographicCoordinateSystem;
51
import org.geotools.cs.Projection;
52
import org.geotools.units.Unit;
53
import org.opengis.referencing.FactoryException;
54

    
55
/**
56
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
57
 * 
58
 */
59
public class CSLambertCC extends CoordSys {
60
        public CSLambertCC(CSDatum datum, double meridian, double origin,
61
                double sp1, double sp2, double est, double nort) {
62
                super(datum);
63
                
64
                geogCS = new GeographicCoordinateSystem(
65
                                datum.getName(null), 
66
                                datum.getDatum());
67
                        Unit linearUnit = Unit.METRE;
68
                        
69
                        javax.media.jai.ParameterList  params = 
70
                                csFactory.createProjectionParameterList("Lambert_Conformal_Conic_2SP");
71
                        params.setParameter("semi_major", datum.getDatum().getEllipsoid().getSemiMajorAxis());
72
                        params.setParameter("semi_minor", datum.getDatum().getEllipsoid().getSemiMinorAxis());
73
                params.setParameter("central_meridian", meridian);
74
                params.setParameter("latitude_of_origin", origin);
75
                params.setParameter("standard_parallel_1", sp1);
76
                params.setParameter("standard_parallel_2", sp2);
77
                params.setParameter("false_easting", 0.0);
78
                params.setParameter("false_northing", 0.0);
79
                try {
80
                                Projection projection = 
81
                                        csFactory.createProjection("Lambert", "Lambert_Conformal_Conic_2SP", params);
82
                                projCS = csFactory.createProjectedCoordinateSystem(
83
                                                projection.getName().toString(), geogCS, projection, linearUnit, AxisInfo.X, AxisInfo.Y);
84
                        } catch (FactoryException e) {
85
                                // TODO Bloque catch generado autom?ticamente
86
                                e.printStackTrace();
87
                        }
88
        }
89
        
90
        public String toString() {
91
                return projCS.toString();
92
        }
93
}