Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / library / tilecodec / src / main / rust / tests / fixtures / README.md

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