svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.projection / org.gvsig.projection.cresques / org.gvsig.projection.cresques.impl / src / main / java / org / cresques / impl / geo / Gauss.java @ 40559
History | View | Annotate | Download (3.65 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40455 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40455 | jjdelcerro | *
|
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 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40455 | jjdelcerro | * 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 | 40559 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | 40455 | jjdelcerro | *
|
21 | 40559 | jjdelcerro | * For any additional information, do not hesitate to contact us
|
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40455 | jjdelcerro | */
|
24 | package org.cresques.impl.geo; |
||
25 | |||
26 | import org.cresques.cts.ICoordTrans; |
||
27 | import org.cresques.cts.IDatum; |
||
28 | import org.cresques.cts.IProjection; |
||
29 | import org.cresques.geo.ViewPortData; |
||
30 | |||
31 | import org.cresques.px.Extent; |
||
32 | |||
33 | import java.awt.Graphics2D; |
||
34 | import java.awt.geom.AffineTransform; |
||
35 | import java.awt.geom.Point2D; |
||
36 | import java.awt.geom.Rectangle2D; |
||
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 | } |