Skip to content

Commit

Permalink
Updates to working podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchiles committed Sep 21, 2015
1 parent 268cda5 commit 55695ed
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 75 deletions.
12 changes: 6 additions & 6 deletions OSMKit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Pod::Spec.new do |spec|
spec.homepage = 'https://github.com/davidchiles/OSMKit'
spec.authors = { 'David Chiles' => '[email protected]' }
spec.summary = 'OpenStreetMap library for iOS and OS X'
spec.source = { :git => 'https://github.com/davidchiles/OSMKit', :tag => 'v0.1' }
spec.source = { :git => 'https://github.com/davidchiles/OSMKit', :tag => 'v0.2' }
spec.requires_arc = true

spec.platform = :ios, "7.0"
# spec.dependency "SpatialDBKit"
spec.dependency "AFNetworking"
spec.dependency "TBXML"
spec.dependency "gtm-oauth"
spec.dependency "KissXML"
spec.dependency 'AFNetworking', '~> 2.6'
spec.dependency 'TBXML', '~> 1.5'
spec.dependency 'gtm-oauth', '~> 0.0'
spec.dependency 'KissXML', '~> 5.0'

spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' }


spec.source_files = 'OSMKit/*.{h,m}','OSMKit/**/*.{h,m}','OSMKit/**/**/*.{h,m}'
spec.public_header_files = 'OSMKit/*.{h}', "OSMKit/**/*.{h}", "OSMKit/**/**/*.{h}"

end
end
61 changes: 30 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,47 @@ OSMKit is helpful library for parsing and storing [OpenStreetMap](https://openst
###Install
Add it to your Podfile.

```ruby
pod
```ruby
pod OSMKit
```

Then run `pod install`.
For Now you'll also have to add:
```ruby
pod "SpatialDBKit", :git => 'https://github.com/davidchiles/SpatialDBKit' , :branch => 'master'

### Usage
pre_install do |installer_representation|
path = Pathname(installer_representation.sandbox.pod_dir("spatialite"))+"src/spatialite/spatialite.c"

text = File.read(path)
new_text = text.gsub(/#include <spatialite\/spatialite\.h>/, "#include <spatialite/spatialite/spatialite.h>")

####Parsing
```objective-c
OSMKTBXMLParser *xmlParser = [[OSMKTBXMLParser alloc] initWithDelegate:parserDelegate delegateQueue:nil];
[xmlParser parseXMLData:osmXMLData];
File.open(path, "w") {|file| file.puts new_text }

end
```

Then just implement the parser delegate protocol: `OSMKParserDelegateProtocol`
Then run `pod install`.

### Usage


####Parsing
```objective-c
- (void)parserDidStart:(OSMKParser *)parser;
- (void)parser:(OSMKParser *)parser didFindNode:(OSMKNode *)node;
- (void)parser:(OSMKParser *)parser didFindWay:(OSMKWay *)way;
- (void)parser:(OSMKParser *)parser didFindRelation:(OSMKRelation *)relation;
- (void)parser:(OSMKParser *)parser didFindNote:(OSMKNote *)note;
- (void)parser:(OSMKParser *)parser didFindUser:(OSMKUser *)user;
- (void)parserDidFinish:(OSMKParser *)parser;
- (void)parser:(OSMKParser *)parser parseErrorOccurred:(NSError *)parseError;
OSMKTBXMLParser *parser = [[OSMKTBXMLParser alloc] initWithData:data error:&error];
NSArray *nodes = [parser parseNodes];
NSArray *ways = [parser parseWays];
NSArray *relations = [parser parseRelations];
NSArray *users = [parser parseUsers];
NSArray *notes = [parser parseNotes];
```
####Parsing + Storage
```objective-c
OSMKSpatiaLiteStorage * spatiaLiteStorage = [[OSMKSpatiaLiteStorage alloc] initWithdatabaseFilePath:databasePath delegate:storageDelegate delegateQueue:nil];
[spatiaLiteStorage importXMLData:osmXMLData];
OSMKImporter *importer = [[OSMKImporter alloc] init];
[importer setupDatbaseWithPath:path overwrite:YES];
[importer importXMLData:testObject.data
completion:^{
NSLog(@"all done");
}
completionQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)];
```
Then just implement the storage delegate protocol: `OSMKStorageDelegateProtocol`
```objective-c
- (void)storageDidStartImporting:(OSMKStorage *)storage;
- (void)storage:(OSMKStorage *)storage didSaveNodes:(NSArray *)nodes;
- (void)storage:(OSMKStorage *)storage didSaveWays:(NSArray *)ways;
- (void)storage:(OSMKStorage *)storage didSaveRelations:(NSArray *)relations;
- (void)storage:(OSMKStorage *)storage didSaveUsers:(NSArray *)users;
- (void)storage:(OSMKStorage *)storage didSaveNotes:(NSArray *)notes;
- (void)storageDidFinishImporting:(OSMKStorage *)storage;
```
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,38 @@
endingLineNumber = "177"
landmarkName = "-osmk_saveWay:error:"
landmarkType = "5">
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "__51-[FMDatabase(OSMKitSpatiaLite) osmk_saveWay:error:]_block_invoke149"
moduleName = "OSMKit"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/david/Documents/OSMKit/OSMKit/Storage/FMDatabase+OSMKitSpatiaLite.m"
timestampString = "464498587.768341"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "177"
endingLineNumber = "177"
offsetFromSymbolStart = "390">
</Location>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "__51-[FMDatabase(OSMKitSpatiaLite) osmk_saveWay:error:]_block_invoke149"
moduleName = "OSMKitTests"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/david/Documents/OSMKit/OSMKit/Storage/FMDatabase+OSMKitSpatiaLite.m"
timestampString = "464498588.68513"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "177"
endingLineNumber = "177"
offsetFromSymbolStart = "390">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
Expand Down
3 changes: 1 addition & 2 deletions Tests/OSMKitTests/OSMKImporterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ - (void)testImport {
[expectation fulfill];
}
completionQueue:self.completionQueue];
count++
;
count++;
}];


Expand Down
72 changes: 36 additions & 36 deletions Tests/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
PODS:
- AFNetworking (2.5.0):
- AFNetworking/NSURLConnection (= 2.5.0)
- AFNetworking/NSURLSession (= 2.5.0)
- AFNetworking/Reachability (= 2.5.0)
- AFNetworking/Security (= 2.5.0)
- AFNetworking/Serialization (= 2.5.0)
- AFNetworking/UIKit (= 2.5.0)
- AFNetworking/NSURLConnection (2.5.0):
- AFNetworking (2.6.0):
- AFNetworking/NSURLConnection (= 2.6.0)
- AFNetworking/NSURLSession (= 2.6.0)
- AFNetworking/Reachability (= 2.6.0)
- AFNetworking/Security (= 2.6.0)
- AFNetworking/Serialization (= 2.6.0)
- AFNetworking/UIKit (= 2.6.0)
- AFNetworking/NSURLConnection (2.6.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/NSURLSession (2.5.0):
- AFNetworking/NSURLSession (2.6.0):
- AFNetworking/Reachability
- AFNetworking/Security
- AFNetworking/Serialization
- AFNetworking/Reachability (2.5.0)
- AFNetworking/Security (2.5.0)
- AFNetworking/Serialization (2.5.0)
- AFNetworking/UIKit (2.5.0):
- AFNetworking/Reachability (2.6.0)
- AFNetworking/Security (2.6.0)
- AFNetworking/Serialization (2.6.0)
- AFNetworking/UIKit (2.6.0):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- FMDB/common (2.4)
- FMDB/common (2.5)
- geos (3.4.2)
- gtm-oauth (0.0.1):
- gtm-oauth/nibs (= 0.0.1)
- gtm-oauth/nibs (0.0.1)
- KissXML (5.0)
- OSMKit (0.1):
- AFNetworking
- gtm-oauth
- KissXML
- TBXML
- AFNetworking (~> 2.6)
- gtm-oauth (~> 0.0)
- KissXML (~> 5.0)
- TBXML (~> 1.5)
- proj4 (4.8.0)
- ShapeKit (0.9.6):
- geos
Expand All @@ -52,9 +52,9 @@ PODS:
- spatialite/standard (4.1.1):
- spatialite/geos
- spatialite/proj4
- sqlite3 (3.8.7.4):
- sqlite3/common (= 3.8.7.4)
- sqlite3/common (3.8.7.4)
- sqlite3 (3.8.11.1):
- sqlite3/common (= 3.8.11.1)
- sqlite3/common (3.8.11.1)
- TBXML (1.5)

DEPENDENCIES:
Expand All @@ -63,28 +63,28 @@ DEPENDENCIES:

EXTERNAL SOURCES:
OSMKit:
:path: ../
:path: "../"
SpatialDBKit:
:branch: master
:git: https://github.com/davidchiles/SpatialDBKit

CHECKOUT OPTIONS:
SpatialDBKit:
:commit: 87bdecc2666efe5a572fdf78c3378257899c18a4
:commit: 171648b2d877bcdca9efb6b23e841f9d23586bdd
:git: https://github.com/davidchiles/SpatialDBKit

SPEC CHECKSUMS:
AFNetworking: 0f54cb5d16ce38c1b76948faffb8d5fb705021c7
FMDB: 0b2fa25e5264ef177973c0cb8c02c711107979aa
geos: 20db9ad19fae60249357572b5a2e46882005451f
gtm-oauth: 3c779195cf6c9ef3d79b791b742da6679d0e0b89
KissXML: e537c38b18ede903ee6de45953a9bd86c131ebe9
OSMKit: 43e1cfa6226629e951701f9e219db7ff5c2899b9
proj4: 9eaa37997f1b4f6037f6dedabd1657f27a4d41ed
ShapeKit: 02665237746d95b4df7eda049608980602ec5372
SpatialDBKit: 110895d14ad388efb24786d90360a587ede1c9e2
spatialite: 701bc40513aed25ee4c85801d91f8c13222689aa
sqlite3: 1c279dfc3ce9351fd86002f7bf455cab92330aa4
TBXML: a279440030ba55c40e1455cafba3b0a44e1963d4
AFNetworking: 79f7eb1a0fcfa7beb409332b2ca49afe9ce53b05
FMDB: 96e8f1bcc1329e269330f99770ad4285d9003e52
geos: 836ecf4b0d1baf6c3dda536126aaee6fdde0ebee
gtm-oauth: 34a7210eb8e2dd00a977f42af7d99f994c1e7917
KissXML: ce643413d618ad69886d0d43c3792b7dedfe476e
OSMKit: 648abdc3bcb84ce39e369fe7bc44a3be85dd693c
proj4: 234525105d05a33b2ae9a90a6fe3935f7a246f7e
ShapeKit: 81669c6073b6bacc013a43312039ba013b2c47e5
SpatialDBKit: 6234cd21307470dc6fd5e1cb77bff714e63f09f7
spatialite: d85f4ee401c5af29528556d43a01a6210f5d682a
sqlite3: 73d6ec33f24f74ceb91df8f1b6e1809251f0f580
TBXML: 9f9dadb239f2f2af1dadb87fe43a0ce6e479379a

COCOAPODS: 0.35.0
COCOAPODS: 0.38.2

0 comments on commit 55695ed

Please sign in to comment.