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