Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / tilecodec / src / main / rust / tests / fixtures / README.md
| 1 | # Test fixtures |
| 2 | |
| 3 | ## `v5ca_z11_tile.mvt` |
| 4 | |
| 5 | One real tile lifted out of the published basemap, |
| 6 | `https://data.maproj.org/v5-ca.pmtiles` (PMTiles v3, tippecanoe-produced), |
| 7 | via a ranged GET. Stored **inflated** -- the archive gzips its tiles, but that is |
| 8 | the container's business, so the MVT tests work on the raw protobuf. |
| 9 | |
| 10 | PMTiles ``tile_id`` 2229854, which is **z11/339/770** -- north-eastern California |
| 11 | (NW corner lon -120.4102, lat 40.7140). The zoom/x/y were derived with the crate's |
| 12 | own ``tile_zxy``, which is exhaustively round-trip tested; an earlier hand |
| 13 | calculation put this tile in the Arctic and was wrong. |
| 14 | |
| 15 | Contents, as decoded from the published file at the time it was captured: |
| 16 | |
| 17 | | layer | features | keys | values | extent | version | |
| 18 | |--------|----------|------|--------|--------|---------| |
| 19 | | earth | 1 | 1 | 1 | 4096 | 2 | |
| 20 | | roads | 1 | 9 | 7 | 4096 | 2 | |
| 21 | | water | 2 | 3 | 3 | 4096 | 2 | |
| 22 | |
| 23 | It is deliberately a *small* tile that still carries both polygon (`earth`, |
| 24 | `water`) and line (`roads`) geometry, so it exercises the pass-through path |
| 25 | the tile-join step depends on: our own writer only ever emits points, but the |
| 26 | composite has to carry the base tileset's lines and polygons through untouched. |
| 27 | |
| 28 | Its purpose is to pin the decoder against genuine tippecanoe output. A synthetic |
| 29 | round-trip only proves we agree with ourselves. |
| 30 | |
| 31 | ## ``v5ca_z11_tile.mvt.gz`` |
| 32 | |
| 33 | The same tile, exactly as the archive stores it: gzipped. Proves the gzip reader |
| 34 | handles a real producer's stream and inflates to ``v5ca_z11_tile.mvt`` byte for |
| 35 | byte. |
| 36 | |
| 37 | ## ``v5ca_header_rootdir.bin`` |
| 38 | |
| 39 | Bytes ``0..1479`` of the same archive -- the 127-byte v3 header plus its entire |
| 40 | gzipped root directory (which ends exactly where ``metadata_offset`` begins). |
| 41 | |
| 42 | Enough to test header parsing and directory decoding against real data without |
| 43 | carrying the 1.5 GB file. Note the offsets inside it address that full file, so it |
| 44 | cannot be opened as a standalone archive; the tests parse the header and root |
| 45 | directory specifically. |
| 46 | |
| 47 | Known values: 324 root entries, all leaf pointers, inflating to 2004 bytes. Our |
| 48 | serializer reproduces those 2004 bytes exactly, which is what proves the writer |
| 49 | agrees with tippecanoe on the directory encoding -- including its use of the |
| 50 | contiguous-offset shorthand. |