clarify README

This commit is contained in:
Brandon Liu
2021-04-01 09:29:09 +08:00
committed by GitHub
parent 62353d5d2c
commit badb4839a8

View File

@@ -35,15 +35,15 @@ A detailed specification is forthcoming. PMTiles is a binary serialization forma
### Design considerations ### Design considerations
* Directories are recursive, with a maximum of 21,845 entries per directory. * Directories are recursive, with a maximum of 21,845 entries per directory.
* *21845 is the total tiles of a pyramid with 7 levels, or 1+4+16+64+256+1024+4096+16384* * *21845 is the total tiles of a pyramid with 8 levels, or 1+4+16+64+256+1024+4096+16384*
* Deduplication of tile data is handled by multiple entries pointing to the same offset in the archive. * Deduplication of tile data is handled by multiple entries pointing to the same offset in the archive.
* The order of tile data in the archive is unspecified; an optimized implementation should arrange tiles on a 2D space-filling curve. * The order of tile data in the archive is unspecified; an optimized implementation should arrange tiles on a 2D space-filling curve.
### Details ### Details
* The first 512 kilobytes of a PMTiles archive are reserved, and contain the headers as well as a root directory. * The first 512,000 bytes of a PMTiles archive are reserved, and contain the headers as well as a root directory.
* All integer values are little-endian. * All integer values are little-endian.
* The headers begin with a magic number, "PM" * The headers begin with a 2-byte magic number, "PM"
* 2 bytes: which specify the PMTiles specification version, right now always 1. * 2 bytes: the PMTiles specification version, right now always 1.
* 4 bytes: the length of metadata (M bytes) * 4 bytes: the length of metadata (M bytes)
* 2 bytes: the number of entries in the root directory (N) * 2 bytes: the number of entries in the root directory (N)
* M bytes: the metadata, by convention a JSON object. * M bytes: the metadata, by convention a JSON object.
@@ -52,10 +52,10 @@ A detailed specification is forthcoming. PMTiles is a binary serialization forma
### Directory structure ### Directory structure
A directory is a sequence of 17 byte entries. An entry consists of: A directory is a sequence of 17 byte entries. An entry consists of:
* 1 byte: the zoom level (Z) of the entry, with the top bit set to 1 instead of 0 to indicate the data is a child directory, not data. * 1 byte: the zoom level (Z) of the entry, with the top bit set to 1 instead of 0 to indicate the data is a child directory, not tile content.
* 3 bytes: the X (column) of the entry. * 3 bytes: the X (column) of the entry.
* 3 bytes: the Y (row) of the entry. * 3 bytes: the Y (row) of the entry.
* 6 bytes: the offset of where the tile begins in the archive. * 6 bytes: the offset of where the data begins in the archive.
* 4 bytes: the length of the data. * 4 bytes: the length of the data.
## License ## License