Coder Social home page Coder Social logo

mbtilestools's Introduction

MBTilesTools

MBTiles map files tools for iOS.

Small library to manipulate .mbtiles map file database. For example use the latests vector tiles from OpenMapTiles. This library supports all kind of tiles sets, jpg, png and pbf.

Link requirements You need to link this library with sqlite3 and MapKit.

Reader

MBTilesReader is the easiest way to access to the database content.

Reader init

Init the reader with your .mbtiles path

NSString *filePath = @"my_file_path";
MBTilesReader *reader = [[MBTilesReader alloc] initWithFilePath:filePath];

Reader open/close

The reader needs to be opened before any use. If the .mbtiles file is not correctely set, this methods will inform you about the problem

if ([reader open]) {
	NSLog(@"Good, use the reader");
}
else
{
	NSLog(@"Error, verify your file path and content");
}

Reader metadata

Access to all your .mbtiles metadata

MBTilesFormat format = [reader format];
if (format == MBTilesFormatPBF) {
	NSLog(@"Good, got vector tiles");
}
else {
	NSLog(@"Error, not vector tiles DB");
}

Reader tiles

Access to the tiles bytes by fetching them with x, y, z

NSData *tile = [reader tileForX:0 Y:0 Z:1];
NSLog(@"got tile 0/0/1, length %@ bytes", @(tile.length));

mbtilestools's People

Contributors

romainquidet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.