Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.projection / org.gvsig.projection.cresques / org.gvsig.projection.cresques.impl / src / main / java / org / cresques / impl / cts / gt2 / CSGaussPt.java @ 40559

History | View | Annotate | Download (3.43 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.cresques.impl.cts.gt2;
25

    
26
import org.geotools.cs.AxisInfo;
27
import org.geotools.cs.GeographicCoordinateSystem;
28
import org.geotools.cs.Projection;
29

    
30
import org.geotools.measure.Angle;
31

    
32
import org.geotools.units.Unit;
33

    
34
import org.opengis.referencing.FactoryException;
35

    
36

    
37
/**
38
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
39
 *
40
 */
41
public class CSGaussPt extends CoordSys {
42
    public static CSGaussPt hgd73 = new CSGaussPt(CSDatum.d73);
43

    
44
    public CSGaussPt(CSDatum datum) {
45
        super(datum);
46
        geogCS = new GeographicCoordinateSystem(datum.getName(null),
47
                                                datum.getDatum());
48

    
49
        Unit linearUnit = Unit.METRE;
50

    
51
        javax.media.jai.ParameterList params = csFactory.createProjectionParameterList("Oblique_Stereographic");
52
        params.setParameter("semi_major",
53
                            datum.getDatum().getEllipsoid().getSemiMajorAxis());
54
        params.setParameter("semi_minor",
55
                            datum.getDatum().getEllipsoid().getSemiMinorAxis());
56
        params.setParameter("central_meridian",
57
                            (new Angle("8?07'54.862\"W")).degrees());
58

    
59
        //params.setParameter("longitude_of_origin", (new Angle("8?07'54.862\"")).degrees());
60
        params.setParameter("latitude_of_origin",
61
                            (new Angle("39?40'N")).degrees());
62
        params.setParameter("scale_factor", 1.0);
63
        params.setParameter("false_easting", 0D); //180598D);
64
        params.setParameter("false_northing", 0D); //-86990D);
65

    
66
        try {
67
            Projection projection = csFactory.createProjection("GAUSS",
68
                                                               "Oblique_Stereographic",
69
                                                               params);
70
            projCS = csFactory.createProjectedCoordinateSystem(projection.getName()
71
                                                                         .toString(),
72
                                                               geogCS,
73
                                                               projection,
74
                                                               linearUnit,
75
                                                               AxisInfo.X,
76
                                                               AxisInfo.Y);
77
        } catch (FactoryException e) {
78
            // TODO Bloque catch generado autom?ticamente
79
            e.printStackTrace();
80
        }
81
    }
82

    
83
    public String toString() {
84
        return projCS.toString();
85
    }
86
}