Skip to content

Commit

Permalink
Added playground JSON files and test routine (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Blower authored Apr 25, 2022
1 parent ba120ca commit a1ec93b
Show file tree
Hide file tree
Showing 30 changed files with 1,166 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/test_data/playground/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
These are complete CoverageJSON objects, copied from the CoverageJSON playground. They are included here to perform a "sanity check" that all the coverages validate against the schema.
71 changes: 71 additions & 0 deletions test/test_data/playground/grid-categorical.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"type" : "Coverage",
"domain" : {
"type" : "Domain",
"domainType" : "Grid",
"axes": {
"x" : { "values": [-10,-5,0] },
"y" : { "values": [40,50] },
"t" : { "values": ["2010-01-01T00:12:20Z"] }
},
"referencing": [{
"coordinates": ["x","y"],
"system": {
"type": "GeographicCRS",
"id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
}, {
"coordinates": ["t"],
"system": {
"type": "TemporalRS",
"calendar": "Gregorian"
}
}]
},
"parameters" : {
"LC": {
"type" : "Parameter",
"description" : {
"en": "Land Cover according to xyz classification"
},
"observedProperty" : {
"id" : "http://example.com/landcover",
"label" : {
"en": "XYZ Land Cover"
},
"categories" : [{
"id": "http://example.com/landcover/categories/grass",
"label": {
"en": "Grass"
},
"description": {
"en": "Very green grass."
},
"preferredColor": "#01A611"
}, {
"id": "http://example.com/landcover/categories/rocks",
"label": {
"en": "Rock"
},
"description": {
"en": "Just rocks."
},
"preferredColor": "#A0A0A0"
}]
},
"categoryEncoding": {
"http://example.com/landcover/categories/grass": 1,
"http://example.com/landcover/categories/rocks": 2
}
}
},
"ranges" : {
"LC" : {
"type" : "NdArray",
"dataType": "integer",
"axisNames": ["t","y","x"],
"shape": [1, 2, 3],
"values" : [ 1, 1, null, 2, 1, 2 ]
}
}
}
15 changes: 15 additions & 0 deletions test/test_data/playground/grid-domain-bng.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type" : "Domain",
"domainType": "Grid",
"axes": {
"x" : { "start": 185106, "stop": 657784, "num": 100 },
"y" : { "start": 15407, "stop": 619322, "num": 100 }
},
"referencing": [{
"coordinates": ["x", "y"],
"system": {
"type": "ProjectedCRS",
"id": "http://www.opengis.net/def/crs/EPSG/0/27700"
}
}]
}
15 changes: 15 additions & 0 deletions test/test_data/playground/grid-domain.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type" : "Domain",
"domainType" : "Grid",
"axes": {
"x" : { "start": -10, "stop":0, "num": 10 },
"y" : { "start": 40, "stop": 50, "num": 20 }
},
"referencing": [{
"coordinates": ["x","y"],
"system": {
"type": "GeographicCRS",
"id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
}]
}
53 changes: 53 additions & 0 deletions test/test_data/playground/grid-tiled.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"type" : "Coverage",
"domain" : {
"type" : "Domain",
"domainType" : "Grid",
"axes": {
"x" : { "start": -100, "stop": 100, "num": 10 },
"y" : { "start": -50, "stop": 50, "num": 5 },
"t" : { "values": ["2010", "2011"] }
},
"referencing": [{
"coordinates": ["x","y"],
"system": {
"type": "GeographicCRS",
"id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
}
}, {
"coordinates": ["t"],
"system": {
"type": "TemporalRS",
"calendar": "Gregorian"
}
}]
},
"parameters" : {
"FOO": {
"type" : "Parameter",
"observedProperty" : {
"label" : {
"en": "Bar"
}
}
}
},
"ranges" : {
"FOO" : {
"type" : "TiledNdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 5, 10],
"tileSets": [{
"tileShape": [null, 2, 3],
"urlTemplate": "https://covjson.org/playground/coverages/grid-tiled/a/{y}-{x}.covjson"
}, {
"tileShape": [1, null, null],
"urlTemplate": "https://covjson.org/playground/coverages/grid-tiled/b/{t}.covjson"
}, {
"tileShape": [null, null, null],
"urlTemplate": "https://covjson.org/playground/coverages/grid-tiled/c/all.covjson"
}]
}
}
}
16 changes: 16 additions & 0 deletions test/test_data/playground/grid-tiled/a/0-0.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [
1, 2, 3,
11, 12, 13,




51, 52, 53,
61, 62, 63
]
}
16 changes: 16 additions & 0 deletions test/test_data/playground/grid-tiled/a/0-1.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [
4, 5, 6,
14, 15, 16,




54, 55, 56,
64, 65, 66
]
}
16 changes: 16 additions & 0 deletions test/test_data/playground/grid-tiled/a/0-2.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [
7, 8, 9,
17, 18, 19,




57, 58, 59,
67, 68, 69
]
}
16 changes: 16 additions & 0 deletions test/test_data/playground/grid-tiled/a/0-3.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 1],
"values": [
10,
20,




60,
70
]
}
18 changes: 18 additions & 0 deletions test/test_data/playground/grid-tiled/a/1-0.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [


21, 22, 23,
31, 32, 33,




71, 72, 73,
81, 82, 83
]
}
18 changes: 18 additions & 0 deletions test/test_data/playground/grid-tiled/a/1-1.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [


24, 25, 26,
34, 35, 36,




74, 75, 76,
84, 85, 86
]
}
18 changes: 18 additions & 0 deletions test/test_data/playground/grid-tiled/a/1-2.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 3],
"values": [


27, 28, 29,
37, 38, 39,




77, 78, 79,
87, 88, 89
]
}
18 changes: 18 additions & 0 deletions test/test_data/playground/grid-tiled/a/1-3.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 2, 1],
"values": [


30,
40,




80,
90
]
}
19 changes: 19 additions & 0 deletions test/test_data/playground/grid-tiled/a/2-0.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 1, 3],
"values": [




41, 42, 43,





91, 92, 93
]
}
19 changes: 19 additions & 0 deletions test/test_data/playground/grid-tiled/a/2-1.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 1, 3],
"values": [




44, 45, 46,





94, 95, 96
]
}
19 changes: 19 additions & 0 deletions test/test_data/playground/grid-tiled/a/2-2.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 1, 3],
"values": [




47, 48, 49,





97, 98, 99
]
}
19 changes: 19 additions & 0 deletions test/test_data/playground/grid-tiled/a/2-3.covjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "NdArray",
"dataType": "integer",
"axisNames": ["t", "y", "x"],
"shape": [2, 1, 1],
"values": [




50,





100
]
}
Loading

0 comments on commit a1ec93b

Please sign in to comment.