root / tags / v1_0_2_Build_900 / libraries / libCq CMS for java.old / src / org / cresques / cts / gt2 / CSGaussPt.java @ 10562
History | View | Annotate | Download (3.36 KB)
1 | 94 | luisw | /*
|
---|---|---|---|
2 | 2809 | nacho | * 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 | 94 | luisw | */
|
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 | 2809 | nacho | |
30 | import org.geotools.measure.Angle; |
||
31 | |||
32 | 94 | luisw | import org.geotools.units.Unit; |
33 | |||
34 | 2809 | nacho | import org.opengis.referencing.FactoryException; |
35 | |||
36 | |||
37 | 94 | luisw | /**
|
38 | * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
|
||
39 | 2809 | nacho | *
|
40 | 94 | luisw | */
|
41 | public class CSGaussPt extends CoordSys { |
||
42 | 2809 | nacho | 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 | 94 | luisw | } |