root / tags / v1_0_2_Build_902 / libraries / libCq CMS for java.old / src / org / cresques / geo / Gauss.java @ 10681
History | View | Annotate | Download (3.29 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.geo; |
25 |
|
26 |
import org.cresques.cts.ICoordTrans; |
27 |
import org.cresques.cts.IDatum; |
28 |
import org.cresques.cts.IProjection; |
29 |
|
30 |
import org.cresques.px.Extent; |
31 |
|
32 |
import java.awt.Graphics2D; |
33 |
import java.awt.geom.AffineTransform; |
34 |
import java.awt.geom.Point2D; |
35 |
import java.awt.geom.Rectangle2D; |
36 |
|
37 |
|
38 |
/**
|
39 |
* Proyeccion de Gauss (Mapa de Portugal)
|
40 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador
|
41 |
*/
|
42 |
public class Gauss extends Projection { |
43 |
static String name = "Gauss"; |
44 |
static String abrev = "Gau"; |
45 |
|
46 |
public Gauss(Ellipsoid eli) {
|
47 |
super(eli);
|
48 |
grid = new Graticule(this); |
49 |
} |
50 |
|
51 |
public String getAbrev() { |
52 |
return abrev;
|
53 |
} |
54 |
|
55 |
public static Gauss getProjection(Ellipsoid eli) { |
56 |
return new Gauss(eli); |
57 |
} |
58 |
|
59 |
/**
|
60 |
*
|
61 |
*/
|
62 |
public static IProjection getProjectionByName(IDatum eli, String name) { |
63 |
if (name.indexOf("Ga") < 0) { |
64 |
return null; |
65 |
} |
66 |
|
67 |
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 |
|
126 |
public ICoordTrans getCT(IProjection dest) {
|
127 |
// TODO Auto-generated method stub
|
128 |
return null; |
129 |
} |
130 |
|
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 |
} |