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 @ 40559

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