From 4fc90db495b9191aa339905f2d109aae00548975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Tue, 7 Nov 2017 15:57:33 +0100 Subject: [PATCH] timeout error vector with lines --- assets/render-timeout-fallback.mvt | Bin 180 -> 1113 bytes scripts/mvt-timeout-error.py | 40 +++++++++++++++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/assets/render-timeout-fallback.mvt b/assets/render-timeout-fallback.mvt index ee74f5ac795a10a915d3dc315be31cdcc1ae359f..9ef336aeecc0d02037512d329f7115dd05e63ef9 100644 GIT binary patch literal 1113 zcmYM!!EO>!6vpu>MLP490!}H8BT^g@5fKp)5fOL*clrWd%%Vw?>ZpnC&cpbg$NAcR zad-du<=ouOx#yI8q}ZT(Z+C>4=a$ZYWjw(*bRDw!=_!`A*mTqCo^ zE7;24i$gM7yo4?Now$70ZHpJMg})Wo$!zf)HupE;2AM6M!Djwi+#<8ZQ`ppBiDNQb zJb_L8rMOLIi^s6BzYurGZ1D&-^5^1&%oYz}Lw_bt$!zfeHt?t7E}1RPV3|J=_sDE< zAJ+GCai7c<_h3DLEY8SmaTnJ0N8$mQEly#nKNJtiY;gih{DF8xW{W$pj-QFgWVW~s zYx}8qLS~C&SnT)3Q!-oJg0;LUo{`z&2CU&H;yIZuuEXknEMAb=V!+^$cu8i9Ls;lX z;uV=KuEA=4PrN3x#Z_3<55*fYTU>!v{6M@Vv+L!?hBy0M{sHlESw~S2luH!cQF%hS Q?sxatz8v&jaPv+41C0vn&j0`b literal 180 zcmb1&;u1+MD#|Yk$;?R&E-XzfO7%&sOf3?U7Gh&yU}R)sl3-Ti=VWMbkYf06-{8Oi zWbsQer{(8MF_&hhNHHfTmMF1uF()M!DKRNjE3t90q~)ZRYcwcSFiM4Si6YD{DatHJ gEru8_3OAfdiIa05(>7+VMrj5d#xg5h;zThQ0Orpu1poj5 diff --git a/scripts/mvt-timeout-error.py b/scripts/mvt-timeout-error.py index a6b764b6..1b2e66ee 100755 --- a/scripts/mvt-timeout-error.py +++ b/scripts/mvt-timeout-error.py @@ -2,30 +2,36 @@ import mapbox_vector_tile +lines_list = [] + +# main diagonal line +lines_list.append({ "geometry":"LINESTRING (0 0, 4096 4096)"}) + +# diagonal lines +for i in range(4096/32, 4096, 4096/32): + start = i + end = 4096 - i + + lines_list.append({ "geometry":"LINESTRING (0 " + str(start) + ", " + str(end) + " 4096)" }) + lines_list.append({ "geometry":"LINESTRING (" + str(start) + " 0, 4096 " + str(end) + ")" }) + +# box lines +lines_list.append({ "geometry":"LINESTRING (0 0, 0 4096)"}) +lines_list.append({ "geometry":"LINESTRING (0 4096, 4096 4096)"}) +lines_list.append({ "geometry":"LINESTRING (4096 4096, 4096 0)"}) +lines_list.append({ "geometry":"LINESTRING (4096 0, 0 0)"}) + + 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" - } - }] + "features": [{ "geometry":"POLYGON ((0 0, 0 4096, 4096 4096, 4096 0, 0 0))" }] }, { "name": "errorTileStripesLayer", - "features": [{ - "geometry":"LINESTRING(159 3877, -1570 3877)", - "properties":{ - "uid":1234, - "foo":"bar", - "cat":"flew" - } - }] + "features": lines_list } ]) -with open('./assets/render-timeout-fallback.mvt', 'w') as f: +with open('./assets/render-timeout-fallback.mvt', 'w+') as f: f.write(tile) \ No newline at end of file