Statistics
| Revision:

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 / CCLambert.java @ 42543

History | View | Annotate | Download (3.97 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
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 Conica Comforme Lambert
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
    @Override
52
    public ICoordTrans getCT(IProjection dest) {
53
                // TODO Auto-generated method stub
54
                return null;
55
        }
56

    
57
    @Override
58
        public String getAbrev() {
59
        return abrev;
60
    }
61

    
62
    public static CCLambert getProjection(Ellipsoid eli) {
63
        return new CCLambert(eli);
64
    }
65

    
66
    /**
67
     *
68
     * @param eli
69
     * @param name
70
     * @return 
71
     */
72
    public static IProjection getProjectionByName(IDatum eli, String name) {
73
        if (name.indexOf("CCL") < 0) {
74
            return null;
75
        }
76

    
77
        return getProjection((Ellipsoid) eli);
78
    }
79

    
80
    /**
81
     *
82
     * @param x
83
     * @param y
84
     * @return 
85
     */
86
    @Override
87
    public Point2D createPoint(double x, double y) {
88
        return new Point2D.Double(x, y);
89
    }
90

    
91
    /**
92
     *
93
     * @param lPt
94
     * @return
95
     */
96
    @Override
97
    public Point2D toGeo(Point2D lPt) {
98
        GeoPoint gPt = new GeoPoint();
99

    
100
        return toGeo(lPt, gPt);
101
    }
102

    
103
    /**
104
     *
105
     * @param lPt
106
     * @param gPt
107
     * @return
108
     */
109
    public GeoPoint toGeo(Point2D lPt, GeoPoint gPt) {
110
        return gPt;
111
    }
112

    
113
    /**
114
     *
115
     * @param gPt
116
     * @param lPt
117
     * @return
118
     */
119
    @Override
120
    public Point2D fromGeo(Point2D gPt, Point2D lPt) {
121
        return lPt;
122
    }
123

    
124
    private void generateGrid(Graphics2D g, Extent extent, AffineTransform mat) {
125
        grid = new Graticule(this);
126
    }
127

    
128
    @Override
129
    public void drawGrid(Graphics2D g, ViewPortData vp) {
130
        generateGrid(g, vp.getExtent(), vp.getMat());
131
        grid.setColor(gridColor);
132
        grid.draw(g, vp);
133
    }
134

    
135
    /* (non-Javadoc)
136
     * @see org.cresques.cts.IProjection#getScale(double, double, double, double)
137
     */
138
    @Override
139
    public double getScale(double minX, double maxX, double width, double dpi) {
140
        // TODO Auto-generated method stub
141
        return -1D;
142
    }
143

    
144
        /* (non-Javadoc)
145
         * @see org.cresques.cts.IProjection#getExtent(java.awt.geom.Rectangle2D, double, double, double, double, double, double)
146
         */
147
    @Override
148
        public Rectangle2D getExtent(Rectangle2D extent, double scale, double wImage, double hImage, double mapUnits, double distanceUnits, double dpi) {
149
                return null;
150
        }
151

    
152

    
153
    /**
154
     *
155
     * @return
156
     */    
157
    @Override
158
        public String getFullCode() {
159
                return getAbrev();
160
        }
161

    
162
    @Override
163
    public Object clone() throws CloneNotSupportedException {
164
        return super.clone(); //To change body of generated methods, choose Tools | Templates.
165
    }
166
}