1.0.0 • Published 8 years ago

@mapbox/evilmvt v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 years ago

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 nameDescription
invalid-Feature-missing-GeomType.mvtThe Feature message is missing a GeomType message.
invalid-Feature-multiple-geometries.mvtThe Feature message as multiple geometry fields encoded, when there should only be one.
invalid-Feature-no-geometry.mvtThe Feature message has no geometry.
invalid-Feature-odd_number_tags.mvtOnly has a single tag where multiples of 2 are required.
invalid-Feature-unknown_field_type.mvtHas a field value of 10, which is not listed as an enum and therefore invalid.
invalid-GeomType-invalid-type.mvtThe tag for GeomType is 10, which is invalid.
invalid-Key-mistyped_uint32.mvtHas a key property incorrectly encoded as a type std::uint32_t.n/a
invalid-Layer-extent-mistyped_string.mvtLayer extent is incorrectly encoded as a type std::string.
invalid-Layer-extent-none.mvtMissing the extent type
invalid-Layer-name-duplicates.mvtIncludes two layer names with the same value: "layer_name".
invalid-Layer-name-mistyped_uint32.mvtHas a layer name incorrectly encoded as std::uint32_t.
invalid-Layer-name-none.mvtDoes not include a layer name.
invalid-Layer-name-none-version1.mvtSame as above, but version 1 tile.
invalid-Layer-no-features.mvtLayer has no repeated Features tags.
invalid-Layer-unknow_value_type.mvtIncludes a Layer value tag of 20, which is not defined in the spec.
invalid-Layer-invalid-version.mvtLayer version is 99, which is invalid according to the specification.
invalid-Layer-version-mistyped_string.mvtLayer version is incorrectly typed as a std::string.
invalid-Layer-version-none.mvtLayer does not have a version property.
invalid-Tags-nonexistant-values.mvtFeature has tags that point to non-existent Keys and Values in the layer.
invalid-Tile-unknown-tag.mvtTile 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.mvtincludes a Value without any fields encoded within it.
invalid-Value-multiple-fields.mvtThe Value message has two entries, both strings, where there should only be one.
invalid-Value-string-mistyped_int64.mvtA Layer value property is listed as "string" but encoded as std::int64_t.
invalid-Value-unknown-field-type.mvtThe Value has a field with an unknown type.
valid-GeomType-single-linestring.mvtSingle layer with a valid linestring geometry from the spec docs.
valid-GeomType-single-multilinestring.mvtSingle layer with a valid multilinestring geometry from the spec docs.
valid-GeomType-single-multipoint.mvtSingle layer with a valid multipoint geometry from the spec docs.
valid-GeomType-single-point.mvtSingle layer with a valid point geometry from the spec docs.
valid-GeomType-single-polygon.mvtSingle layer with a valid polygon geometry from the spec docs.
valid-GeomType-unknown.mvtSingle 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.mvtA 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