ByteTilesReaderWriter 1.0.0

Parse a .mbtiles file to .bytetiles file, read tiles and extract files to folder.

Install-Package ByteTilesReaderWriter -Version 1.0.0
dotnet add package ByteTilesReaderWriter --version 1.0.0
<PackageReference Include="ByteTilesReaderWriter" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ByteTilesReaderWriter --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ByteTilesReaderWriter, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install ByteTilesReaderWriter as a Cake Addin
#addin nuget:?package=ByteTilesReaderWriter&version=1.0.0

// Install ByteTilesReaderWriter as a Cake Tool
#tool nuget:?package=ByteTilesReaderWriter&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ByteTiles

File format for storing TileSets and designed to be accessed by byte range.

A MBTiles file contains a SQLite database and needs to be loaded in memory before requesting data. Instead a ByteTiles file constains a list of tiles and a dictionary (tile key - byte range) that indicates the position in the file for any tile. The dictionary is thinked to be loaded in a fast memory access (cache or database) for a fast tile reading.

Bennefits

  • Cost: A ByteTiles file can be uploaded in Amazon S3 and then fetch tiles by it range of bytes.
  • Storage size: A ByteTiles files is 5-10% smaller than MBTiles file.
  • Updates: Instead of extracting the files contained in MBTiles and upload them all to S3, ByteTiles contains all in a single file.

Built With

  • C#
  • JavasScript

Specification

ByteTiles specification is provided in the ByteTilesSpec folder.

Examples

Some examples are contained in the SimpleByteTilesServer and ByteTilesReaderWriter_Test projects.

Installation

  1. Clone the repo
    git clone https://github.com/techjb/Vector-Tiles-Google-Maps.git
    
  2. Install NPM packages
    npm install
    

Additionally the nuget package with the ByteTilesReaderWriter library can be installed.

Content

The package contains the following directories:

  • ByteTilesReaderWriter: Library to parse a .mbtiles file to .bytetiles file, read tiles and extract files to folder.
  • ByteTilesReaderWriter_Test: Test for the ByteTilesReaderWriter library.
  • SimpleByteTilesServer: Simple ByteTiles server with examples.
  • ByteTilesLogo: ByteTiles logo files.
  • ByteTilesSpec: ByteTiles specifications.

Library usage

The library ByteTilesReaderWriter can be used as following.

  • Parse .mbtiles to .bytetiles:
ByteTilesWriter.ParseMBTiles("input_file.mbtiles", "output_file.bytetiles");
  • Read tiles:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
byte[] tile = byteTilesReader.GetTile(x, y, z);
  • Read tiles dictionary:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var tilesDictionary = byteTilesReader.GetTilesDictionary();
  • Read json metadata:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var metadata = byteTilesReader.GetMetadata();
  • Extract .bytetiles files to directory.
var byteTilesExtractor = new ByteTilesExtractor("input_file.bytetiles");
byteTilesExtractor.ExtractFiles("output_directory");

Server usage

Set the SimpleByteTilesServer as startup project and run. The server will read tiles from the files of the ByteTilesReaderWriter_Test project.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

See license for more information.

Contact

Jesús Barrio - @techjb

Project Link: https://github.com/techjb/ByteTiles

ByteTiles

File format for storing TileSets and designed to be accessed by byte range.

A MBTiles file contains a SQLite database and needs to be loaded in memory before requesting data. Instead a ByteTiles file constains a list of tiles and a dictionary (tile key - byte range) that indicates the position in the file for any tile. The dictionary is thinked to be loaded in a fast memory access (cache or database) for a fast tile reading.

Bennefits

  • Cost: A ByteTiles file can be uploaded in Amazon S3 and then fetch tiles by it range of bytes.
  • Storage size: A ByteTiles files is 5-10% smaller than MBTiles file.
  • Updates: Instead of extracting the files contained in MBTiles and upload them all to S3, ByteTiles contains all in a single file.

Built With

  • C#
  • JavasScript

Specification

ByteTiles specification is provided in the ByteTilesSpec folder.

Examples

Some examples are contained in the SimpleByteTilesServer and ByteTilesReaderWriter_Test projects.

Installation

  1. Clone the repo
    git clone https://github.com/techjb/Vector-Tiles-Google-Maps.git
    
  2. Install NPM packages
    npm install
    

Additionally the nuget package with the ByteTilesReaderWriter library can be installed.

Content

The package contains the following directories:

  • ByteTilesReaderWriter: Library to parse a .mbtiles file to .bytetiles file, read tiles and extract files to folder.
  • ByteTilesReaderWriter_Test: Test for the ByteTilesReaderWriter library.
  • SimpleByteTilesServer: Simple ByteTiles server with examples.
  • ByteTilesLogo: ByteTiles logo files.
  • ByteTilesSpec: ByteTiles specifications.

Library usage

The library ByteTilesReaderWriter can be used as following.

  • Parse .mbtiles to .bytetiles:
ByteTilesWriter.ParseMBTiles("input_file.mbtiles", "output_file.bytetiles");
  • Read tiles:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
byte[] tile = byteTilesReader.GetTile(x, y, z);
  • Read tiles dictionary:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var tilesDictionary = byteTilesReader.GetTilesDictionary();
  • Read json metadata:
var byteTilesReader = new ByteTilesReader("input_file.bytetiles");
var metadata = byteTilesReader.GetMetadata();
  • Extract .bytetiles files to directory.
var byteTilesExtractor = new ByteTilesExtractor("input_file.bytetiles");
byteTilesExtractor.ExtractFiles("output_directory");

Server usage

Set the SimpleByteTilesServer as startup project and run. The server will read tiles from the files of the ByteTilesReaderWriter_Test project.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

See license for more information.

Contact

Jesús Barrio - @techjb

Project Link: https://github.com/techjb/ByteTiles

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 72 5/12/2021