Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions GPX/GPXBounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
/// ---------------------------------

/** The minimum latitude. */
@property (nonatomic, assign) CGFloat minLatitude;
@property (nonatomic, assign) double minLatitude;

/** The minimum longitude. */
@property (nonatomic, assign) CGFloat minLongitude;
@property (nonatomic, assign) double minLongitude;

/** The maximum latitude. */
@property (nonatomic, assign) CGFloat maxLatitude;
@property (nonatomic, assign) double maxLatitude;

/** The maximum longitude. */
@property (nonatomic, assign) CGFloat maxLongitude;
@property (nonatomic, assign) double maxLongitude;


/// ---------------------------------
Expand All @@ -42,6 +42,6 @@
@param maxLongitude The maximum longitude.
@return A newly created bounds element.
*/
+ (GPXBounds *)boundsWithMinLatitude:(CGFloat)minLatitude minLongitude:(CGFloat)minLongitude maxLatitude:(CGFloat)maxLatitude maxLongitude:(CGFloat)maxLongitude;
+ (GPXBounds *)boundsWithMinLatitude:(double)minLatitude minLongitude:(double)minLongitude maxLatitude:(double)maxLatitude maxLongitude:(double)maxLongitude;

@end
18 changes: 9 additions & 9 deletions GPX/GPXBounds.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (id)initWithXMLElement:(TBXMLElement *)element parent:(GPXElement *)parent
return self;
}

+ (GPXBounds *)boundsWithMinLatitude:(CGFloat)minLatitude minLongitude:(CGFloat)minLongitude maxLatitude:(CGFloat)maxLatitude maxLongitude:(CGFloat)maxLongitude
+ (GPXBounds *)boundsWithMinLatitude:(double)minLatitude minLongitude:(double)minLongitude maxLatitude:(double)maxLatitude maxLongitude:(double)maxLongitude
{
GPXBounds *bounds = [GPXBounds new];
bounds.minLatitude = minLatitude;
Expand All @@ -49,42 +49,42 @@ + (GPXBounds *)boundsWithMinLatitude:(CGFloat)minLatitude minLongitude:(CGFloat)

#pragma mark - Public methods

- (CGFloat)minLatitude
- (double)minLatitude
{
return [GPXType latitude:_minLatitudeValue];
}

- (void)setMinLatitude:(CGFloat)minLatitude
- (void)setMinLatitude:(double)minLatitude
{
_minLatitudeValue = [GPXType valueForLatitude:minLatitude];
}

- (CGFloat)minLongitude
- (double)minLongitude
{
return [GPXType longitude:_minLongitudeValue];
}

- (void)setMinLongitude:(CGFloat)minLongitude
- (void)setMinLongitude:(double)minLongitude
{
_minLongitudeValue = [GPXType valueForLongitude:minLongitude];
}

- (CGFloat)maxLatitude
- (double)maxLatitude
{
return [GPXType latitude:_maxLatitudeValue];
}

- (void)setMaxlat:(CGFloat)maxLatitude
- (void)setMaxLatitude:(double)maxLatitude
{
_maxLatitudeValue = [GPXType valueForLatitude:maxLatitude];
}

- (CGFloat)maxLongitude
- (double)maxLongitude
{
return [GPXType longitude:_maxLongitudeValue];
}

- (void)setMaxlon:(CGFloat)maxLongitude
- (void)setMaxLongitude:(double)maxLongitude
{
_maxLongitudeValue = [GPXType valueForLongitude:maxLongitude];
}
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXElementSubclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "GPXElement.h"
#import "TBXML.h"
#import <TBXML/TBXML.h>

@interface GPXElement ()

Expand Down
9 changes: 9 additions & 0 deletions GPX/GPXExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@
*/
@interface GPXExtensions : GPXElement

/** Waypoint speed in meters per second. */
@property (nonatomic, assign) double speed;

/** Waypoint travel direction. */
@property (nonatomic, assign) double course;

/** Waypoint activity. */
@property (strong, nonatomic) NSString *activity;

@end
39 changes: 38 additions & 1 deletion GPX/GPXExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,56 @@
#import "GPXExtensions.h"
#import "GPXElementSubclass.h"

@implementation GPXExtensions
@implementation GPXExtensions {
NSString *_speedValue;
NSString *_courseValue;
}

@synthesize speed = _speed;
@synthesize course = _course;
@synthesize activity = _activity;

#pragma mark - Instance

- (id)initWithXMLElement:(TBXMLElement *)element parent:(GPXElement *)parent
{
self = [super initWithXMLElement:element parent:parent];
if (self) {
_speedValue = [self textForSingleChildElementNamed:@"speed" xmlElement:element];
_courseValue = [self textForSingleChildElementNamed:@"course" xmlElement:element];
_activity = [self textForSingleChildElementNamed:@"activity" xmlElement:element];
}
return self;
}


#pragma mark - Public methods

- (double)speed
{
if (!_speedValue) {
return -1;
}
return [GPXType decimal:_speedValue];
}

- (void)setSpeed:(double)speed
{
_speedValue = [GPXType valueForDecimal:speed];
}

- (double)course
{
if (!_courseValue) {
return -1;
}
return [GPXType decimal:_courseValue];
}

- (void)setCourse:(double)course
{
_courseValue = [GPXType valueForDecimal:course];
}

#pragma mark - tag

Expand All @@ -40,6 +74,9 @@ - (void)addChildTagToGpx:(NSMutableString *)gpx indentationLevel:(NSInteger)inde
{
[super addChildTagToGpx:gpx indentationLevel:indentationLevel];

[self gpx:gpx addPropertyForValue:_speedValue tagName:@"speed" indentationLevel:indentationLevel];
[self gpx:gpx addPropertyForValue:_courseValue tagName:@"course" indentationLevel:indentationLevel];
[self gpx:gpx addPropertyForValue:_activity tagName:@"activity" indentationLevel:indentationLevel];
}

@end
6 changes: 3 additions & 3 deletions GPX/GPXPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
@property (strong, nonatomic) NSDate *time;

/** The latitude of the point. Decimal degrees, WGS84 datum */
@property (nonatomic, assign) CGFloat latitude;
@property (nonatomic, assign) double latitude;

/** The longitude of the point. Decimal degrees, WGS84 datum. */
@property (nonatomic, assign) CGFloat longitude;
@property (nonatomic, assign) double longitude;


/// ---------------------------------
Expand All @@ -40,6 +40,6 @@
@param longitude The longitude of the point.
@return A newly created point element.
*/
+ (GPXPoint *)pointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
+ (GPXPoint *)pointWithLatitude:(double)latitude longitude:(double)longitude;

@end
14 changes: 7 additions & 7 deletions GPX/GPXPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (id)initWithXMLElement:(TBXMLElement *)element parent:(GPXElement *)parent
return self;
}

+ (GPXPoint *)pointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
+ (GPXPoint *)pointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXPoint *point = [GPXPoint new];
point.latitude = latitude;
Expand All @@ -47,12 +47,12 @@ + (GPXPoint *)pointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude

#pragma mark - Public methods

- (CGFloat)elevation
- (double)elevation
{
return [GPXType decimal:_elevationValue];
}

- (void)setElevation:(CGFloat)elevation
- (void)setElevation:(double)elevation
{
_elevationValue = [GPXType valueForDecimal:elevation];
}
Expand All @@ -67,22 +67,22 @@ - (void)setTime:(NSDate *)time
_timeValue = [GPXType valueForDateTime:time];
}

- (CGFloat)latitude
- (double)latitude
{
return [GPXType latitude:_latitudeValue];
}

- (void)setLatitude:(CGFloat)latitude
- (void)setLatitude:(double)latitude
{
_latitudeValue = [GPXType valueForLatitude:latitude];
}

- (CGFloat)longitude
- (double)longitude
{
return [GPXType longitude:_longitudeValue];
}

- (void)setLongitude:(CGFloat)longitude
- (void)setLongitude:(double)longitude
{
_longitudeValue = [GPXType valueForLongitude:longitude];
}
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXPointSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@param longitude The longitude of the point.
@return A newly created point element.
*/
- (GPXPoint *)newPointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
- (GPXPoint *)newPointWithLatitude:(double)latitude longitude:(double)longitude;


/// ---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXPointSegment.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ - (id)initWithXMLElement:(TBXMLElement *)element parent:(GPXElement *)parent

#pragma mark - Public methods

- (GPXPoint *)newPointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
- (GPXPoint *)newPointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXPoint *point = [GPXPoint pointWithLatitude:latitude longitude:longitude];
[self addPoint:point];
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXRoute.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
@param longitude The longitude of the point.
@return A newly created routepoint element.
*/
- (GPXRoutePoint *)newRoutepointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
- (GPXRoutePoint *)newRoutepointWithLatitude:(double)latitude longitude:(double)longitude;


/// ---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXRoute.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ - (void)removeLink:(GPXLink *)link
}
}

- (GPXRoutePoint *)newRoutepointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
- (GPXRoutePoint *)newRoutepointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXRoutePoint *routepoint = [GPXRoutePoint routepointWithLatitude:latitude longitude:longitude];
[self addRoutepoint:routepoint];
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXRoutePoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
@param longitude The longitude of the point.
@return A newly created routepoint element.
*/
+ (GPXRoutePoint *)routepointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
+ (GPXRoutePoint *)routepointWithLatitude:(double)latitude longitude:(double)longitude;

@end
2 changes: 1 addition & 1 deletion GPX/GPXRoutePoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation GPXRoutePoint

#pragma mark - Instance

+ (GPXRoutePoint *)routepointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
+ (GPXRoutePoint *)routepointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXRoutePoint *routepoint = [GPXRoutePoint new];
routepoint.latitude = latitude;
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@
@param longitude The longitude of the point.
@return A newly created trackpoint element.
*/
- (GPXTrackPoint *)newTrackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
- (GPXTrackPoint *)newTrackpointWithLatitude:(double)latitude longitude:(double)longitude;

@end
2 changes: 1 addition & 1 deletion GPX/GPXTrack.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ - (void)removeTracksegment:(GPXTrackSegment *)tracksegment
}
}

- (GPXTrackPoint *)newTrackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
- (GPXTrackPoint *)newTrackpointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXTrackSegment *tracksegment;

Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXTrackPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
@param longitude The longitude of the point.
@return A newly created trackpoint element.
*/
+ (GPXTrackPoint *)trackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
+ (GPXTrackPoint *)trackpointWithLatitude:(double)latitude longitude:(double)longitude;

@end
2 changes: 1 addition & 1 deletion GPX/GPXTrackPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation GPXTrackPoint

#pragma mark - Instance

+ (GPXTrackPoint *)trackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
+ (GPXTrackPoint *)trackpointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXTrackPoint *trackpoint = [GPXTrackPoint new];
trackpoint.latitude = latitude;
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXTrackSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
@param longitude The longitude of the point.
@return A newly created trackpoint element.
*/
- (GPXTrackPoint *)newTrackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude;
- (GPXTrackPoint *)newTrackpointWithLatitude:(double)latitude longitude:(double)longitude;


/// ---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion GPX/GPXTrackSegment.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (id)initWithXMLElement:(TBXMLElement *)element parent:(GPXElement *)parent

#pragma mark - Public methods

- (GPXTrackPoint *)newTrackpointWithLatitude:(CGFloat)latitude longitude:(CGFloat)longitude
- (GPXTrackPoint *)newTrackpointWithLatitude:(double)latitude longitude:(double)longitude
{
GPXTrackPoint *trackpoint = [GPXTrackPoint trackpointWithLatitude:latitude longitude:longitude];
[self addTrackpoint:trackpoint];
Expand Down
Loading