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