Skip to content

Commit 3936141

Browse files
add more tests and reduce code duplication (#806)
* add more tests and reduce code duplication * fix item * fix item in titiler.application
1 parent 979b23d commit 3936141

File tree

5 files changed

+225
-199
lines changed

5 files changed

+225
-199
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### titiler.core
66

77
* fix `TerrainRGB` algorithm name (author @JinIgarashi, https://github.com/developmentseed/titiler/pull/804)
8+
* add more tests for `RescalingParams` and `HistogramParams` dependencies
89

910
## 0.18.0 (2024-03-22)
1011

Lines changed: 23 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
{
22
"type": "Feature",
3-
"stac_version": "1.0.0-beta.1",
4-
"stac_extensions": [
5-
"eo",
6-
"view",
7-
"proj"
8-
],
3+
"stac_version": "1.0.0",
94
"id": "S2A_34SGA_20200318_0_L2A",
10-
"bbox": [
11-
23.293255090449595,
12-
31.505183020453355,
13-
24.296453548295318,
14-
32.51147809805106
15-
],
5+
"properties": {
6+
"datetime": "2020-03-18T09:11:33Z"
7+
},
168
"geometry": {
179
"type": "Polygon",
1810
"coordinates": [
@@ -40,91 +32,31 @@
4032
]
4133
]
4234
},
43-
"properties": {
44-
"datetime": "2020-03-18T09:11:33Z",
45-
"platform": "sentinel-2a",
46-
"constellation": "sentinel-2",
47-
"instruments": [
48-
"msi"
49-
],
50-
"gsd": 10,
51-
"data_coverage": 73.85,
52-
"view:off_nadir": 0,
53-
"eo:cloud_cover": 89.84,
54-
"proj:epsg": 32634,
55-
"sentinel:latitude_band": "S",
56-
"sentinel:grid_square": "GA",
57-
"sentinel:sequence": "0",
58-
"sentinel:product_id": "S2A_MSIL2A_20200318T085701_N0214_R007_T34SGA_20200318T115254",
59-
"created": "2020-05-12T21:03:26.671Z",
60-
"updated": "2020-05-12T21:03:26.671Z"
61-
},
62-
"collection": "sentinel-s2-l2a-cogs",
35+
"links": [
36+
{
37+
"rel": "self",
38+
"href": "https://myurl.com/item.json",
39+
"type": "application/json"
40+
}
41+
],
6342
"assets": {
6443
"B01": {
65-
"title": "Band 1 (coastal)",
66-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
6744
"href": "https://myurl.com/B01.tif",
68-
"proj:shape": [
69-
1830,
70-
1830
71-
],
72-
"proj:transform": [
73-
60,
74-
0,
75-
699960,
76-
0,
77-
-60,
78-
3600000,
79-
0,
80-
0,
81-
1
82-
]
45+
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
46+
"title": "Band 1 (coastal)"
8347
},
8448
"B09": {
85-
"title": "Band 9",
86-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
8749
"href": "https://myurl.com/B09.tif",
88-
"proj:shape": [
89-
1830,
90-
1830
91-
],
92-
"proj:transform": [
93-
60,
94-
0,
95-
699960,
96-
0,
97-
-60,
98-
3600000,
99-
0,
100-
0,
101-
1
102-
]
50+
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
51+
"title": "Band 9"
10352
}
10453
},
105-
"links": [
106-
{
107-
"rel": "self",
108-
"href": "s3://sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_34SGA_20200318_0_L2A/S2A_34SGA_20200318_0_L2A.json",
109-
"type": "application/json"
110-
},
111-
{
112-
"rel": "parent",
113-
"href": "https://myurl.com/v0/collections/sentinel-s2-l2a"
114-
},
115-
{
116-
"rel": "collection",
117-
"href": "https://myurl.com/v0/collections/sentinel-s2-l2a"
118-
},
119-
{
120-
"rel": "root",
121-
"href": "https://myurl.com/v0/"
122-
},
123-
{
124-
"title": "Source STAC Item",
125-
"rel": "derived_from",
126-
"href": "https://myurl.com/collections/sentinel-s2-l2a/items/S2A_34SGA_20200318_0_L2A",
127-
"type": "application/json"
128-
}
129-
]
54+
"bbox": [
55+
23.293255090449595,
56+
31.505183020453355,
57+
24.296453548295318,
58+
32.51147809805106
59+
],
60+
"stac_extensions": [],
61+
"collection": "sentinel-s2-l2a-cogs"
13062
}
Lines changed: 23 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
{
22
"type": "Feature",
3-
"stac_version": "1.0.0-beta.1",
4-
"stac_extensions": [
5-
"eo",
6-
"view",
7-
"proj"
8-
],
3+
"stac_version": "1.0.0",
94
"id": "S2A_34SGA_20200318_0_L2A",
10-
"bbox": [
11-
23.293255090449595,
12-
31.505183020453355,
13-
24.296453548295318,
14-
32.51147809805106
15-
],
5+
"properties": {
6+
"datetime": "2020-03-18T09:11:33Z"
7+
},
168
"geometry": {
179
"type": "Polygon",
1810
"coordinates": [
@@ -40,91 +32,31 @@
4032
]
4133
]
4234
},
43-
"properties": {
44-
"datetime": "2020-03-18T09:11:33Z",
45-
"platform": "sentinel-2a",
46-
"constellation": "sentinel-2",
47-
"instruments": [
48-
"msi"
49-
],
50-
"gsd": 10,
51-
"data_coverage": 73.85,
52-
"view:off_nadir": 0,
53-
"eo:cloud_cover": 89.84,
54-
"proj:epsg": 32634,
55-
"sentinel:latitude_band": "S",
56-
"sentinel:grid_square": "GA",
57-
"sentinel:sequence": "0",
58-
"sentinel:product_id": "S2A_MSIL2A_20200318T085701_N0214_R007_T34SGA_20200318T115254",
59-
"created": "2020-05-12T21:03:26.671Z",
60-
"updated": "2020-05-12T21:03:26.671Z"
61-
},
62-
"collection": "sentinel-s2-l2a-cogs",
35+
"links": [
36+
{
37+
"rel": "self",
38+
"href": "https://myurl.com/item.json",
39+
"type": "application/json"
40+
}
41+
],
6342
"assets": {
6443
"B01": {
65-
"title": "Band 1 (coastal)",
66-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
6744
"href": "https://myurl.com/B01.tif",
68-
"proj:shape": [
69-
1830,
70-
1830
71-
],
72-
"proj:transform": [
73-
60,
74-
0,
75-
699960,
76-
0,
77-
-60,
78-
3600000,
79-
0,
80-
0,
81-
1
82-
]
45+
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
46+
"title": "Band 1 (coastal)"
8347
},
8448
"B09": {
85-
"title": "Band 9",
86-
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
8749
"href": "https://myurl.com/B09.tif",
88-
"proj:shape": [
89-
1830,
90-
1830
91-
],
92-
"proj:transform": [
93-
60,
94-
0,
95-
699960,
96-
0,
97-
-60,
98-
3600000,
99-
0,
100-
0,
101-
1
102-
]
50+
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
51+
"title": "Band 9"
10352
}
10453
},
105-
"links": [
106-
{
107-
"rel": "self",
108-
"href": "s3://sentinel-cogs/sentinel-s2-l2a-cogs/2020/S2A_34SGA_20200318_0_L2A/S2A_34SGA_20200318_0_L2A.json",
109-
"type": "application/json"
110-
},
111-
{
112-
"rel": "parent",
113-
"href": "https://myurl.com/v0/collections/sentinel-s2-l2a"
114-
},
115-
{
116-
"rel": "collection",
117-
"href": "https://myurl.com/v0/collections/sentinel-s2-l2a"
118-
},
119-
{
120-
"rel": "root",
121-
"href": "https://myurl.com/v0/"
122-
},
123-
{
124-
"title": "Source STAC Item",
125-
"rel": "derived_from",
126-
"href": "https://myurl.com/collections/sentinel-s2-l2a/items/S2A_34SGA_20200318_0_L2A",
127-
"type": "application/json"
128-
}
129-
]
54+
"bbox": [
55+
23.293255090449595,
56+
31.505183020453355,
57+
24.296453548295318,
58+
32.51147809805106
59+
],
60+
"stac_extensions": [],
61+
"collection": "sentinel-s2-l2a-cogs"
13062
}

0 commit comments

Comments
 (0)