Skip to content

Instantly share code, notes, and snippets.

- (WarpResultC*)warpImageWithGeoTransformMBTiles:(NSArray<NSNumber*>*)geoTransformArray sourceFile:(NSString*)inFilepath destinationFile:(NSString*)outFilepath
{
char *argv[] = { strdup("gdal_translate"),
strdup("-of"), strdup("MBTILES"),
strdup(inFilepath.UTF8String), strdup(outFilepath.UTF8String),
NULL };
int argc = sizeof(argv) / sizeof(char*) - 1;
GDALDatasetH hDataset, hOutDS;
- (WarpResultC*)warpImageWithGeoTransform:(NSArray<NSNumber*>*)geoTransformArray sourceFile:(NSString*)inFilepath destinationFile:(NSString*)outFilepath
{
GDALAllRegister();
GDALDriverH hDriver;
GDALDataType eDT;
GDALDatasetH hDstDS;
GDALDatasetH hSrcDS;
// Open the source file.
@koloritcm
koloritcm / gist:5677324
Created May 30, 2013 11:51
Make it possible to access willMapDeserializedResponseBlock to modify the deserialized JSON response when you are using RKObjectManager.
@interface RKObjectManager (ModifyJSONRepsonse)
- (void)getObjectsAtPath:(NSString *)path
parameters:(NSDictionary *)parameters
modifyResponseBlock:(id (^)(id deserializedResponseBody))modifyResponseBlock
success:(void (^)(RKObjectRequestOperation *operation, RKMappingResult *mappingResult))success
failure:(void (^)(RKObjectRequestOperation *operation, NSError *error))failure;
- (void)getObjectsAtPathForRelationship:(NSString *)relationshipName
ofObject:(id)object
@koloritcm
koloritcm / gist:5670284
Last active December 17, 2015 20:49
Sharing parent value when mapping a list of objects
// {
// "category": "MyCategory"
// "items": [
// { "id": 1, "name": "A" },
// { "id": 2, "name": "B" },
// { "id": 3, "name": "C" }
// ]
// }
// Current mapping, but missing "category" object that should be mapped to each "Item"