1.0.0 • Published 8 years ago
@mapbox/evilmvt v1.0.0
evilmvt
https://travis-ci.org/mapbox/evilmvt.svg?branch=master
A require-able suite of valid & invalid vector tile fixtures for testing Mapbox Vector Tile decoding. Located in fixtures
and require()
able.
Fixture suite
The fixtures below are include in /fixtures
. They are named to be as descriptive as possible, but the table below gives us more space to describe the underlying data.
These are considered "invalid" according to the Mapbox Vector Tile Specification version 2.1.
Fixture name | Description | |
---|---|---|
invalid-Feature-missing-GeomType.mvt | The Feature message is missing a GeomType message. | |
invalid-Feature-multiple-geometries.mvt | The Feature message as multiple geometry fields encoded, when there should only be one. | |
invalid-Feature-no-geometry.mvt | The Feature message has no geometry . | |
invalid-Feature-odd_number_tags.mvt | Only has a single tag where multiples of 2 are required. | |
invalid-Feature-unknown_field_type.mvt | Has a field value of 10 , which is not listed as an enum and therefore invalid. | |
invalid-GeomType-invalid-type.mvt | The tag for GeomType is 10 , which is invalid. | |
invalid-Key-mistyped_uint32.mvt | Has a key property incorrectly encoded as a type std::uint32_t . | n/a |
invalid-Layer-extent-mistyped_string.mvt | Layer extent is incorrectly encoded as a type std::string . | |
invalid-Layer-extent-none.mvt | Missing the extent type | |
invalid-Layer-name-duplicates.mvt | Includes two layer name s with the same value: "layer_name". | |
invalid-Layer-name-mistyped_uint32.mvt | Has a layer name incorrectly encoded as std::uint32_t . | |
invalid-Layer-name-none.mvt | Does not include a layer name. | |
invalid-Layer-name-none-version1.mvt | Same as above, but version 1 tile. | |
invalid-Layer-no-features.mvt | Layer has no repeated Features tags. | |
invalid-Layer-unknow_value_type.mvt | Includes a Layer value tag of 20 , which is not defined in the spec. | |
invalid-Layer-invalid-version.mvt | Layer version is 99 , which is invalid according to the specification. | |
invalid-Layer-version-mistyped_string.mvt | Layer version is incorrectly typed as a std::string . | |
invalid-Layer-version-none.mvt | Layer does not have a version property. | |
invalid-Tags-nonexistant-values.mvt | Feature has tags that point to non-existent Keys and Values in the layer. | |
invalid-Tile-unknown-tag.mvt | Tile message has an unknown tag value. The only accepted tag value here is 3 , but this tile encodes a Feature with the tag value of 10 . | |
invalid-Value-no-fields.mvt | includes a Value without any fields encoded within it. | |
invalid-Value-multiple-fields.mvt | The Value message has two entries, both strings, where there should only be one. | |
invalid-Value-string-mistyped_int64.mvt | A Layer value property is listed as "string" but encoded as std::int64_t . | |
invalid-Value-unknown-field-type.mvt | The Value has a field with an unknown type. | |
valid-GeomType-single-linestring.mvt | Single layer with a valid linestring geometry from the spec docs. | |
valid-GeomType-single-multilinestring.mvt | Single layer with a valid multilinestring geometry from the spec docs. | |
valid-GeomType-single-multipoint.mvt | Single layer with a valid multipoint geometry from the spec docs. | |
valid-GeomType-single-point.mvt | Single layer with a valid point geometry from the spec docs. | |
valid-GeomType-single-polygon.mvt | Single layer with a valid polygon geometry from the spec docs. | |
valid-GeomType-unknown.mvt | Single geometry with UNKNOWN type. This is considered "valid" in the lens of the specification. Encoders/decoders can choose to use or throw on this goemetry type. | |
valid-Values-all.mvt | A buffer with all possible Value types encoded in the layer and single Feature. |
require
fixtures
Install
npm install @mapbox/evilmvt --save
You can require the fixtures directly from the evilmvt
module using the name of the fixture.
var fixtures = require('@mapbox/evilmvt').fixtures;
var buffer = fixtures['invalid-Tags-nonexistant-values'];
// do something with bufer