@@ -185,103 +185,12 @@ def _identify_stac_extensions(
185
185
186
186
# checksum
187
187
if "links" in d :
188
- found_checksum = False
189
188
for link in d ["links" ]:
190
189
link_props = cast (Dict [str , Any ], link ).keys ()
191
190
192
191
if any (prop .startswith ("checksum:" ) for prop in link_props ):
193
- found_checksum = True
194
192
stac_extensions .add (OldExtensionShortIDs .CHECKSUM .value )
195
- if not found_checksum :
196
- if "assets" in d :
197
- for asset in d ["assets" ].values ():
198
- asset_props = cast (Dict [str , Any ], asset ).keys ()
199
- if any (prop .startswith ("checksum:" ) for prop in asset_props ):
200
- found_checksum = True
201
- stac_extensions .add (OldExtensionShortIDs .CHECKSUM .value )
202
- if found_checksum :
203
- version_range .set_min (STACVersionID ("0.6.2" ))
204
-
205
- # datacube
206
- if object_type == pystac .STACObjectType .ITEM :
207
- if any (k .startswith ("cube:" ) for k in cast (Dict [str , Any ], d ["properties" ])):
208
- stac_extensions .add (OldExtensionShortIDs .DATACUBE .value )
209
- version_range .set_min (STACVersionID ("0.6.1" ))
210
-
211
- # datetime-range (old extension)
212
- if object_type == pystac .STACObjectType .ITEM :
213
- if "dtr:start_datetime" in d ["properties" ]:
214
- stac_extensions .add ("datetime-range" )
215
- version_range .set_min (STACVersionID ("0.6.0" ))
216
-
217
- # eo
218
- if object_type == pystac .STACObjectType .ITEM :
219
- if any (k .startswith ("eo:" ) for k in cast (Dict [str , Any ], d ["properties" ])):
220
- stac_extensions .add (OldExtensionShortIDs .EO .value )
221
- if "eo:epsg" in d ["properties" ]:
222
- if d ["properties" ]["eo:epsg" ] is None :
223
- version_range .set_min (STACVersionID ("0.6.1" ))
224
- if "eo:crs" in d ["properties" ]:
225
- version_range .set_max (STACVersionID ("0.4.1" ))
226
- if "eo:constellation" in d ["properties" ]:
227
- version_range .set_min (STACVersionID ("0.6.0" ))
228
- if "eo:bands" in d :
229
- stac_extensions .add (OldExtensionShortIDs .EO .value )
230
- version_range .set_max (STACVersionID ("0.5.2" ))
231
-
232
- # pointcloud
233
- if object_type == pystac .STACObjectType .ITEM :
234
- if any (k .startswith ("pc:" ) for k in cast (Dict [str , Any ], d ["properties" ])):
235
- stac_extensions .add (OldExtensionShortIDs .POINTCLOUD .value )
236
- version_range .set_min (STACVersionID ("0.6.2" ))
237
-
238
- # sar
239
- if object_type == pystac .STACObjectType .ITEM :
240
- if any (k .startswith ("sar:" ) for k in cast (Dict [str , Any ], d ["properties" ])):
241
- stac_extensions .add (OldExtensionShortIDs .SAR .value )
242
- version_range .set_min (STACVersionID ("0.6.2" ))
243
- if version_range .contains ("0.6.2" ):
244
- for prop in [
245
- "sar:absolute_orbit" ,
246
- "sar:resolution" ,
247
- "sar:pixel_spacing" ,
248
- "sar:looks" ,
249
- ]:
250
- if prop in d ["properties" ]:
251
- if isinstance (d ["properties" ][prop ], list ):
252
- version_range .set_max (STACVersionID ("0.6.2" ))
253
- if version_range .contains ("0.7.0" ):
254
- for prop in [
255
- "sar:incidence_angle" ,
256
- "sar:relative_orbit" ,
257
- "sar:observation_direction" ,
258
- "sar:resolution_range" ,
259
- "sar:resolution_azimuth" ,
260
- "sar:pixel_spacing_range" ,
261
- "sar:pixel_spacing_azimuth" ,
262
- "sar:looks_range" ,
263
- "sar:looks_azimuth" ,
264
- "sar:looks_equivalent_number" ,
265
- ]:
266
- if prop in d ["properties" ]:
267
- version_range .set_min (STACVersionID ("0.7.0" ))
268
- if "sar:absolute_orbit" in d ["properties" ] and not isinstance (
269
- d ["properties" ]["sar:absolute_orbit" ], list
270
- ):
271
- version_range .set_min (STACVersionID ("0.7.0" ))
272
- if "sar:off_nadir" in d ["properties" ]:
273
- version_range .set_max (STACVersionID ("0.6.2" ))
274
-
275
- # scientific
276
- if (
277
- object_type == pystac .STACObjectType .ITEM
278
- or object_type == pystac .STACObjectType .COLLECTION
279
- ):
280
- if "properties" in d :
281
- prop_keys = cast (Dict [str , Any ], d ["properties" ]).keys ()
282
- if any (k .startswith ("sci:" ) for k in prop_keys ):
283
- stac_extensions .add (OldExtensionShortIDs .SCIENTIFIC .value )
284
- version_range .set_min (STACVersionID ("0.6.0" ))
193
+ version_range .set_min (STACVersionID ("0.6.2" ))
285
194
286
195
# Single File STAC
287
196
if object_type == pystac .STACObjectType .ITEMCOLLECTION :
0 commit comments