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