Skip to content

Commit

Permalink
geopackage-ios 8.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborn committed Aug 18, 2023
1 parent f6103e5 commit dd5782c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ platform :ios, '12.0'
inhibit_all_warnings!

target 'mapcache-ios' do
pod 'geopackage-ios', '~> 7.4.3'
pod 'geopackage-ios', '~> 8.0.1'
pod 'AFNetworking', '~> 3.2.1'
pod 'Fingertips', '~> 0.5.0'
end
1 change: 1 addition & 0 deletions mapcache-ios/load/GPKGSLoadTilesTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ +(GPKGBoundingBox *) transformBoundingBox: (GPKGBoundingBox *) boundingBox withP
GPKGBoundingBox *bounded = [GPKGTileBoundingBoxUtils boundWgs84BoundingBoxWithWebMercatorLimits:boundingBox];
SFPGeometryTransform *transform = [SFPGeometryTransform transformFromEpsg:PROJ_EPSG_WORLD_GEODETIC_SYSTEM andToProjection:projection];
transformedBox = [bounded transform:transform];
[transform destroy];
}

return transformedBox;
Expand Down
2 changes: 2 additions & 0 deletions mapcache-ios/manager/GPKGSCreateFeatureTilesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ -(void)setGenerateTilesFields{
boundingBox = [GPKGTileBoundingBoxUtils boundDegreesBoundingBoxWithWebMercatorLimits:boundingBox];
}
webMercatorBoundingBox = [boundingBox transform:webMercatorTransform];
[webMercatorTransform destroy];

// Try to find a good zoom starting point
int zoomLevel = [GPKGTileBoundingBoxUtils zoomLevelWithWebMercatorBoundingBox:webMercatorBoundingBox];
Expand Down Expand Up @@ -226,6 +227,7 @@ -(void)setGenerateTilesFields{
if(self.generateTilesData.boundingBox == nil){
SFPGeometryTransform *worldGeodeticTransform = [SFPGeometryTransform transformFromEpsg:PROJ_EPSG_WEB_MERCATOR andToEpsg:PROJ_EPSG_WORLD_GEODETIC_SYSTEM];
GPKGBoundingBox *worldGeodeticBoundingBox = [webMercatorBoundingBox transform:worldGeodeticTransform];
[worldGeodeticTransform destroy];
self.generateTilesData.boundingBox = worldGeodeticBoundingBox;
}
}
Expand Down
1 change: 1 addition & 0 deletions mapcache-ios/map/GPKGSDownloadTilesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

SFPGeometryTransform *webMercatorTransform = [SFPGeometryTransform transformFromEpsg:PROJ_EPSG_WORLD_GEODETIC_SYSTEM andToEpsg:PROJ_EPSG_WEB_MERCATOR];
GPKGBoundingBox * webMercatorBoundingBox = [self.data.loadTiles.generateTiles.boundingBox transform:webMercatorTransform];
[webMercatorTransform destroy];
int zoomLevel = [GPKGTileBoundingBoxUtils zoomLevelWithWebMercatorBoundingBox:webMercatorBoundingBox];
int maxZoomLevel = [[GPKGSProperties getNumberValueOfProperty:GPKGS_PROP_LOAD_TILES_MAX_ZOOM_DEFAULT] intValue];
zoomLevel = MAX(0, MIN(zoomLevel, maxZoomLevel - 2));
Expand Down
10 changes: 10 additions & 0 deletions mapcache-ios/map/GPKGSMapViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,7 @@ -(void) singleTapGesture:(UITapGestureRecognizer *) tapGestureRecognizer{
SFPGeometryTransform *projectionTransform = [SFPGeometryTransform transformFromProjection:clickProjection andToProjection:featureProjection];
GPKGBoundingBox *boundedClickBoundingBox = [clickBoundingBox boundWgs84Coordinates];
GPKGBoundingBox *transformedBoundingBox = [boundedClickBoundingBox transform:projectionTransform];
[projectionTransform destroy];
double filterMaxLongitude = 0;
if([featureProjection isUnit:PROJ_UNIT_DEGREES]){
filterMaxLongitude = PROJ_WGS84_HALF_WORLD_LON_WIDTH;
Expand Down Expand Up @@ -1227,6 +1228,7 @@ -(void) setEditTypeWithPrevious: (enum GPKGSEditType) previousType andNew: (enum
}

self.editFeatureShape = [converter addMapShape:shape asPointsToMapView:self.mapView withPointOptions:[self getEditFeaturePointOptions] andPolylinePointOptions:[self getEditFeatureShapePointOptions] andPolygonPointOptions:[self getEditFeatureShapePointOptions] andPolygonPointHoleOptions:[self getEditFeatureShapeHolePointOptions] andPolylineOptions:[self drawPolylineOptions] andPolygonOptions:[self drawPolygonOptions]];
[converter close];
[self updateEditState:true];
}
@finally {
Expand Down Expand Up @@ -1254,6 +1256,7 @@ -(void) addEditableShapeBack{
if(geometry != nil){
GPKGMapShapeConverter * converter = [[GPKGMapShapeConverter alloc] initWithProjection:featureDao.projection];
GPKGMapShape * shape = [converter toShapeWithGeometry:geometry];
[converter close];
GPKGStyleCache *styleCache = [[GPKGStyleCache alloc] initWithGeoPackage:geoPackage];
[self prepareShapeOptionsWithShape:shape andStyleCache:styleCache andFeature:featureRow andEditable:true andTopLevel:true];
GPKGMapShape * mapShape = [GPKGMapShapeConverter addMapShape:shape toMapView:self.mapView];
Expand Down Expand Up @@ -1400,6 +1403,7 @@ -(void) saveEditFeatures{
break;
}

[converter close];
}
@catch (NSException *e) {
[GPKGSUtils showMessageWithDelegate:self
Expand Down Expand Up @@ -1824,8 +1828,10 @@ -(GPKGBoundingBox *) transformBoundingBoxToWgs84: (GPKGBoundingBox *) boundingBo
}
SFPGeometryTransform *transformToWebMercator = [SFPGeometryTransform transformFromProjection:projection andToEpsg:PROJ_EPSG_WEB_MERCATOR];
GPKGBoundingBox *webMercatorBoundingBox = [boundingBox transform:transformToWebMercator];
[transformToWebMercator destroy];
SFPGeometryTransform *transform = [SFPGeometryTransform transformFromEpsg:PROJ_EPSG_WEB_MERCATOR andToEpsg:PROJ_EPSG_WORLD_GEODETIC_SYSTEM];
boundingBox = [webMercatorBoundingBox transform:transform];
[transform destroy];
return boundingBox;
}

Expand Down Expand Up @@ -2135,6 +2141,7 @@ -(void) displayTiles: (GPKGSTileTable *) tiles{
if(![transform isSameProjection]){
transformedContentsBoundingBox = [transformedContentsBoundingBox transform:transform];
}
[transform destroy];
displayBoundingBox = [displayBoundingBox overlap:transformedContentsBoundingBox];
}

Expand Down Expand Up @@ -2262,6 +2269,7 @@ -(int) displayFeaturesWithId: (int) updateId andGeoPackage: (GPKGGeoPackage *) g
SFPGeometryTransform *projectionTransform = [SFPGeometryTransform transformFromProjection:mapViewProjection andToProjection:featureProjection];
GPKGBoundingBox *boundedMapViewBoundingBox = [mapViewBoundingBox boundWgs84Coordinates];
GPKGBoundingBox *transformedBoundingBox = [boundedMapViewBoundingBox transform:projectionTransform];
[projectionTransform destroy];
if([featureProjection isUnit:PROJ_UNIT_DEGREES]){
filterMaxLongitude = PROJ_WGS84_HALF_WORLD_LON_WIDTH;
}else if([featureProjection isUnit:PROJ_UNIT_METERS]){
Expand Down Expand Up @@ -2293,6 +2301,8 @@ -(int) displayFeaturesWithId: (int) updateId andGeoPackage: (GPKGGeoPackage *) g

}

[converter close];

return count;
}

Expand Down
2 changes: 2 additions & 0 deletions mapcache-ios/ui/GPKGSEditTileOverlayViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,10 @@ -(void) setBoundingBox{
boundingBox = [GPKGTileBoundingBoxUtils boundDegreesBoundingBoxWithWebMercatorLimits:boundingBox];
}
GPKGBoundingBox *webMercatorBoundingBox = [boundingBox transform:webMercatorTransform];
[webMercatorTransform destroy];
SFPGeometryTransform *worldGeodeticTransform = [SFPGeometryTransform transformFromEpsg:PROJ_EPSG_WEB_MERCATOR andToEpsg:PROJ_EPSG_WORLD_GEODETIC_SYSTEM];
worldGeodeticBoundingBox = [webMercatorBoundingBox transform:worldGeodeticTransform];
[worldGeodeticTransform destroy];
}else{
worldGeodeticBoundingBox = [[GPKGBoundingBox alloc] initWithMinLongitudeDouble:-PROJ_WGS84_HALF_WORLD_LON_WIDTH andMinLatitudeDouble:PROJ_WEB_MERCATOR_MIN_LAT_RANGE andMaxLongitudeDouble:PROJ_WGS84_HALF_WORLD_LON_WIDTH andMaxLatitudeDouble:PROJ_WEB_MERCATOR_MAX_LAT_RANGE];
}
Expand Down

0 comments on commit dd5782c

Please sign in to comment.