From ac153232d0a6a79dddc33b11c7129282d7e05779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Fri, 3 Nov 2017 17:21:01 +0100 Subject: [PATCH] mvt timeout error creation script --- assets/render-timeout-fallback.mvt | 1 + scripts/mvt-timeout-error.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 assets/render-timeout-fallback.mvt create mode 100755 scripts/mvt-timeout-error.py diff --git a/assets/render-timeout-fallback.mvt b/assets/render-timeout-fallback.mvt new file mode 100644 index 00000000..1ebfd46d --- /dev/null +++ b/assets/render-timeout-fallback.mvt @@ -0,0 +1 @@ +'\x1aZ\n\x14errorTileSquareLayer\x12\x1b\x12\x06\x00\x00\x01\x01\x02\x02\x18\x03"\x0f\t\x00\x80@\x1a\x00\xff?\x80@\x00\x00\x80@\x0f\x1a\x03foo\x1a\x03uid\x1a\x03cat"\x05\n\x03bar"\x02 {"\x06\n\x04flew(\x80 x\x01\x1aD\n\x03air\x12\x15\x12\x06\x00\x00\x01\x01\x02\x02\x18\x02"\t\t\xbe\x02\xb6\x03\n\x81\x1b\x00\x1a\x03foo\x1a\x03uid\x1a\x03cat"\x05\n\x03bar"\x03 \xd2\t"\x06\n\x04flew(\x80 x\x01' \ No newline at end of file diff --git a/scripts/mvt-timeout-error.py b/scripts/mvt-timeout-error.py new file mode 100755 index 00000000..d8028997 --- /dev/null +++ b/scripts/mvt-timeout-error.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import mapbox_vector_tile + +tile = mapbox_vector_tile.encode([ + { + "name": "errorTileSquareLayer", + "features": [{ + "geometry":"POLYGON ((0 0, 0 4096, 4096 4096, 4096 0, 0 0))", + "properties":{ + "uid":123, + "foo":"bar", + "cat":"flew" + } + }] + }, + { + "name": "air", + "features": [{ + "geometry":"LINESTRING(159 3877, -1570 3877)", + "properties":{ + "uid":1234, + "foo":"bar", + "cat":"flew" + } + }] + } +]) + +with open('./assets/render-timeout-fallback.mvt', 'w+') as f: + f.write(repr(tile)) \ No newline at end of file