|
11 | 11 | },
|
12 | 12 | {
|
13 | 13 | "cell_type": "code",
|
14 |
| - "execution_count": 1, |
| 14 | + "execution_count": 2, |
15 | 15 | "id": "1a61b77d",
|
16 | 16 | "metadata": {},
|
17 | 17 | "outputs": [],
|
|
38 | 38 | },
|
39 | 39 | {
|
40 | 40 | "cell_type": "code",
|
41 |
| - "execution_count": 2, |
| 41 | + "execution_count": 3, |
42 | 42 | "id": "6650dbf2",
|
43 | 43 | "metadata": {},
|
44 | 44 | "outputs": [],
|
|
67 | 67 | "collection_url = None\n",
|
68 | 68 | "\n",
|
69 | 69 | "extensions =[\n",
|
70 |
| - " f\"https://stac-extensions.github.io/projection/{PROJECTION_EXT_VERSION}/schema.json\", \n", |
| 70 | + " f\"https://stac-extensions.github.io/projection/{PROJECTION_EXT_VERSION}/schema.json\",\n", |
71 | 71 | " f\"https://stac-extensions.github.io/raster/{RASTER_EXT_VERSION}/schema.json\",\n",
|
72 | 72 | " f\"https://stac-extensions.github.io/eo/{EO_EXT_VERSION}/schema.json\",\n",
|
73 | 73 | "]"
|
74 | 74 | ]
|
75 | 75 | },
|
76 | 76 | {
|
77 | 77 | "cell_type": "code",
|
78 |
| - "execution_count": 3, |
| 78 | + "execution_count": 4, |
79 | 79 | "id": "f6c9c7c2",
|
80 | 80 | "metadata": {},
|
81 | 81 | "outputs": [
|
|
88 | 88 | " 'https://stac-extensions.github.io/eo/v1.1.0/schema.json']"
|
89 | 89 | ]
|
90 | 90 | },
|
91 |
| - "execution_count": 3, |
| 91 | + "execution_count": 4, |
92 | 92 | "metadata": {},
|
93 | 93 | "output_type": "execute_result"
|
94 | 94 | }
|
|
133 | 133 | "\n",
|
134 | 134 | " pystac_assets.append(\n",
|
135 | 135 | " (\n",
|
136 |
| - " asset[\"name\"], \n", |
| 136 | + " asset[\"name\"],\n", |
137 | 137 | " pystac.Asset(\n",
|
138 | 138 | " href=asset[\"href\"] or src_dst.name,\n",
|
139 | 139 | " media_type=media_type,\n",
|
140 | 140 | " extra_fields={\n",
|
141 | 141 | " **proj_info,\n",
|
142 |
| - " **raster_info, \n", |
| 142 | + " **raster_info,\n", |
143 | 143 | " **eo_info\n",
|
144 | 144 | " },\n",
|
145 | 145 | " roles=asset[\"role\"],\n",
|
|
149 | 149 | "\n",
|
150 | 150 | "if img_datetimes and not input_datetime:\n",
|
151 | 151 | " input_datetime = img_datetimes[0]\n",
|
152 |
| - " \n", |
153 |
| - "input_datetime = input_datetime or datetime.datetime.utcnow() \n", |
| 152 | + "\n", |
| 153 | + "input_datetime = input_datetime or datetime.datetime.utcnow()\n", |
154 | 154 | "\n",
|
155 | 155 | "minx, miny, maxx, maxy = zip(*bboxes)\n",
|
156 | 156 | "bbox = [min(minx), min(miny), max(maxx), max(maxy)]\n",
|
157 |
| - " \n", |
| 157 | + "\n", |
158 | 158 | "# item\n",
|
159 | 159 | "item = pystac.Item(\n",
|
160 | 160 | " id=id,\n",
|
|
178 | 178 | "\n",
|
179 | 179 | "for key, asset in pystac_assets:\n",
|
180 | 180 | " item.add_asset(key=key, asset=asset)\n",
|
181 |
| - " \n", |
| 181 | + "\n", |
182 | 182 | "item.validate()"
|
183 | 183 | ]
|
184 | 184 | },
|
185 | 185 | {
|
186 | 186 | "cell_type": "code",
|
187 |
| - "execution_count": 4, |
| 187 | + "execution_count": 5, |
188 | 188 | "id": "3ed579da",
|
189 | 189 | "metadata": {},
|
190 | 190 | "outputs": [
|
|
197 | 197 | " \"stac_version\": \"1.0.0\",\n",
|
198 | 198 | " \"id\": \"my_stac_item\",\n",
|
199 | 199 | " \"properties\": {\n",
|
200 |
| - " \"datetime\": \"2023-05-26T09:17:50.081457Z\"\n", |
| 200 | + " \"datetime\": \"2023-12-08T09:55:37.520499Z\"\n", |
201 | 201 | " },\n",
|
202 | 202 | " \"geometry\": {\n",
|
203 | 203 | " \"type\": \"Polygon\",\n",
|
|
213 | 213 | " ],\n",
|
214 | 214 | " [\n",
|
215 | 215 | " -10.874546803397616,\n",
|
216 |
| - " 25.30462389154227\n", |
| 216 | + " 25.304623891542274\n", |
217 | 217 | " ],\n",
|
218 | 218 | " [\n",
|
219 | 219 | " -11.979244865430262,\n",
|
220 |
| - " 25.30462389154227\n", |
| 220 | + " 25.304623891542274\n", |
221 | 221 | " ],\n",
|
222 | 222 | " [\n",
|
223 | 223 | " -11.979244865430262,\n",
|
|
396 | 396 | " \"code\": 32629\n",
|
397 | 397 | " }\n",
|
398 | 398 | " },\n",
|
| 399 | + " \"proj:wkt2\": \"PROJCS[\\\"WGS 84 / UTM zone 29N\\\",GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"latitude_of_origin\\\",0],PARAMETER[\\\"central_meridian\\\",-9],PARAMETER[\\\"scale_factor\\\",0.9996],PARAMETER[\\\"false_easting\\\",500000],PARAMETER[\\\"false_northing\\\",0],UNIT[\\\"metre\\\",1,AUTHORITY[\\\"EPSG\\\",\\\"9001\\\"]],AXIS[\\\"Easting\\\",EAST],AXIS[\\\"Northing\\\",NORTH],AUTHORITY[\\\"EPSG\\\",\\\"32629\\\"]]\",\n", |
399 | 400 | " \"raster:bands\": [\n",
|
400 | 401 | " {\n",
|
401 | 402 | " \"data_type\": \"uint16\",\n",
|
|
604 | 605 | " \"code\": 32629\n",
|
605 | 606 | " }\n",
|
606 | 607 | " },\n",
|
| 608 | + " \"proj:wkt2\": \"PROJCS[\\\"WGS 84 / UTM zone 29N\\\",GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"latitude_of_origin\\\",0],PARAMETER[\\\"central_meridian\\\",-9],PARAMETER[\\\"scale_factor\\\",0.9996],PARAMETER[\\\"false_easting\\\",500000],PARAMETER[\\\"false_northing\\\",0],UNIT[\\\"metre\\\",1,AUTHORITY[\\\"EPSG\\\",\\\"9001\\\"]],AXIS[\\\"Easting\\\",EAST],AXIS[\\\"Northing\\\",NORTH],AUTHORITY[\\\"EPSG\\\",\\\"32629\\\"]]\",\n", |
607 | 609 | " \"raster:bands\": [\n",
|
608 | 610 | " {\n",
|
609 | 611 | " \"data_type\": \"uint16\",\n",
|
|
812 | 814 | " \"code\": 32629\n",
|
813 | 815 | " }\n",
|
814 | 816 | " },\n",
|
| 817 | + " \"proj:wkt2\": \"PROJCS[\\\"WGS 84 / UTM zone 29N\\\",GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"latitude_of_origin\\\",0],PARAMETER[\\\"central_meridian\\\",-9],PARAMETER[\\\"scale_factor\\\",0.9996],PARAMETER[\\\"false_easting\\\",500000],PARAMETER[\\\"false_northing\\\",0],UNIT[\\\"metre\\\",1,AUTHORITY[\\\"EPSG\\\",\\\"9001\\\"]],AXIS[\\\"Easting\\\",EAST],AXIS[\\\"Northing\\\",NORTH],AUTHORITY[\\\"EPSG\\\",\\\"32629\\\"]]\",\n", |
815 | 818 | " \"raster:bands\": [\n",
|
816 | 819 | " {\n",
|
817 | 820 | " \"data_type\": \"uint16\",\n",
|
|
1020 | 1023 | " \"code\": 32629\n",
|
1021 | 1024 | " }\n",
|
1022 | 1025 | " },\n",
|
| 1026 | + " \"proj:wkt2\": \"PROJCS[\\\"WGS 84 / UTM zone 29N\\\",GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"latitude_of_origin\\\",0],PARAMETER[\\\"central_meridian\\\",-9],PARAMETER[\\\"scale_factor\\\",0.9996],PARAMETER[\\\"false_easting\\\",500000],PARAMETER[\\\"false_northing\\\",0],UNIT[\\\"metre\\\",1,AUTHORITY[\\\"EPSG\\\",\\\"9001\\\"]],AXIS[\\\"Easting\\\",EAST],AXIS[\\\"Northing\\\",NORTH],AUTHORITY[\\\"EPSG\\\",\\\"32629\\\"]]\",\n", |
1023 | 1027 | " \"raster:bands\": [\n",
|
1024 | 1028 | " {\n",
|
1025 | 1029 | " \"data_type\": \"uint16\",\n",
|
|
1228 | 1232 | " \"code\": 32629\n",
|
1229 | 1233 | " }\n",
|
1230 | 1234 | " },\n",
|
| 1235 | + " \"proj:wkt2\": \"PROJCS[\\\"WGS 84 / UTM zone 29N\\\",GEOGCS[\\\"WGS 84\\\",DATUM[\\\"WGS_1984\\\",SPHEROID[\\\"WGS 84\\\",6378137,298.257223563,AUTHORITY[\\\"EPSG\\\",\\\"7030\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"6326\\\"]],PRIMEM[\\\"Greenwich\\\",0,AUTHORITY[\\\"EPSG\\\",\\\"8901\\\"]],UNIT[\\\"degree\\\",0.0174532925199433,AUTHORITY[\\\"EPSG\\\",\\\"9122\\\"]],AUTHORITY[\\\"EPSG\\\",\\\"4326\\\"]],PROJECTION[\\\"Transverse_Mercator\\\"],PARAMETER[\\\"latitude_of_origin\\\",0],PARAMETER[\\\"central_meridian\\\",-9],PARAMETER[\\\"scale_factor\\\",0.9996],PARAMETER[\\\"false_easting\\\",500000],PARAMETER[\\\"false_northing\\\",0],UNIT[\\\"metre\\\",1,AUTHORITY[\\\"EPSG\\\",\\\"9001\\\"]],AXIS[\\\"Easting\\\",EAST],AXIS[\\\"Northing\\\",NORTH],AUTHORITY[\\\"EPSG\\\",\\\"32629\\\"]]\",\n", |
1231 | 1236 | " \"raster:bands\": [\n",
|
1232 | 1237 | " {\n",
|
1233 | 1238 | " \"data_type\": \"uint16\",\n",
|
|
1273 | 1278 | " -11.979244865430262,\n",
|
1274 | 1279 | " 24.296321392464336,\n",
|
1275 | 1280 | " -10.874546803397616,\n",
|
1276 |
| - " 25.30462389154227\n", |
| 1281 | + " 25.304623891542274\n", |
1277 | 1282 | " ],\n",
|
1278 | 1283 | " \"stac_extensions\": [\n",
|
1279 | 1284 | " \"https://stac-extensions.github.io/projection/v1.1.0/schema.json\",\n",
|
|
1315 | 1320 | "name": "python",
|
1316 | 1321 | "nbconvert_exporter": "python",
|
1317 | 1322 | "pygments_lexer": "ipython3",
|
1318 |
| - "version": "3.9.13" |
| 1323 | + "version": "3.9.18" |
1319 | 1324 | }
|
1320 | 1325 | },
|
1321 | 1326 | "nbformat": 4,
|
|
0 commit comments