From 14d969e8103421c37921c98c09a3b49d64136574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Fri, 13 May 2011 15:51:52 -0400 Subject: [PATCH] add grid tests and return error with invalid grid --- lib/mbtiles.js | 4 +- test/fixtures/grids/plain_2_0_7_4.json | 1 + test/fixtures/grids/plain_2_10_12_4.json | 1 + test/fixtures/grids/plain_2_10_14_4.json | 1 + test/fixtures/grids/plain_2_10_9_4.json | 1 + test/fixtures/grids/plain_2_11_4_4.json | 1 + test/fixtures/grids/plain_2_11_6_4.json | 1 + test/fixtures/grids/plain_2_11_7_4.json | 1 + test/fixtures/grids/plain_2_12_5_4.json | 1 + test/fixtures/grids/plain_2_13_10_4.json | 1 + test/fixtures/grids/plain_2_13_11_4.json | 1 + test/fixtures/grids/plain_2_14_10_4.json | 1 + test/fixtures/grids/plain_2_14_5_4.json | 1 + test/fixtures/grids/plain_2_15_12_4.json | 1 + test/fixtures/grids/plain_2_15_14_4.json | 1 + test/fixtures/grids/plain_2_1_14_4.json | 1 + test/fixtures/grids/plain_2_1_3_2.json | 1 + test/fixtures/grids/plain_2_1_9_4.json | 1 + test/fixtures/grids/plain_2_2_12_4.json | 1 + test/fixtures/grids/plain_2_2_13_4.json | 1 + test/fixtures/grids/plain_2_2_14_4.json | 1 + test/fixtures/grids/plain_2_2_4_3.json | 1 + test/fixtures/grids/plain_2_2_4_4.json | 1 + test/fixtures/grids/plain_2_3_13_4.json | 1 + test/fixtures/grids/plain_2_3_1_2.json | 1 + test/fixtures/grids/plain_2_3_4_4.json | 1 + test/fixtures/grids/plain_2_3_5_3.json | 1 + test/fixtures/grids/plain_2_4_14_4.json | 1 + test/fixtures/grids/plain_2_4_2_3.json | 1 + test/fixtures/grids/plain_2_4_3_3.json | 1 + test/fixtures/grids/plain_2_4_7_3.json | 1 + test/fixtures/grids/plain_2_4_9_4.json | 1 + test/fixtures/grids/plain_2_5_12_4.json | 1 + test/fixtures/grids/plain_2_5_14_4.json | 1 + test/fixtures/grids/plain_2_5_4_3.json | 1 + test/fixtures/grids/plain_2_5_4_4.json | 1 + test/fixtures/grids/plain_2_5_5_4.json | 1 + test/fixtures/grids/plain_2_5_6_3.json | 1 + test/fixtures/grids/plain_2_6_3_3.json | 1 + test/fixtures/grids/plain_2_6_4_3.json | 1 + test/fixtures/grids/plain_2_6_5_4.json | 1 + test/fixtures/grids/plain_2_6_6_3.json | 1 + test/fixtures/grids/plain_2_6_8_4.json | 1 + test/fixtures/grids/plain_2_7_13_4.json | 1 + test/fixtures/grids/plain_2_7_3_3.json | 1 + test/fixtures/grids/plain_2_7_7_4.json | 1 + test/fixtures/grids/plain_2_7_9_4.json | 1 + test/fixtures/grids/plain_2_8_4_4.json | 1 + test/fixtures/grids/plain_2_8_5_4.json | 1 + test/fixtures/grids/plain_2_8_9_4.json | 1 + test/fixtures/grids/plain_2_9_11_4.json | 1 + test/read.test.js | 49 +++++++++++++++++------- 52 files changed, 88 insertions(+), 15 deletions(-) create mode 100644 test/fixtures/grids/plain_2_0_7_4.json create mode 100644 test/fixtures/grids/plain_2_10_12_4.json create mode 100644 test/fixtures/grids/plain_2_10_14_4.json create mode 100644 test/fixtures/grids/plain_2_10_9_4.json create mode 100644 test/fixtures/grids/plain_2_11_4_4.json create mode 100644 test/fixtures/grids/plain_2_11_6_4.json create mode 100644 test/fixtures/grids/plain_2_11_7_4.json create mode 100644 test/fixtures/grids/plain_2_12_5_4.json create mode 100644 test/fixtures/grids/plain_2_13_10_4.json create mode 100644 test/fixtures/grids/plain_2_13_11_4.json create mode 100644 test/fixtures/grids/plain_2_14_10_4.json create mode 100644 test/fixtures/grids/plain_2_14_5_4.json create mode 100644 test/fixtures/grids/plain_2_15_12_4.json create mode 100644 test/fixtures/grids/plain_2_15_14_4.json create mode 100644 test/fixtures/grids/plain_2_1_14_4.json create mode 100644 test/fixtures/grids/plain_2_1_3_2.json create mode 100644 test/fixtures/grids/plain_2_1_9_4.json create mode 100644 test/fixtures/grids/plain_2_2_12_4.json create mode 100644 test/fixtures/grids/plain_2_2_13_4.json create mode 100644 test/fixtures/grids/plain_2_2_14_4.json create mode 100644 test/fixtures/grids/plain_2_2_4_3.json create mode 100644 test/fixtures/grids/plain_2_2_4_4.json create mode 100644 test/fixtures/grids/plain_2_3_13_4.json create mode 100644 test/fixtures/grids/plain_2_3_1_2.json create mode 100644 test/fixtures/grids/plain_2_3_4_4.json create mode 100644 test/fixtures/grids/plain_2_3_5_3.json create mode 100644 test/fixtures/grids/plain_2_4_14_4.json create mode 100644 test/fixtures/grids/plain_2_4_2_3.json create mode 100644 test/fixtures/grids/plain_2_4_3_3.json create mode 100644 test/fixtures/grids/plain_2_4_7_3.json create mode 100644 test/fixtures/grids/plain_2_4_9_4.json create mode 100644 test/fixtures/grids/plain_2_5_12_4.json create mode 100644 test/fixtures/grids/plain_2_5_14_4.json create mode 100644 test/fixtures/grids/plain_2_5_4_3.json create mode 100644 test/fixtures/grids/plain_2_5_4_4.json create mode 100644 test/fixtures/grids/plain_2_5_5_4.json create mode 100644 test/fixtures/grids/plain_2_5_6_3.json create mode 100644 test/fixtures/grids/plain_2_6_3_3.json create mode 100644 test/fixtures/grids/plain_2_6_4_3.json create mode 100644 test/fixtures/grids/plain_2_6_5_4.json create mode 100644 test/fixtures/grids/plain_2_6_6_3.json create mode 100644 test/fixtures/grids/plain_2_6_8_4.json create mode 100644 test/fixtures/grids/plain_2_7_13_4.json create mode 100644 test/fixtures/grids/plain_2_7_3_3.json create mode 100644 test/fixtures/grids/plain_2_7_7_4.json create mode 100644 test/fixtures/grids/plain_2_7_9_4.json create mode 100644 test/fixtures/grids/plain_2_8_4_4.json create mode 100644 test/fixtures/grids/plain_2_8_5_4.json create mode 100644 test/fixtures/grids/plain_2_8_9_4.json create mode 100644 test/fixtures/grids/plain_2_9_11_4.json diff --git a/lib/mbtiles.js b/lib/mbtiles.js index 61eb640..51f87bb 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -243,8 +243,8 @@ MBTiles.prototype.grid = function(x, y, z, callback) { return memo; }, {}); callback(null, _(JSON.parse(grid)).extend({ data: data })); - } catch(err) { - callback(err); + } catch (err) { + callback('Grid is invalid'); } } ); diff --git a/test/fixtures/grids/plain_2_0_7_4.json b/test/fixtures/grids/plain_2_0_7_4.json new file mode 100644 index 0000000..6a50942 --- /dev/null +++ b/test/fixtures/grids/plain_2_0_7_4.json @@ -0,0 +1 @@ +{"grid":[" "," ! "," "," "," "," "," "," # "," # # "," "," "," "," # # "," "," "," "," "," "," "," "," "," "," "," "," $ "," % "," $ "," "," % "," %% "," "," "," "," % "," "," "," "," & "," & ''' "," ''''' "," & ''' ( ( "," & ( "," "," "," ) "," ","* ","* ","* "," ** "," * "," ** * "," * % "," * )) ","* * * ))) + % ","* ** ++ % "," ) "," * )))) %%%"," ) % "," "," * "," )) % "," ) "," % "],"keys":["","UMI","KIR","TKL","COK","WLF","WSM","ASM","TON","FJI","NIU"],"data":{"ASM":{"AREA":20,"FIPS":"AQ","ISO2":"AS","ISO3":"ASM","LAT":-14.318,"LON":-170.73,"NAME":"American Samoa","POP2005":64051,"REGION":9,"SUBREGION":61,"UN":16},"COK":{"AREA":24,"FIPS":"CW","ISO2":"CK","ISO3":"COK","LAT":-21.219,"LON":-159.782,"NAME":"Cook Islands","POP2005":13984,"REGION":9,"SUBREGION":61,"UN":184},"FJI":{"AREA":1827,"FIPS":"FJ","ISO2":"FJ","ISO3":"FJI","LAT":-17.819,"LON":177.974,"NAME":"Fiji","POP2005":828046,"REGION":9,"SUBREGION":54,"UN":242},"KIR":{"AREA":73,"FIPS":"KR","ISO2":"KI","ISO3":"KIR","LAT":-1.508,"LON":175.036,"NAME":"Kiribati","POP2005":92003,"REGION":9,"SUBREGION":57,"UN":296},"NIU":{"AREA":26,"FIPS":"NE","ISO2":"NU","ISO3":"NIU","LAT":-19.052,"LON":-169.869,"NAME":"Niue","POP2005":1632,"REGION":9,"SUBREGION":61,"UN":570},"TKL":{"AREA":1,"FIPS":"TL","ISO2":"TK","ISO3":"TKL","LAT":-9.193,"LON":-171.853,"NAME":"Tokelau","POP2005":1401,"REGION":9,"SUBREGION":61,"UN":772},"TON":{"AREA":72,"FIPS":"TN","ISO2":"TO","ISO3":"TON","LAT":-21.202,"LON":-175.185,"NAME":"Tonga","POP2005":99361,"REGION":9,"SUBREGION":61,"UN":776},"UMI":{"AREA":0,"FIPS":"","ISO2":"UM","ISO3":"UMI","LAT":-0.385,"LON":-160.027,"NAME":"United States Minor Outlying Islands","POP2005":0,"REGION":0,"SUBREGION":0,"UN":581},"WLF":{"AREA":14,"FIPS":"WF","ISO2":"WF","ISO3":"WLF","LAT":-14.289,"LON":-178.131,"NAME":"Wallis and Futuna Islands","POP2005":15079,"REGION":9,"SUBREGION":61,"UN":876},"WSM":{"AREA":283,"FIPS":"WS","ISO2":"WS","ISO3":"WSM","LAT":-13.652,"LON":-172.414,"NAME":"Samoa","POP2005":183845,"REGION":9,"SUBREGION":61,"UN":882}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_10_12_4.json b/test/fixtures/grids/plain_2_10_12_4.json new file mode 100644 index 0000000..cb1dcb3 --- /dev/null +++ b/test/fixtures/grids/plain_2_10_12_4.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!!! "," !!!!!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!! "," !!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!!! "," !!!!!!!!!!!!! "," !!!!!!!!!!!!!! "," !!!!!!!!!!!! !!"," !!!!!!!!!!!! !!"," !!!!!!!!!!!! !!!"," !!!!!!!!!!!! !!!"," !!!!!!!!!!!! !!!"," !!!!!!!!!!!!! !!!"," !!!!!!!!!! !"," !!!!!!!! !"," !! !"," !!!! !!"," !!!!! !!"," !!!!!! !!"," !!!!!! !!"," !!!!!!!!! !!!"," !!!!!!!!!!!! !!!"," !!!!!!!!!!!! !!!"," !!!! !!!!!!!!!!!!! !!"," !!!!!! ! !!!!!!!!!!!!!! !!"," !!!!!!! !! !!!!!!!!!!!!!!! "," !!!!!!! ! !!!!!!!!!!!!!!!!! "," !!!!!! !!!!! ! !!!! !!!!!!!!!!!!!!!!! "," !!!!! !!!! !!!!!! !!!!!!!!!!!!!!!!!!!!"," !!! !!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!! !!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!","!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"],"keys":["","RUS"],"data":{"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_10_14_4.json b/test/fixtures/grids/plain_2_10_14_4.json new file mode 100644 index 0000000..8a337bc --- /dev/null +++ b/test/fixtures/grids/plain_2_10_14_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," !!!! "," !!!!!! "," !!!!! "," !!! !!!!!! "," !!!!!! "," !! !! !!!! "," !!!!!! !! "," !!!!!! "," !!!!!! "," !!!!!!!!! "," !! !!!!!!!! !!! "," ! !!!!!!!! !!!!!!! "," !!!!!!!! !!!!!! "," !! !!!!!!!!!!!!! !!!! "," !! ! !!!!!!!!! !!!! !!!! "," !! !!!! !!!!!!!!! !!!!! !!!! "," ! !!!!!!!!!!!!! !!!!!! !!!!! "," !!!!!!!!!!! !!!!! !!!!!!!! "," !!!! !!!!!!!!!!!!! !!!!! !!!!!!!!! "," !!!!! !!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!! !!!!!!!!!!!!!!! !!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!! !!!!!!!!! !! !!!!!!!!!!!!!!!! ","!!!!!!! !!!!!!!!!!!! ! !!!!! !!!!!!!!! !! ","!!!!!!! !! !!!!!!! ! !! !!!!!!!!!!!!!!!!!!! ","!!!!!! !!!!!!!!!! !!!!!! !!! !!!!!!!!! "," !!!! !!!!!!!!! !!!!!! !!!!! !!!!!!! "," !!! !!!!!!!! !!!!!!!! !!!!!!! !!!!!! "," !!!!!!!!! !!!! !!!!!!!!!!!!!!! ! "," !!!!!!! !!!!! ! !! !!!!!!!!!! "," !!!!!!!! !!!!!!! !! !!!!!!! "," !!!!!!! !!! !!!!!!! !! !!!!!!!! !! "," !!!!!!!!!!! !!!! !!!!!!!!! !! "," !!! !!! !! !!!!!!! !!!! "," !!!!!!! !!!! "," !! !!!!! !!!!!! "," !!! !!!!! "," "," "," "," "," "," "," "," "," "," "," "],"keys":["","RUS"],"data":{"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_10_9_4.json b/test/fixtures/grids/plain_2_10_9_4.json new file mode 100644 index 0000000..08fe0cb --- /dev/null +++ b/test/fixtures/grids/plain_2_10_9_4.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!!#########$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%"," !!!!!!!!!!!!!######$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%%"," !!!!!!!!!!!!!#####$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%"," !!!!!!!!!!#########$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%%"," !!!&&!!!!#########$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%%","& !&&&&!!!##########$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%%","&& &&&&&!!!##########$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%%","&&&&&&&&&&!!##########$#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%%%","&&&&&&&&&&!###########$##$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%%%","&&&&&&&&&&&##############$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%%","&&&&&&&&&&&&#############$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%%%%%%","&&&&&&&&&&&&#############$$$$&&&&&&$$$$$$$$$$$$$$$$$$$$$$$$$$%%%","&&&&&&&&&&&&&&&##########$$$&&&&&&&&&$$$$$$$$$$$$$$$$$$$$$$$$%%%","&&&&&&&&&&&&&&&&#########$$&&&&&&&&&&&&&$$$$$$$$$$$$$$$$$$$$$%%%","&&&&&&&&&&&&&&&&&######&&&&&&&&&&&&&&&&&&$$$$$$$$$$$$$$$$'''''''","(&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$$$$$$$$$$'''''''","(&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$$$$$$$''''''''","((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$$$$$$$''''''''","((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$$$$''''''''''","((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$$''''''''''''","((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&$$$$$''''''''''''","((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''$''''''''''''''","(((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''","(((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''","((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","(((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''","((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","(((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''","((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''''","(((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''''''''","((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''''''","((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''')))","(((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''))))","(((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&''''''''''''))))","((((((((((&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&'''''''''''''))))","(((((*****(&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&)''''''''''''''))))","(((((*****####&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))'''''))))))))))","((((******#####&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))))))))))))))))","++++++++**######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))))))))))))))))","++++++++**######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&)))))))))))))))))","++++++++++#######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&)))))))))))))))))","+++++++++++######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&)))))))))))))))","+++++++++++#######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))))))))))))","+++++++++++++#######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))))))))))))","++++++++++++++#######&&&&&&&&&&&&&&&&&&&&&&&&&&&&&))))))))))))))","+++++++++++++++########&&&&&&&&&&&&&&&&&&&&&&&&&&&&)))))))))))))","+++++++++++++++#########&&&&&&&&##&&&&&&&&&&&&&&&)))))))))))))))","+++++++++++++++,,-#############..#&&&&&&&&&&&&&)))))))))))))))))","+++++++++++++++,---############/.#&&&&&&&&&&&&&)))))))))))))))))","++++++++++++++++---##########////#&&&&&&&&&&&&&)))))))))))))))))","++++++++++++++++---#########/////######&&&&&&&&)))))))))))))))))","+++++++++++++++++--########//////#############&))############)))","+++++++++++++++++++#######//////.############################)))","++++++++++++++++++//#///////////..#############################)","++++++++++++++++++//////////////....###########################)","+++++++++++++++++++///////////.........#########################","++++++++++++++++++++//////////..........########################","++++++++++++++++++++//////////...........#######################","++++++++++++++++++++++////////............######################","++++++++++++++++++++++++++++++.............#####################","+++++++++++++++++++++++++++++++............#####################"],"keys":["ARM","AZE","","TKM","UZB","IRN","AFG","IRQ","PAK","KWT","SAU","BHR","QAT","OMN","ARE"],"data":{"AFG":{"AREA":65209,"FIPS":"AF","ISO2":"AF","ISO3":"AFG","LAT":33.677,"LON":65.216,"NAME":"Afghanistan","POP2005":25067407,"REGION":142,"SUBREGION":34,"UN":4},"ARE":{"AREA":8360,"FIPS":"AE","ISO2":"AE","ISO3":"ARE","LAT":23.549,"LON":54.163,"NAME":"Untied Arab Emirates","POP2005":4104291,"REGION":142,"SUBREGION":145,"UN":784},"ARM":{"AREA":2820,"FIPS":"AM","ISO2":"AM","ISO3":"ARM","LAT":40.534,"LON":44.563,"NAME":"Armenia","POP2005":3017661,"REGION":142,"SUBREGION":145,"UN":51},"AZE":{"AREA":8260,"FIPS":"AJ","ISO2":"AZ","ISO3":"AZE","LAT":40.43,"LON":47.395,"NAME":"Azerbaijan","POP2005":8352021,"REGION":142,"SUBREGION":145,"UN":31},"BHR":{"AREA":71,"FIPS":"BA","ISO2":"BH","ISO3":"BHR","LAT":26.019,"LON":50.562,"NAME":"Bahrain","POP2005":724788,"REGION":142,"SUBREGION":145,"UN":48},"IRN":{"AREA":163620,"FIPS":"IR","ISO2":"IR","ISO3":"IRN","LAT":32.565,"LON":54.301,"NAME":"Iran (Islamic Republic of)","POP2005":69420607,"REGION":142,"SUBREGION":34,"UN":364},"IRQ":{"AREA":43737,"FIPS":"IZ","ISO2":"IQ","ISO3":"IRQ","LAT":33.048,"LON":43.772,"NAME":"Iraq","POP2005":27995984,"REGION":142,"SUBREGION":145,"UN":368},"KWT":{"AREA":1782,"FIPS":"KU","ISO2":"KW","ISO3":"KWT","LAT":29.476,"LON":47.376,"NAME":"Kuwait","POP2005":2700,"REGION":142,"SUBREGION":145,"UN":414},"OMN":{"AREA":30950,"FIPS":"MU","ISO2":"OM","ISO3":"OMN","LAT":21.656,"LON":57.407,"NAME":"Oman","POP2005":2507042,"REGION":142,"SUBREGION":145,"UN":512},"PAK":{"AREA":77088,"FIPS":"PK","ISO2":"PK","ISO3":"PAK","LAT":29.967,"LON":69.386,"NAME":"Pakistan","POP2005":158080591,"REGION":142,"SUBREGION":34,"UN":586},"QAT":{"AREA":1100,"FIPS":"QA","ISO2":"QA","ISO3":"QAT","LAT":25.316,"LON":51.191,"NAME":"Qatar","POP2005":796186,"REGION":142,"SUBREGION":145,"UN":634},"SAU":{"AREA":214969,"FIPS":"SA","ISO2":"SA","ISO3":"SAU","LAT":24.023,"LON":44.585,"NAME":"Saudi Arabia","POP2005":2361236,"REGION":142,"SUBREGION":145,"UN":682},"TKM":{"AREA":46993,"FIPS":"TX","ISO2":"TM","ISO3":"TKM","LAT":39.122,"LON":59.384,"NAME":"Turkmenistan","POP2005":4833266,"REGION":142,"SUBREGION":143,"UN":795},"UZB":{"AREA":42540,"FIPS":"UZ","ISO2":"UZ","ISO3":"UZB","LAT":41.75,"LON":63.17,"NAME":"Uzbekistan","POP2005":26593123,"REGION":142,"SUBREGION":143,"UN":860}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_11_4_4.json b/test/fixtures/grids/plain_2_11_4_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_11_4_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_11_6_4.json b/test/fixtures/grids/plain_2_11_6_4.json new file mode 100644 index 0000000..fa5b754 --- /dev/null +++ b/test/fixtures/grids/plain_2_11_6_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ! "," "," "," ! "," "," "," "," "," "," "," "," "],"keys":["","ATF"],"data":{"ATF":{"AREA":0,"FIPS":"FS","ISO2":"TF","ISO3":"ATF","LAT":-49.302,"LON":69.117,"NAME":"French Southern and Antarctic Lands","POP2005":0,"REGION":0,"SUBREGION":0,"UN":260}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_11_7_4.json b/test/fixtures/grids/plain_2_11_7_4.json new file mode 100644 index 0000000..07a9894 --- /dev/null +++ b/test/fixtures/grids/plain_2_11_7_4.json @@ -0,0 +1 @@ +{"grid":[" ! "," !! "," "," "," "," "," "," "," "," "," "," "," "," "," "," ## "," "," # "," "," "," ## "," ## "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":["","MDV","IOT"],"data":{"IOT":{"AREA":0,"FIPS":"IO","ISO2":"IO","ISO3":"IOT","LAT":-7.335,"LON":72.416,"NAME":"British Indian Ocean Territory","POP2005":0,"REGION":0,"SUBREGION":0,"UN":86},"MDV":{"AREA":30,"FIPS":"MV","ISO2":"MV","ISO3":"MDV","LAT":3.548,"LON":72.92,"NAME":"Maldives","POP2005":295297,"REGION":142,"SUBREGION":34,"UN":462}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_12_5_4.json b/test/fixtures/grids/plain_2_12_5_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_12_5_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_13_10_4.json b/test/fixtures/grids/plain_2_13_10_4.json new file mode 100644 index 0000000..1e100ca --- /dev/null +++ b/test/fixtures/grids/plain_2_13_10_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," !!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!!!!! "," !!!!!!!!!!!!!! "," !!!!!!!!!!!!!! "," !!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!! "," ### !!!!!!!!!!!!!!!!!!!!!! "," ######## !!!!!!!!!!!!!!!!!!!!!!!!! "," ##########!! !!!!!!!!!!!!!!!!!!!!!!!!!!! ","###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","##########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","##########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","##########!!!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ","###################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ","####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! ","#####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","#####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","###########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","##########!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! ","######!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","#####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$ %%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$ %%% %%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$ %%%%%%%%%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$%%%%%%%%%%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$!!$$$$$$%%%%%%%%%%%%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$!!$$$$$$%%%%%%%%%%%%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$%%%%%%%%%%%%%%","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$$$$$$$$$$$%%%%%%%%%%%%%%%"],"keys":["RUS","CHN","MNG","PRK",""],"data":{"CHN":{"AREA":932743,"FIPS":"CH","ISO2":"CN","ISO3":"CHN","LAT":33.42,"LON":106.514,"NAME":"China","POP2005":1312978855,"REGION":142,"SUBREGION":30,"UN":156},"MNG":{"AREA":156650,"FIPS":"MG","ISO2":"MN","ISO3":"MNG","LAT":46.056,"LON":102.876,"NAME":"Mongolia","POP2005":2580704,"REGION":142,"SUBREGION":30,"UN":496},"PRK":{"AREA":12041,"FIPS":"KN","ISO2":"KP","ISO3":"PRK","LAT":39.778,"LON":126.451,"NAME":"Korea, Democratic People's Republic of","POP2005":23615611,"REGION":142,"SUBREGION":30,"UN":408},"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_13_11_4.json b/test/fixtures/grids/plain_2_13_11_4.json new file mode 100644 index 0000000..21e64fb --- /dev/null +++ b/test/fixtures/grids/plain_2_13_11_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":["RUS"],"data":{"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_14_10_4.json b/test/fixtures/grids/plain_2_14_10_4.json new file mode 100644 index 0000000..3e41746 --- /dev/null +++ b/test/fixtures/grids/plain_2_14_10_4.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," ! !!!!!!!!!!!! !!!!!!!!!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!!!!!!!!!!!! !!!!!!!!"," !!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!"," !!!! !!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!"," !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!"," !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!"," !!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!"," !!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!"," !!!!!!!! !!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!"," !!!!!!!!! !!!!!!!!!!!!!!!!!!! !! !!!!!!!!!!!!!!!!"," !!!!!!!!! !! !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!! !! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!"," !!!!!!!!!! !! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!#####!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!#####!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!####!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!####!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!######!!!!!#! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!#########!## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!########### !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!########### ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!#!!############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!##############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!#############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!#####!!!!###!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!####!!!!!#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!#####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!####!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"],"keys":["RUS","","JPN"],"data":{"JPN":{"AREA":36450,"FIPS":"JA","ISO2":"JP","ISO3":"JPN","LAT":36.491,"LON":139.068,"NAME":"Japan","POP2005":12789674,"REGION":142,"SUBREGION":30,"UN":392},"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_14_5_4.json b/test/fixtures/grids/plain_2_14_5_4.json new file mode 100644 index 0000000..dc95ef1 --- /dev/null +++ b/test/fixtures/grids/plain_2_14_5_4.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!! "," !!!!!!!!! "," !!!!!!!!! "," !!!!!!!!! "," !!!!!!!! "," !!!!!!! "," !!!!! "," ! "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":["","AUS"],"data":{"AUS":{"AREA":768230,"FIPS":"AS","ISO2":"AU","ISO3":"AUS","LAT":-24.973,"LON":136.189,"NAME":"Australia","POP2005":20310208,"REGION":9,"SUBREGION":53,"UN":36}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_15_12_4.json b/test/fixtures/grids/plain_2_15_12_4.json new file mode 100644 index 0000000..e6d6086 --- /dev/null +++ b/test/fixtures/grids/plain_2_15_12_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," !"," !!"," !!!"," !!!!","! !!!!","!!! !!!!","!!!!! !! !!!!","!!!!!! !! ! ! ","!!!!!!! !! ","!!!!!!! ","!!!!!!!! ","!!!!!!!! ","!!!!!!!! ","!!!!!!! !!!!! ","!!!!!!! !!!!! !!!!!!!!! !! ","!!!!!!! !!!!! !!!!!!!!!!!!!!!!!!! ","!!!!!!!!!! !!!!!!! !!!!!! !!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!! !!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!! ","!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"],"keys":["","RUS"],"data":{"RUS":{"AREA":1638094,"FIPS":"RS","ISO2":"RU","ISO3":"RUS","LAT":61.988,"LON":96.689,"NAME":"Russia","POP2005":143953092,"REGION":150,"SUBREGION":151,"UN":643}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_15_14_4.json b/test/fixtures/grids/plain_2_15_14_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_15_14_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_1_14_4.json b/test/fixtures/grids/plain_2_1_14_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_1_14_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_1_3_2.json b/test/fixtures/grids/plain_2_1_3_2.json new file mode 100644 index 0000000..f666de3 --- /dev/null +++ b/test/fixtures/grids/plain_2_1_3_2.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," !!!!!!! "," !!!!!!!!!!! "," !!!!!!!!!!!!!! "," ###### !!!!!!!!!!!!!!!!! "," ############ !!!!!!!!!!!!!!!!!! "," ############## !!!!!!!!!!!!!!!!!!!!! "," ############### !!!!!!!!!!!!!!!!!!!!!! "," ################### !!!!!!!!!!!!!!!!!!!!!!!!! "," ################### !!!!!!!!!!!!!!!!!!!!!!!!!! !! ","#################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","####################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","################### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","##################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","#################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","################!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","###############!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","############ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","########### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," ########## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######### !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","# ## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","######## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","####### !!!!!!!!!!!!!!!!!!!!!!!!!!!!! ","# !!!!!!!!!!!!!!!!!!!!!!!!!!!! "," ######## !!!!!!!!!!!!!!!!!!!!!!!!!!! ","########## !!!!!!!!!!!!!!!!!!!!!!!!!!! ","########## !!!!!!!!!!!!!!!!!!!!!!!!!! ","########### !!!!!!!!!!!!!!!!!!!!!!!!! ","############ !!!!!!!!!!!!!!!!!!!!!!!!! ","############# !!!!!!!!!!!!!!!!!!!!!!!!! ","############## !!!!!!!!!!!!!!!!!!!!!!!!! $$ ","################ !!!!!!!!!!!!!!!!!!!!!!!! $$ ","################ !!!!!!!!!!!!!!!!!!!!!!!!! "," ################ !!!!!!!!!!!!!!!!!!!!!!!!! ","# ############## !!!!!!!!!!!!!!!!!!!!!!!! ","## ############## !!!!!!!!!!!!!!!!!!!!! ","################## !!!!!!!!!!!!!!!!!!!! ","####### ########## !!!!!!!!!!!!!!!!!! ","####### ## ######## !!!!!!!!!!!!!!!! ","####### ########## !!!!!!!!!!!!!!! % "],"keys":["","GRL","CAN","SJM","ISL"],"data":{"CAN":{"AREA":909351,"FIPS":"CA","ISO2":"CA","ISO3":"CAN","LAT":59.081,"LON":-109.433,"NAME":"Canada","POP2005":32270507,"REGION":19,"SUBREGION":21,"UN":124},"GRL":{"AREA":41045,"FIPS":"GL","ISO2":"GL","ISO3":"GRL","LAT":74.719,"LON":-41.391,"NAME":"Greenland","POP2005":57475,"REGION":19,"SUBREGION":21,"UN":304},"ISL":{"AREA":10025,"FIPS":"IC","ISO2":"IS","ISO3":"ISL","LAT":64.764,"LON":-18.48,"NAME":"Iceland","POP2005":295732,"REGION":150,"SUBREGION":154,"UN":352},"SJM":{"AREA":0,"FIPS":"SV","ISO2":"SJ","ISO3":"SJM","LAT":78.83,"LON":18.374,"NAME":"Svalbard","POP2005":0,"REGION":150,"SUBREGION":154,"UN":744}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_1_9_4.json b/test/fixtures/grids/plain_2_1_9_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_1_9_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_2_12_4.json b/test/fixtures/grids/plain_2_2_12_4.json new file mode 100644 index 0000000..db8caa1 --- /dev/null +++ b/test/fixtures/grids/plain_2_2_12_4.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!! !! "," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!! ! !!!!!!!!!!!!!!!!!"," !!!!!!!!!! !!!!!!!!!!!!!!!!!"," !!!!!!!! !!!! !!!!!!!!!!!!"," !!!!! !!!!!!!!!!!!!!!"," !!! !!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!"," ! !!!!!!!!!!!!!!!"," !!! !!!!!!!! !!"," !!! !! "," !! !!!! !!!!!!!!!"," !!!! !!!! !!! !!!!!!!!!!!!!"," !!!!! !!!!! !!!! !!!!!!!!!!!!!!"," !!!!!!!!!!!!!!! !!!! !!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!! !!!! !!!!!! !!!!!!!!!!!!!!"," !! !!!!!!!!!!!!!!!!!!!! !!!!! !!!!!!! !!!!!!!!!!!!!!"," !!! !!!!!!!!!!!!!!!!!!!! !!!! !!!!!!!! !!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!! !!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!","!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"],"keys":["","CAN"],"data":{"CAN":{"AREA":909351,"FIPS":"CA","ISO2":"CA","ISO3":"CAN","LAT":59.081,"LON":-109.433,"NAME":"Canada","POP2005":32270507,"REGION":19,"SUBREGION":21,"UN":124}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_2_13_4.json b/test/fixtures/grids/plain_2_2_13_4.json new file mode 100644 index 0000000..3826c45 --- /dev/null +++ b/test/fixtures/grids/plain_2_2_13_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," !"," !!"," !!!"," !!!"," !! "," "," ! "," !!! !"," !!!! !!"," !!!!!!!!"," !!!!!!!"," !!!!!!"," !!"," ! !!!"," !!!!! !!!"," !!!!! !!"," !!!!!!!!!!!! !"," !!!!!!!!!!!! "," !!!!!!!!!!!! "," !!!!!!!!!!! !!! "," !!!!!!!!!!!! "," !!!!!!!!!!!!!! "," !!!!!!!!!!!!!! !!!! "," !!!!!!!!!!!!!! !!!!! "," !!!!!!!!!!!!!!!! !!!!! "," !!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!! ! "," !!!!!!!!! !!!! !!!!! "," !!!!!!!!!!!! !!!! !!!!!! "," !!!!!!!!!!!! !!!! !!!!!! "," !!!!!!!!!!!! !! !!!!!!!!!!!"," !!!!!!!!!!!! !! !!!!!!!!!!!!"," !!!!!!!!!!!! !!! !!!!!!!!!!!!"," !!! !!!!!!! !!!! !!!!!!!!!!!!!"," !! !!!!! !!!! !!!!!!!!!!!!!"," !!!! !!!! !!!!!!!!!!!!!"," ! !!!!! !!!!!!!!!!!!!!"," !!!! !!!!!!!!!!!!!!"," !!!! !!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!"," !!!!!!!!!!!!!"," !!!!!! !!"," !!!"," !!!!!"," !!!!!!"," !!!!!!"," !!!! !!!!!"," !!!!!!!!!! !!!!"," !!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!! "," !!!!!!!!!!!!!!!!!!!!!!! "],"keys":["","CAN"],"data":{"CAN":{"AREA":909351,"FIPS":"CA","ISO2":"CA","ISO3":"CAN","LAT":59.081,"LON":-109.433,"NAME":"Canada","POP2005":32270507,"REGION":19,"SUBREGION":21,"UN":124}}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_2_14_4.json b/test/fixtures/grids/plain_2_2_14_4.json new file mode 100644 index 0000000..56e80d2 --- /dev/null +++ b/test/fixtures/grids/plain_2_2_14_4.json @@ -0,0 +1 @@ +{"grid":[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],"keys":[""],"data":{}} \ No newline at end of file diff --git a/test/fixtures/grids/plain_2_2_4_3.json b/test/fixtures/grids/plain_2_2_4_3.json new file mode 100644 index 0000000..66521d0 --- /dev/null +++ b/test/fixtures/grids/plain_2_2_4_3.json @@ -0,0 +1 @@ +{"grid":[" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"," !!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!66!!!!!!!!!!!!!!!!!!!!!!","3555555555!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!6!!!!!!!!!!!!!!!!!!!!!!!","3555555777!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!88!!!!!!!!!!!!!!!!!!!!!!","55555777777!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!9!!!!!!!!!!!!!!!!!!!!!!","::55777777!!;!!!!!!!!!!!!!!!!!!!!!!!!!!!<!!!!!!!!!!! 0.8) { -// write(mbtiles, row.tile_column, row.tile_row, row.zoom_level); -// } -// }); - function yieldsError(status, error, msg) { return function(err) { assert.equal(err, msg); @@ -86,5 +73,41 @@ exports['get tiles'] = function(beforeExit) { }; exports['get grids'] = function(beforeExit) { + var status = { + success: 0, + error: 0 + }; + var mbtiles = new MBTiles(fixtures.plain_2); + fs.readdirSync(__dirname + '/fixtures/grids/').forEach(function(file) { + var coords = file.match(/^plain_2_(\d+)_(\d+)_(\d+).json$/); + if (coords) { + mbtiles.grid(coords[1] | 0, coords[2] | 0, coords[3] | 0, function(err, grid) { + if (err) throw err; + assert.deepEqual(JSON.stringify(grid), fs.readFileSync(__dirname + '/fixtures/grids/' + file, 'utf8')); + status.success++; + }); + } + }); + + mbtiles.grid(1, 0, 0, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(0, 0, -1, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(0, -1, 0, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(1, 8, 3, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(-3, 0, 2, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(2, 3, 18, yieldsError(status, 'error', 'Grid does not exist')); + mbtiles.grid(0, 0, 4, yieldsError(status, 'error', 'Grid does not exist')); + + mbtiles.grid(3, 8, 4, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(4, 8, 4, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(5, 8, 4, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(13, 4, 4, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(0, 14, 4, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(0, 7, 3, yieldsError(status, 'error', 'Grid is invalid')); + mbtiles.grid(6, 2, 3, yieldsError(status, 'error', 'Grid is invalid')); + + beforeExit(function() { + assert.equal(status.success, 50); + assert.equal(status.error, 14); + }); };