PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/MapView/Map/RMLatLong.h

http://github.com/route-me/route-me
C Header | 89 lines | 23 code | 10 blank | 56 comment | 0 complexity | 4deb59a821698b599f65ffc9ad2278b0 MD5 | raw file
 1//
 2//  RMLatLong.h
 3//
 4// Copyright (c) 2008-2009, Route-Me Contributors
 5// All rights reserved.
 6//
 7// Redistribution and use in source and binary forms, with or without
 8// modification, are permitted provided that the following conditions are met:
 9//
10// * Redistributions of source code must retain the above copyright notice, this
11//   list of conditions and the following disclaimer.
12// * Redistributions in binary form must reproduce the above copyright notice,
13//   this list of conditions and the following disclaimer in the documentation
14//   and/or other materials provided with the distribution.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26// POSSIBILITY OF SUCH DAMAGE.
27
28#ifndef _RMLATLONG_H_
29#define _RMLATLONG_H_
30
31#import <TargetConditionals.h>
32#if TARGET_OS_IPHONE
33#import <CoreLocation/CoreLocation.h>
34#import "RMGlobalConstants.h"
35
36/*! \struct RMSphericalTrapezium
37 
38 \brief Specifies a spherical trapezium by northwest and southeast corners, each given as CLLocationCoordinate2D, similar to specifying the corners of a box.
39 
40 A spherical trapezium is the surface of a sphere or ellipsoid bounded by two meridians and two parallels. Note that in almost all cases, the lengths of the northern and southern sides of the box are different.
41 */
42typedef struct {
43	CLLocationCoordinate2D northeast;
44	CLLocationCoordinate2D southwest;
45} RMSphericalTrapezium;
46
47#else
48
49/* From CoreLocation by Apple inc. Copyright 2008 Apple Computer, Inc. All rights reserved. */
50
51/*
52 *  CLLocationDegrees
53 *  
54 *  Discussion:
55 *    Type used to represent a latitude or longitude coordinate in degrees under the WGS 84 reference
56 *    frame. The degree can be positive (North and East) or negative (South and West).  
57 */
58typedef double CLLocationDegrees;
59/*
60 *  CLLocationCoordinate2D
61 *  
62 *  Discussion:
63 *    A structure that contains a geographical coordinate.
64 *
65 *  Fields:
66 *    latitude:
67 *      The latitude in degrees.
68 *    longitude:
69 *      The longitude in degrees.
70 */
71typedef struct {
72	CLLocationDegrees latitude;
73	CLLocationDegrees longitude;
74} CLLocationCoordinate2D;
75
76#endif
77
78/*! \struct RMLatLong 
79 \brief latitude/longitude of a point, in WGS-84 degrees
80 */
81typedef CLLocationCoordinate2D RMLatLong;
82
83/// \bug magic numbers
84static const double kRMMinLatitude = -kMaxLat;
85static const double kRMMaxLatitude = kMaxLat;
86static const double kRMMinLongitude = -kMaxLong;
87static const double kRMMaxLongitude = kMaxLong;
88
89#endif