Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libCq CMS for java.old / src / org / cresques / geo / Gauss.java @ 6203

History | View | Annotate | Download (3.08 KB)

1
/*
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 Gauss (Mapa de Portugal)
39
 * @author "Luis W. Sevilla" <sevilla_lui@gva.es>* @author administrador
40
 */
41
public class Gauss extends Projection {
42
    static String name = "Gauss";
43
    static String abrev = "Gau";
44

    
45
    public Gauss(Ellipsoid eli) {
46
        super(eli);
47
        grid = new Graticule(this);
48
    }
49

    
50
    public String getAbrev() {
51
        return abrev;
52
    }
53

    
54
    public static Gauss getProjection(Ellipsoid eli) {
55
        return new Gauss(eli);
56
    }
57

    
58
    /**
59
     *
60
     */
61
    public static IProjection getProjectionByName(IDatum eli, String name) {
62
        if (name.indexOf("Ga") < 0) {
63
            return null;
64
        }
65

    
66
        return getProjection((Ellipsoid) eli);
67
    }
68

    
69
    /**
70
     *
71
     */
72
    public Point2D createPoint(double x, double y) {
73
        return new Point2D.Double(x, y);
74
    }
75

    
76
    /**
77
     *
78
     * @param uPt
79
     * @return
80
     */
81
    public Point2D toGeo(Point2D gaPt) {
82
        GeoPoint gPt = new GeoPoint();
83

    
84
        return toGeo(gaPt, gPt);
85
    }
86

    
87
    /**
88
     *
89
     * @param uPt
90
     * @param gPt
91
     * @return
92
     */
93
    public GeoPoint toGeo(Point2D gaPt, GeoPoint gPt) {
94
        return gPt;
95
    }
96

    
97
    /**
98
     *
99
     * @param gPt
100
     * @param uPt
101
     * @return
102
     */
103
    public Point2D fromGeo(Point2D gPt, Point2D gaPt) {
104
        return gaPt;
105
    }
106

    
107
    private void generateGrid(Graphics2D g, Extent extent, AffineTransform mat) {
108
        grid = new Graticule(this);
109
    }
110

    
111
    public void drawGrid(Graphics2D g, ViewPortData vp) {
112
        generateGrid(g, vp.getExtent(), vp.getMat());
113
        grid.setColor(gridColor);
114
        grid.draw(g, vp);
115
    }
116

    
117
    /* (non-Javadoc)
118
     * @see org.cresques.cts.IProjection#getScale(double, double, double, double)
119
     */
120
    public double getScale(double minX, double maxX, double width, double dpi) {
121
        // TODO Auto-generated method stub
122
        return -1D;
123
    }
124

    
125
        public ICoordTrans getCT(IProjection dest) {
126
                // TODO Auto-generated method stub
127
                return null;
128
        }
129
}