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