source: subversion/applications/editors/osm-editor/qt3/functions.h @ 16590

Last change on this file since 16590 was 1158, checked in by nick, 14 years ago

moved current version to qt3 directory in preparation for qt4

File size: 3.2 KB
Line 
1/*
2    Copyright (C) 1999 Alan Bleasby (gridref<->lat/long
3        conversion functions), 2004 Nick Whitelegg, Hogweed Software
4        (remainder of this file)
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU Lesser General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (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 Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser 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 USA
19
20 */
21
22// 13/03/05 changed Location to GridRef
23
24#ifndef FUNCTIONS_H
25#define FUNCTIONS_H
26
27#include <vector>
28using std::vector;
29
30#include <ctime>
31
32#include "EarthPoint.h"
33
34namespace OpenStreetMap
35{
36
37
38void            wgsToAiry(double &lat, double &lon);
39void            airyToWgs(double &lat, double &lon);
40
41struct GridRef
42{
43        double e, n;
44
45        GridRef() { e=n=-1; }
46        bool isNullLoc() { return e==-1 && n==-1; }
47        GridRef(double e1,double n1) { e=e1; n=n1; }
48};
49
50struct LatLon
51{
52        double lat, lon;
53
54        LatLon() { }
55        LatLon(double lt,double ln) { lat=lt; lon=ln; }
56};
57
58
59const int SEG_FOOTPATH = 0, 
60                  SEG_PERMISSIVE_FOOTPATH = 1,
61                  SEG_CYCLEPATH = 4, 
62                  SEG_BRIDLEWAY = 16,
63                  SEG_PERMISSIVE_BRIDLEWAY = 17,
64                  SEG_FWPBR = 18,
65                  SEG_A_ROAD = 128,
66                  SEG_B_ROAD = 129,
67                  SEG_MINOR_ROAD = 130,
68                  SEG_ESTATE_ROAD = 131,
69                  SEG_BYWAY = 132;
70
71enum { POLYGON_WOOD , POLYGON_LAKE , POLYGON_HEATH, POLYGON_URBAN,
72                  POLYGON_ACCESS_AREA };
73
74const int WAYPOINT_FARM = 10,
75                  WAYPOINT_RESTAURANT = 11,
76                  WAYPOINT_PUB = 13,
77                  WAYPOINT_GENERIC = 18,
78                  WAYPOINT_CAMPSITE = 151,
79                  WAYPOINT_CAR_PARK = 158,
80                  WAYPOINT_CAUTION = 166,
81                  WAYPOINT_HAMLET = 8198,
82                  WAYPOINT_VILLAGE = 8199,
83                  WAYPOINT_SMALL_TOWN = 8200,
84                  WAYPOINT_SUBURB = 8201,
85                  WAYPOINT_MEDIUM_TOWN = 8202,
86                  WAYPOINT_LARGE_TOWN = 8203,
87                  WAYPOINT_BRIDGE = 8233,
88                  WAYPOINT_CHURCH = 8236,
89                  WAYPOINT_TUNNEL = 8243,
90                  WAYPOINT_SUMMIT = 8246,
91                  WAYPOINT_MAST = 16391,
92                  WAYPOINT_LOCALITY = 24576,
93                  WAYPOINT_AMENITY = 24577,
94                  WAYPOINT_VIEWPOINT = 24578,
95                  WAYPOINT_STATION = 24579,
96                  WAYPOINT_POINT_OF_INTEREST = 24580,
97                  WAYPOINT_TEASHOP = 24581;
98
99EarthPoint ll_to_gr ( double lat, double lng );
100EarthPoint ll_to_gr ( const EarthPoint& );
101void GPS_Math_LatLon_To_EN(double *E, double *N, double phi,
102                           double lambda, double N0, double E0,
103                           double phi0, double lambda0,
104                           double F0, double a, double b);
105EarthPoint gr_to_ll(const EarthPoint& gridref);
106void GPS_Math_EN_To_LatLon(double E, double N, double *phi,
107                           double *lambda, double N0, double E0,
108                           double phi0, double lambda0,
109                           double F0, double a, double b);
110
111
112double dist (double, double, double, double);
113double getAngle(double o, double a, double b);
114double distp (double px,double py,double x1,double y1, double x2, double y2);
115
116void mkgpxtime (char *, time_t );
117
118}
119#endif // FUNCTIONS_H
Note: See TracBrowser for help on using the repository browser.