svn-gvsig-desktop / tags / v1_1_Build_1007 / libraries / libCq CMS for java.old / src / org / cresques / geo / Gauss.java @ 12478
History | View | Annotate | Download (3.35 KB)
1 | 2 | luisw | /*
|
---|---|---|---|
2 | 2809 | nacho | * Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 | 2 | luisw | *
|
4 | 2809 | nacho | * 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 | 2 | luisw | */
|
24 | package org.cresques.geo; |
||
25 | |||
26 | 6203 | nacho | import org.cresques.cts.ICoordTrans; |
27 | 2809 | nacho | import org.cresques.cts.IDatum; |
28 | import org.cresques.cts.IProjection; |
||
29 | |||
30 | import org.cresques.px.Extent; |
||
31 | |||
32 | 2 | luisw | import java.awt.Graphics2D; |
33 | import java.awt.geom.AffineTransform; |
||
34 | import java.awt.geom.Point2D; |
||
35 | 7196 | caballero | import java.awt.geom.Rectangle2D; |
36 | 2 | luisw | |
37 | |||
38 | /**
|
||
39 | * Proyeccion de Gauss (Mapa de Portugal)
|
||
40 | * @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador
|
||
41 | */
|
||
42 | 2809 | nacho | public class Gauss extends Projection { |
43 | static String name = "Gauss"; |
||
44 | static String abrev = "Gau"; |
||
45 | 2 | luisw | |
46 | 2809 | nacho | public Gauss(Ellipsoid eli) {
|
47 | super(eli);
|
||
48 | grid = new Graticule(this); |
||
49 | } |
||
50 | 2 | luisw | |
51 | 2809 | nacho | public String getAbrev() { |
52 | return abrev;
|
||
53 | } |
||
54 | 2 | luisw | |
55 | 2809 | nacho | public static Gauss getProjection(Ellipsoid eli) { |
56 | return new Gauss(eli); |
||
57 | } |
||
58 | 2 | luisw | |
59 | 2809 | nacho | /**
|
60 | *
|
||
61 | */
|
||
62 | public static IProjection getProjectionByName(IDatum eli, String name) { |
||
63 | if (name.indexOf("Ga") < 0) { |
||
64 | return null; |
||
65 | } |
||
66 | 2 | luisw | |
67 | 2809 | nacho | return getProjection((Ellipsoid) eli);
|
68 | } |
||
69 | |||
70 | /**
|
||
71 | *
|
||
72 | */
|
||
73 | public Point2D createPoint(double x, double y) { |
||
74 | return new Point2D.Double(x, y); |
||
75 | } |
||
76 | |||
77 | /**
|
||
78 | *
|
||
79 | * @param uPt
|
||
80 | * @return
|
||
81 | */
|
||
82 | public Point2D toGeo(Point2D gaPt) { |
||
83 | GeoPoint gPt = new GeoPoint();
|
||
84 | |||
85 | return toGeo(gaPt, gPt);
|
||
86 | } |
||
87 | |||
88 | /**
|
||
89 | *
|
||
90 | * @param uPt
|
||
91 | * @param gPt
|
||
92 | * @return
|
||
93 | */
|
||
94 | public GeoPoint toGeo(Point2D gaPt, GeoPoint gPt) { |
||
95 | return gPt;
|
||
96 | } |
||
97 | |||
98 | /**
|
||
99 | *
|
||
100 | * @param gPt
|
||
101 | * @param uPt
|
||
102 | * @return
|
||
103 | */
|
||
104 | public Point2D fromGeo(Point2D gPt, Point2D gaPt) { |
||
105 | return gaPt;
|
||
106 | } |
||
107 | |||
108 | private void generateGrid(Graphics2D g, Extent extent, AffineTransform mat) { |
||
109 | grid = new Graticule(this); |
||
110 | } |
||
111 | |||
112 | public void drawGrid(Graphics2D g, ViewPortData vp) { |
||
113 | generateGrid(g, vp.getExtent(), vp.getMat()); |
||
114 | grid.setColor(gridColor); |
||
115 | grid.draw(g, vp); |
||
116 | } |
||
117 | |||
118 | /* (non-Javadoc)
|
||
119 | * @see org.cresques.cts.IProjection#getScale(double, double, double, double)
|
||
120 | */
|
||
121 | public double getScale(double minX, double maxX, double width, double dpi) { |
||
122 | // TODO Auto-generated method stub
|
||
123 | return -1D; |
||
124 | } |
||
125 | 6203 | nacho | |
126 | public ICoordTrans getCT(IProjection dest) {
|
||
127 | // TODO Auto-generated method stub
|
||
128 | return null; |
||
129 | } |
||
130 | 7196 | caballero | |
131 | public Rectangle2D getExtent(Rectangle2D extent, double scale, double wImage, double hImage, double changeUnits, double dpi) { |
||
132 | // TODO Auto-generated method stub
|
||
133 | return null; |
||
134 | } |
||
135 | 11344 | dguerrero | |
136 | public String getFullCode() { |
||
137 | return getAbrev();
|
||
138 | } |
||
139 | 2 | luisw | } |