MEPackage Class Reference

Inherits from NSObject
Declared in MEPackage.h

Overview

Utility class for accessing Altus map packages.

– initWithFileName:

Initialize a package for reading only.

- (id)initWithFileName:(NSString *)fileName

Parameters

fileName

Name of Altus map package sqlite file.

Declared In

MEPackage.h

– initWithFileName:andPackageType:

Intialize a package for reading and writing.

- (id)initWithFileName:(NSString *)fileName andPackageType:(MEPackageType)packageType

Declared In

MEPackage.h

  fileName

Filename of the package.

@property (readonly, retain) NSString *fileName

Declared In

MEPackage.h

  packageType

Package type.

@property (readonly) MEPackageType packageType

Declared In

MEPackage.h

  minX

West-most boundary of map data.

@property (readonly) double minX

Declared In

MEPackage.h

  minY

Southern-most boundary of map data.

@property (readonly) double minY

Declared In

MEPackage.h

  maxX

East-most boundary of map data.

@property (readonly) double maxX

Declared In

MEPackage.h

  maxY

Northern-most boundary of map data.

@property (readonly) double maxY

Declared In

MEPackage.h

  minLevel

The minimimum tile level in the map data.

@property (readonly) unsigned int minLevel

Declared In

MEPackage.h

  maxLevel

The maximum tile level in the map data.

@property (readonly) unsigned int maxLevel

Declared In

MEPackage.h

  isThreadSafe

YES if the package can be read / written by more than one thread.

@property (readonly) BOOL isThreadSafe

Declared In

MEPackage.h

  writtenToPackageFailureCount

The number of times addTile has failed.

@property (readonly) unsigned long writtenToPackageFailureCount

Declared In

MEPackage.h

  writtenToPackageRetryCount

The number of times addTile has had to retry writing to the package because the underlying sqlite file was locked by another thread doing a write operation.

@property (readonly) unsigned long writtenToPackageRetryCount

Declared In

MEPackage.h

  writtenToPackageCount

The number of times addTile has succeeded.

@property (readonly) unsigned long writtenToPackageCount

Declared In

MEPackage.h

  verbose

Yes if you want to see debug messages in the console.

@property (assign) BOOL verbose

Declared In

MEPackage.h

  isReadOnly

Yes if the package is read-only (for example was included in the app bundle).

@property (readonly) BOOL isReadOnly

Declared In

MEPackage.h

  maxPackageWriteRetries

How many times to attempt to write to packages if a write operation fails. Defaults to 5.

@property (assign) unsigned int maxPackageWriteRetries

Declared In

MEPackage.h

  packageWriteRetrySleepInterval

How long to sleep when a package write fails before retrying. Defaults to 2.0

@property (assign) double packageWriteRetrySleepInterval

Declared In

MEPackage.h

– getTileUsingId:

Return a tile from the package.

- (NSData *)getTileUsingId:(uint64_t)tileId

Parameters

tileId

The unique 64-bit tile identifier for the tile.

Declared In

MEPackage.h

– addTile:tileData:

Inserts or updates the binary data for the specified tile in the package. NOTE: Adding a tile opens, writes, and closes a connection to the package’s sqlite database. This work is performed on a background serial queue. If you have multiple instances of MEPackage using the same package file, it is possible for the write operation to fail because another connection may have a writer lock. In that case, the operation is tried again after a sleep interval (packageWriteRetrySleepInterval). This is repeated until the write is successful up to a maximum number of retries (maxPackageWriteRetries).

- (void)addTile:(uint64_t)uid tileData:(NSData *)tileData

Parameters

uid

The unique 64-bit ID for the tile. You can use the uid property of an METile object that you’ve created to specify a tile uid.

tileData

Binary data to be stored for this tile

Declared In

MEPackage.h