Skip to content

Commit

Permalink
DAO column range support
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborn committed Jan 23, 2024
1 parent e8742dd commit 29498fb
Show file tree
Hide file tree
Showing 17 changed files with 830 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Adheres to [Semantic Versioning](http://semver.org/).

## 8.0.5 (TBD)

* DAO column range support (including geometry envelopes & bounding boxes) to build where clauses & args for queries
* ogc-api-features-json-ios version 4.2.5

## [8.0.4](https://github.com/ngageoint/geopackage-ios/releases/tag/8.0.4) (11-15-2023)
Expand Down
8 changes: 8 additions & 0 deletions geopackage-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@
040FC09C21496B3B001EAA8E /* GPKGRTreeIndexTableDao.m in Sources */ = {isa = PBXBuildFile; fileRef = 040FC09A21496B3B001EAA8E /* GPKGRTreeIndexTableDao.m */; };
040FC09F21496B89001EAA8E /* GPKGRTreeIndexTableRow.h in Headers */ = {isa = PBXBuildFile; fileRef = 040FC09D21496B89001EAA8E /* GPKGRTreeIndexTableRow.h */; };
040FC0A021496B89001EAA8E /* GPKGRTreeIndexTableRow.m in Sources */ = {isa = PBXBuildFile; fileRef = 040FC09E21496B89001EAA8E /* GPKGRTreeIndexTableRow.m */; };
04118F062B5E903D003DE120 /* GPKGColumnRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 04118F042B5E903D003DE120 /* GPKGColumnRange.h */; };
04118F072B5E903D003DE120 /* GPKGColumnRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 04118F052B5E903D003DE120 /* GPKGColumnRange.m */; };
0413B1121F6AE20C0075916A /* GPKGFeatureShapes.h in Headers */ = {isa = PBXBuildFile; fileRef = 0413B1101F6AE20C0075916A /* GPKGFeatureShapes.h */; };
0413B1131F6AE20C0075916A /* GPKGFeatureShapes.m in Sources */ = {isa = PBXBuildFile; fileRef = 0413B1111F6AE20C0075916A /* GPKGFeatureShapes.m */; };
0413B1171F6B271F0075916A /* GPKGMapUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 0413B1151F6B271F0075916A /* GPKGMapUtils.h */; };
Expand Down Expand Up @@ -961,6 +963,8 @@
040FC09A21496B3B001EAA8E /* GPKGRTreeIndexTableDao.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPKGRTreeIndexTableDao.m; sourceTree = "<group>"; };
040FC09D21496B89001EAA8E /* GPKGRTreeIndexTableRow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPKGRTreeIndexTableRow.h; sourceTree = "<group>"; };
040FC09E21496B89001EAA8E /* GPKGRTreeIndexTableRow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPKGRTreeIndexTableRow.m; sourceTree = "<group>"; };
04118F042B5E903D003DE120 /* GPKGColumnRange.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPKGColumnRange.h; sourceTree = "<group>"; };
04118F052B5E903D003DE120 /* GPKGColumnRange.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPKGColumnRange.m; sourceTree = "<group>"; };
0413B1101F6AE20C0075916A /* GPKGFeatureShapes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPKGFeatureShapes.h; sourceTree = "<group>"; };
0413B1111F6AE20C0075916A /* GPKGFeatureShapes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPKGFeatureShapes.m; sourceTree = "<group>"; };
0413B1151F6B271F0075916A /* GPKGMapUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPKGMapUtils.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2462,6 +2466,8 @@
children = (
042FC7091B964D8C00549A4B /* GPKGBaseDao.h */,
042FC70A1B964D8C00549A4B /* GPKGBaseDao.m */,
04118F042B5E903D003DE120 /* GPKGColumnRange.h */,
04118F052B5E903D003DE120 /* GPKGColumnRange.m */,
042FC70B1B964D8C00549A4B /* GPKGColumnValue.h */,
042FC70C1B964D8C00549A4B /* GPKGColumnValue.m */,
042FC70D1B964D8C00549A4B /* GPKGColumnValues.h */,
Expand Down Expand Up @@ -3711,6 +3717,7 @@
042FC8291B964D8C00549A4B /* GPKGGeometryColumnsDao.h in Headers */,
042FC8BF1B964D8C00549A4B /* GPKGUserTableReader.h in Headers */,
0409CCD720D9ABF10069B797 /* GPKGUserCustomTableReader.h in Headers */,
04118F062B5E903D003DE120 /* GPKGColumnRange.h in Headers */,
04C637FA1E1C373D00B429FE /* GPKGCoverageDataTiffImage.h in Headers */,
040FC09B21496B3B001EAA8E /* GPKGRTreeIndexTableDao.h in Headers */,
0422BB261DEE2302002709B6 /* GPKGCoverageDataTiff.h in Headers */,
Expand Down Expand Up @@ -4260,6 +4267,7 @@
0407C4B521F14801008ABBF6 /* GPKGStyles.m in Sources */,
049FDF0F222F18F3003399A3 /* GPKGTileUtils.m in Sources */,
042FC8B01B964D8C00549A4B /* GPKGTileRow.m in Sources */,
04118F072B5E903D003DE120 /* GPKGColumnRange.m in Sources */,
0409CCF020D9ADEC0069B797 /* GPKGUserMappingRow.m in Sources */,
042FC81C1B964D8C00549A4B /* GPKGTableMetadataDao.m in Sources */,
04329BA32056ADEB00F3EBBE /* GPKGTileScalingTypes.m in Sources */,
Expand Down
71 changes: 71 additions & 0 deletions geopackage-ios/GPKGBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ struct GPKGBoundingBoxSize{
andMaxLongitudeDouble: (double) maxLongitude
andMaxLatitudeDouble: (double) maxLatitude;

/**
* Initialize with double range
*
* @param minLongitude minimum longitude
* @param minLatitude minimum latitude
* @param maxLongitude maximum longitude
* @param maxLatitude maximum latitude
*
* @return new bounding box
*/
-(instancetype) initWithMinLongitudeValue: (double) minLongitude
andMinLatitudeValue: (double) minLatitude
andMaxLongitudeValue: (double) maxLongitude
andMaxLatitudeValue: (double) maxLatitude;

/**
* Initialize with existing bounding box
*
Expand Down Expand Up @@ -119,6 +134,62 @@ struct GPKGBoundingBoxSize{
*/
-(instancetype) initWithGeometry: (SFGeometry *) geometry;

/**
* Get the min longitude double value
*
* @return min longitude
*/
-(double) minLongitudeValue;

/**
* Set the min longitude double value
*
* @param minLongitude min longitude
*/
-(void) setMinLongitudeValue: (double) minLongitude;

/**
* Get the min latitude double value
*
* @return min latitude
*/
-(double) minLatitudeValue;

/**
* Set the min latitude double value
*
* @param minLatitude min latitude
*/
-(void) setMinLatitudeValue: (double) minLatitude;

/**
* Get the max longitude double value
*
* @return max longitude
*/
-(double) maxLongitudeValue;

/**
* Set the max longitude double value
*
* @param maxLongitude max longitude
*/
-(void) setMaxLongitudeValue: (double) maxLongitude;

/**
* Get the max latitude double value
*
* @return max latitude
*/
-(double) maxLatitudeValue;

/**
* Set the max latitude double value
*
* @param maxLatitude max latitude
*/
-(void) setMaxLatitudeValue: (double) maxLatitude;

/**
* Get the longitude range
*
Expand Down
42 changes: 42 additions & 0 deletions geopackage-ios/GPKGBoundingBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ -(instancetype) initWithMinLongitudeDouble: (double) minLongitude
andMinLatitudeDouble: (double) minLatitude
andMaxLongitudeDouble: (double) maxLongitude
andMaxLatitudeDouble: (double) maxLatitude{
return [self initWithMinLongitudeValue:minLongitude
andMinLatitudeValue:minLatitude
andMaxLongitudeValue:maxLongitude
andMaxLatitudeValue:maxLatitude];
}

-(instancetype) initWithMinLongitudeValue: (double) minLongitude
andMinLatitudeValue: (double) minLatitude
andMaxLongitudeValue: (double) maxLongitude
andMaxLatitudeValue: (double) maxLatitude{
return [self initWithMinLongitude:[[NSDecimalNumber alloc] initWithDouble:minLongitude]
andMinLatitude:[[NSDecimalNumber alloc] initWithDouble:minLatitude]
andMaxLongitude:[[NSDecimalNumber alloc] initWithDouble:maxLongitude]
Expand All @@ -76,6 +86,38 @@ -(instancetype) initWithGeometry: (SFGeometry *) geometry{
return [self initWithEnvelope:[geometry envelope]];
}

-(double) minLongitudeValue{
return [self.minLongitude doubleValue];
}

-(void) setMinLongitudeValue: (double) minLongitude{
self.minLongitude = [[NSDecimalNumber alloc] initWithDouble:minLongitude];
}

-(double) minLatitudeValue{
return [self.minLatitude doubleValue];
}

-(void) setMinLatitudeValue: (double) minLatitude{
self.minLatitude = [[NSDecimalNumber alloc] initWithDouble:minLatitude];
}

-(double) maxLongitudeValue{
return [self.maxLongitude doubleValue];
}

-(void) setMaxLongitudeValue: (double) maxLongitude{
self.maxLongitude = [[NSDecimalNumber alloc] initWithDouble:maxLongitude];
}

-(double) maxLatitudeValue{
return [self.maxLatitude doubleValue];
}

-(void) setMaxLatitudeValue: (double) maxLatitude{
self.maxLatitude = [[NSDecimalNumber alloc] initWithDouble:maxLatitude];
}

-(NSDecimalNumber *) longitudeRange{
return [self.maxLongitude decimalNumberBySubtracting:self.minLongitude];
}
Expand Down
8 changes: 0 additions & 8 deletions geopackage-ios/attributes/GPKGAttributesRow.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ -(instancetype) initWithAttributesTable: (GPKGAttributesTable *) table{
return self;
}

-(NSObject *) toObjectValueWithIndex: (int) index andValue: (NSObject *) value{
return value;
}

-(NSObject *) toDatabaseValueWithIndex: (int) index andValue: (NSObject *) value{
return value;
}

-(id) mutableCopyWithZone: (NSZone *) zone{
GPKGAttributesRow *attributesRow = [super mutableCopyWithZone:zone];
attributesRow.attributesTable = _attributesTable;
Expand Down
Loading

0 comments on commit 29498fb

Please sign in to comment.