Skip to content

Commit

Permalink
Merge pull request #21 from ngageoint/develop
Browse files Browse the repository at this point in the history
1.1.9 updates
  • Loading branch information
bosborn committed Mar 4, 2016
2 parents 4d71d8e + b4fd061 commit 8f2e0c4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Adheres to [Semantic Versioning](http://semver.org/).

## 1.1.9 (TBD)

* TBD
* GeoPackage validate has GeoPackage extension bug fix
* Additional GeoPackage manager import GeoPackage from path method
* GeoPackage table type check methods

## [1.1.8](https://github.com/ngageoint/geopackage-ios/releases/tag/1.1.8) (02-22-2016)

Expand Down
27 changes: 27 additions & 0 deletions geopackage-ios/GPKGGeoPackage.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,33 @@
*/
-(NSArray *)getTables;

/**
* Check if the table is a feature table
*
* @param table table name
*
* @return true if a feature table
*/
-(BOOL) isFeatureTable: (NSString *) table;

/**
* Check if the table is a tile table
*
* @param table table name
*
* @return true if a tile table
*/
-(BOOL) isTileTable: (NSString *) table;

/**
* Check if the table exists as a feature or tile table
*
* @param table table name
*
* @return true if a feature or tile table
*/
-(BOOL) isFeatureOrTileTable: (NSString *) table;

/**
* Get the feature table count
*
Expand Down
15 changes: 15 additions & 0 deletions geopackage-ios/GPKGGeoPackage.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ -(NSArray *)getTables{
return tables;
}

-(BOOL) isFeatureTable: (NSString *) table{
NSSet * featureTables = [[NSSet alloc] initWithArray:[self getFeatureTables]];
return [featureTables containsObject:table];
}

-(BOOL) isTileTable: (NSString *) table{
NSSet * tileTables = [[NSSet alloc] initWithArray:[self getTileTables]];
return [tileTables containsObject:table];
}

-(BOOL) isFeatureOrTileTable: (NSString *) table{
NSSet * tables = [[NSSet alloc] initWithArray:[self getTables]];
return [tables containsObject:table];
}

-(int)getFeatureTableCount{
int count = 0;
GPKGGeometryColumnsDao *dao = [self getGeometryColumnsDao];
Expand Down
12 changes: 12 additions & 0 deletions geopackage-ios/factory/GPKGGeoPackageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,18 @@
*/
-(BOOL) importGeoPackageFromPath: (NSString *) path withName: (NSString *) name inDirectory: (NSString *) dbDirectory andOverride: (BOOL) override;

/**
* Import a GeoPackage file from a path and name it with existing file overide and move instead of copy option
*
* @param path GeoPackage path
* @param name creation name
* @param override true to override an existing GeoPackage
* @param moveFile true to move GeoPackage instead of copying
*
* @return true if imported
*/
-(BOOL) importGeoPackageFromPath: (NSString *) path withName: (NSString *) name andOverride: (BOOL) override andMove: (BOOL) moveFile;

/**
* Import a GeoPackage file from a path and name it into a directory with existing file overide and move instead of copy option
*
Expand Down
4 changes: 4 additions & 0 deletions geopackage-ios/factory/GPKGGeoPackageManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ -(BOOL) importGeoPackageFromPath: (NSString *) path withName: (NSString *) name
return [self importGeoPackageFromPath:path withName:name inDirectory:dbDirectory andOverride:override andMove:false];
}

-(BOOL) importGeoPackageFromPath: (NSString *) path withName: (NSString *) name andOverride: (BOOL) override andMove: (BOOL) moveFile{
return [self importGeoPackageFromPath:path withName:name inDirectory:nil andOverride:override andMove:moveFile];
}

-(BOOL) importGeoPackageFromPath: (NSString *) path withName: (NSString *) name inDirectory: (NSString *) dbDirectory andOverride: (BOOL) override andMove: (BOOL) moveFile{

// Verify the file has the right extension
Expand Down
4 changes: 2 additions & 2 deletions geopackage-ios/validate/GPKGGeoPackageValidate.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ @implementation GPKGGeoPackageValidate
+(BOOL) hasGeoPackageExtension: (NSString *) file{
NSString * extension = [file pathExtension];
BOOL isGeoPackage = extension != nil
&& ([extension caseInsensitiveCompare:GPKG_GEOPACKAGE_EXTENSION]
|| [extension caseInsensitiveCompare:GPKG_GEOPACKAGE_EXTENDED_EXTENSION]);
&& ([extension caseInsensitiveCompare:GPKG_GEOPACKAGE_EXTENSION] == NSOrderedSame
|| [extension caseInsensitiveCompare:GPKG_GEOPACKAGE_EXTENDED_EXTENSION] == NSOrderedSame);
return isGeoPackage;
}

Expand Down

0 comments on commit 8f2e0c4

Please sign in to comment.