Statistics
| Revision:

svn-gvsig-desktop / tags / tmp_build_del / libraries / libjni-proj4 / src / pj_latlong.c @ 38629

History | View | Annotate | Download (2.49 KB)

1
/******************************************************************************
2
 * $Id: pj_latlong.c,v 1.2 2000/07/07 06:04:23 warmerda Exp $
3
 *
4
 * Project:  PROJ.4
5
 * Purpose:  Stub projection implementation for lat/long coordinates. We 
6
 *           don't actually change the coordinates, but we want proj=latlong
7
 *           to act sort of like a projection.
8
 * Author:   Frank Warmerdam, warmerda@home.com
9
 *
10
 ******************************************************************************
11
 * Copyright (c) 2000, Frank Warmerdam
12
 *
13
 * Permission is hereby granted, free of charge, to any person obtaining a
14
 * copy of this software and associated documentation files (the "Software"),
15
 * to deal in the Software without restriction, including without limitation
16
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17
 * and/or sell copies of the Software, and to permit persons to whom the
18
 * Software is furnished to do so, subject to the following conditions:
19
 *
20
 * The above copyright notice and this permission notice shall be included
21
 * in all copies or substantial portions of the Software.
22
 *
23
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29
 * DEALINGS IN THE SOFTWARE.
30
 ******************************************************************************
31
 *
32
 * $Log: pj_latlong.c,v $
33
 * Revision 1.2  2000/07/07 06:04:23  warmerda
34
 * added longlat alias
35
 *
36
 * Revision 1.1  2000/07/06 23:32:27  warmerda
37
 * New
38
 *
39
 */
40

    
41
/* very loosely based upon DMA code by Bradford W. Drew */
42
#define PJ_LIB__
43
#include        <projects.h>
44
PROJ_HEAD(latlong, "Lat/long (Geodetic)")  "\n\t";
45
PROJ_HEAD(longlat, "Lat/long (Geodetic)")  "\n\t";
46

    
47
FORWARD(forward);
48

    
49
        xy.x = lp.lam / P->a;
50
        xy.y = lp.phi / P->a;
51
        return xy;
52
}
53
INVERSE(inverse);
54

    
55
        lp.phi = xy.y * P->a;
56
        lp.lam = xy.x * P->a;
57
        return lp;
58
}
59
FREEUP; if (P) pj_dalloc(P); }
60

    
61
ENTRY0(latlong)
62
        P->is_latlong = 1;
63
        P->x0 = 0.0;
64
        P->y0 = 0.0;
65
        P->inv = inverse; P->fwd = forward;
66
ENDENTRY(P)
67

    
68
ENTRY0(longlat)
69
        P->is_latlong = 1;
70
        P->x0 = 0.0;
71
        P->y0 = 0.0;
72
        P->inv = inverse; P->fwd = forward;
73
ENDENTRY(P)