トップ «前の日記(2012-04-25) 最新 次の日記(2012-04-27)» 編集

Cocoa練習帳

iOS/iPhone/iPad/watchOS/tvOS/MacOSX/Android プログラミング, Objective-C, Cocoa, Swiftなど

2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|

2012-04-26 [iOS]GPSとGPX(その1)

GPSの情報を扱う形式に、GPX(GPS eXchange Format)というものがある。これを扱う為のフレームワークがMITライセンスで後悔されていたので、使ってみた。

iOS GPX Framework
http://gpxframework.com/

GitHubでの説明は、これをフレームワーク化して組み込み手順となっていたが、あまり、Xcodeに知らないものを組み込みたくないので、ソース一式をプロジェクトに追加した。

folder

ヘッダーファイルの検索パスに、このフレームワークのソースを追加する。

project

これで以下のようなサンプル・コードのビルドが通るようになったと思う。

#import <GPX/GPX.h>
...
GPXRoot *root = [GPXRoot rootWithCreator:@"Sample Application"];
    
GPXWaypoint *waypoint = [root newWaypointWithLatitude:35.658609f longitude:139.745447f];
waypoint.name = @"Tokyo Tower";
waypoint.comment = @"The old TV tower in Tokyo.";
    
GPXTrack *track = [root newTrack];
track.name = @"My New Track";
    
[track newTrackpointWithLatitude:35.658609f longitude:139.745447f];
[track newTrackpointWithLatitude:35.758609f longitude:139.745447f];
[track newTrackpointWithLatitude:35.828609f longitude:139.745447f];

_ ソースコード

GitHubからどうぞ。
https://github.com/murakami/workbook/tree/master/ios/WayPoints - GitHub

_ 関連情報

iOS GPX Framework
GitHub
This is a iOS framework for parsing/generating GPX files. This Framework parses the GPX from a URL or Strings and create Objective-C Instances of GPX structure.

トップ «前の日記(2012-04-25) 最新 次の日記(2012-04-27)» 編集