Skip to content

Commit b79430a

Browse files
committed
Zarr: implement read support for 'spatial' and 'proj' conventions
See: - https://github.com/zarr-conventions/spatial - https://github.com/zarr-conventions/geo-proj Supersedes earlier non-commited: OSGeo#13215
1 parent cbd2364 commit b79430a

File tree

12 files changed

+940
-48
lines changed

12 files changed

+940
-48
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"attributes": {
3+
"zarr_conventions": [
4+
{
5+
"schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v1/schema.json",
6+
"spec_url": "https://github.com/zarr-conventions/spatial/blob/v1/README.md",
7+
"uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
8+
"name": "spatial:",
9+
"description": "Spatial coordinate information"
10+
}
11+
]
12+
},
13+
"zarr_format": 3,
14+
"consolidated_metadata": {
15+
"kind": "inline",
16+
"must_understand": false,
17+
"metadata": {
18+
"ar": {
19+
"shape": [
20+
200,
21+
100
22+
],
23+
"data_type": "float32",
24+
"chunk_grid": {
25+
"name": "regular",
26+
"configuration": {
27+
"chunk_shape": [
28+
200,
29+
100
30+
]
31+
}
32+
},
33+
"chunk_key_encoding": {
34+
"name": "default",
35+
"configuration": {
36+
"separator": "/"
37+
}
38+
},
39+
"fill_value": "NaN",
40+
"codecs": [
41+
{
42+
"name": "bytes",
43+
"configuration": {
44+
"endian": "little"
45+
}
46+
}
47+
],
48+
"attributes": {
49+
"spatial:dimensions": ["y", "x"],
50+
"spatial:transform": [10, 0.1, 450000,
51+
0.15, -10, 5000000]
52+
},
53+
"dimension_names": [
54+
"y",
55+
"x"
56+
],
57+
"zarr_format": 3,
58+
"node_type": "array",
59+
"storage_transformers": []
60+
}
61+
}
62+
},
63+
"node_type": "group"
64+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"attributes": {
3+
"zarr_conventions": [
4+
{
5+
"schema_url": "https://raw.githubusercontent.com/zarr-experimental/geo-proj/refs/tags/v1/schema.json",
6+
"spec_url": "https://github.com/zarr-experimental/geo-proj/blob/v1/README.md",
7+
"uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f",
8+
"name": "proj:",
9+
"description": "Coordinate reference system information for geospatial data"
10+
},
11+
{
12+
"schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v1/schema.json",
13+
"spec_url": "https://github.com/zarr-conventions/spatial/blob/v1/README.md",
14+
"uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
15+
"name": "spatial:",
16+
"description": "Spatial coordinate information"
17+
}
18+
]
19+
},
20+
"zarr_format": 3,
21+
"consolidated_metadata": {
22+
"kind": "inline",
23+
"must_understand": false,
24+
"metadata": {
25+
"ar": {
26+
"shape": [
27+
200,
28+
100
29+
],
30+
"data_type": "float32",
31+
"chunk_grid": {
32+
"name": "regular",
33+
"configuration": {
34+
"chunk_shape": [
35+
200,
36+
100
37+
]
38+
}
39+
},
40+
"chunk_key_encoding": {
41+
"name": "default",
42+
"configuration": {
43+
"separator": "/"
44+
}
45+
},
46+
"fill_value": "NaN",
47+
"codecs": [
48+
{
49+
"name": "bytes",
50+
"configuration": {
51+
"endian": "little"
52+
}
53+
}
54+
],
55+
"attributes": {
56+
"proj:code": "EPSG:32631",
57+
"spatial:registration": "pixel",
58+
"spatial:dimensions": ["y", "x"],
59+
"spatial:transform": [10, 0, 450000,
60+
0, -10, 5000000]
61+
},
62+
"dimension_names": [
63+
"y",
64+
"x"
65+
],
66+
"zarr_format": 3,
67+
"node_type": "array",
68+
"storage_transformers": []
69+
}
70+
}
71+
},
72+
"node_type": "group"
73+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"attributes": {
3+
"zarr_conventions": [
4+
{
5+
"schema_url": "https://raw.githubusercontent.com/zarr-experimental/geo-proj/refs/tags/v1/schema.json",
6+
"spec_url": "https://github.com/zarr-experimental/geo-proj/blob/v1/README.md",
7+
"uuid": "f17cb550-5864-4468-aeb7-f3180cfb622f",
8+
"name": "proj:",
9+
"description": "Coordinate reference system information for geospatial data"
10+
},
11+
{
12+
"schema_url": "https://raw.githubusercontent.com/zarr-conventions/spatial/refs/tags/v1/schema.json",
13+
"spec_url": "https://github.com/zarr-conventions/spatial/blob/v1/README.md",
14+
"uuid": "689b58e2-cf7b-45e0-9fff-9cfc0883d6b4",
15+
"name": "spatial:",
16+
"description": "Spatial coordinate information"
17+
}
18+
],
19+
"proj:wkt2": "PROJCRS[\"WGS 84 / UTM zone 31N\",BASEGEOGCRS[\"WGS 84\",ENSEMBLE[\"World Geodetic System 1984 ensemble\",MEMBER[\"World Geodetic System 1984 (Transit)\"],MEMBER[\"World Geodetic System 1984 (G730)\"],MEMBER[\"World Geodetic System 1984 (G873)\"],MEMBER[\"World Geodetic System 1984 (G1150)\"],MEMBER[\"World Geodetic System 1984 (G1674)\"],MEMBER[\"World Geodetic System 1984 (G1762)\"],MEMBER[\"World Geodetic System 1984 (G2139)\"],MEMBER[\"World Geodetic System 1984 (G2296)\"],ELLIPSOID[\"WGS 84\",6378137,298.257223563,LENGTHUNIT[\"metre\",1]],ENSEMBLEACCURACY[2.0]],PRIMEM[\"Greenwich\",0,ANGLEUNIT[\"degree\",0.0174532925199433]],ID[\"EPSG\",4326]],CONVERSION[\"UTM zone 31N\",METHOD[\"Transverse Mercator\",ID[\"EPSG\",9807]],PARAMETER[\"Latitude of natural origin\",0,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8801]],PARAMETER[\"Longitude of natural origin\",3,ANGLEUNIT[\"degree\",0.0174532925199433],ID[\"EPSG\",8802]],PARAMETER[\"Scale factor at natural origin\",0.9996,SCALEUNIT[\"unity\",1],ID[\"EPSG\",8805]],PARAMETER[\"False easting\",500000,LENGTHUNIT[\"metre\",1],ID[\"EPSG\",8806]],PARAMETER[\"False northing\",0,LENGTHUNIT[\"metre\",1],ID[\"EPSG\",8807]]],CS[Cartesian,2],AXIS[\"(E)\",east,ORDER[1],LENGTHUNIT[\"metre\",1]],AXIS[\"(N)\",north,ORDER[2],LENGTHUNIT[\"metre\",1]],USAGE[SCOPE[\"Navigation and medium accuracy spatial referencing.\"],AREA[\"Between 0°E and 6°E, northern hemisphere between equator and 84°N, onshore and offshore. Algeria. Andorra. Belgium. Benin. Burkina Faso. Denmark - North Sea. France. Germany - North Sea. Ghana. Luxembourg. Mali. Netherlands. Niger. Nigeria. Norway. Spain. Togo. United Kingdom (UK) - North Sea.\"],BBOX[0,0,84,6]],ID[\"EPSG\",32631]]",
20+
"spatial:dimensions": ["y", "x"],
21+
"spatial:transform": [10, 0, 450000,
22+
0, -10, 5000000]
23+
},
24+
"zarr_format": 3,
25+
"consolidated_metadata": {
26+
"kind": "inline",
27+
"must_understand": false,
28+
"metadata": {
29+
"ar": {
30+
"shape": [
31+
200,
32+
100
33+
],
34+
"data_type": "float32",
35+
"chunk_grid": {
36+
"name": "regular",
37+
"configuration": {
38+
"chunk_shape": [
39+
200,
40+
100
41+
]
42+
}
43+
},
44+
"chunk_key_encoding": {
45+
"name": "default",
46+
"configuration": {
47+
"separator": "/"
48+
}
49+
},
50+
"fill_value": "NaN",
51+
"codecs": [
52+
{
53+
"name": "bytes",
54+
"configuration": {
55+
"endian": "little"
56+
}
57+
}
58+
],
59+
"attributes": {
60+
},
61+
"dimension_names": [
62+
"y",
63+
"x"
64+
],
65+
"zarr_format": 3,
66+
"node_type": "array",
67+
"storage_transformers": []
68+
}
69+
}
70+
},
71+
"node_type": "group"
72+
}

0 commit comments

Comments
 (0)