File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 24
24
SummariesExtension ,
25
25
)
26
26
from pystac .extensions .hooks import ExtensionHooks
27
- from pystac .extensions import view
27
+ from pystac .extensions import view , projection
28
28
from pystac .serialization .identify import STACJSONDescription , STACVersionID
29
29
from pystac .utils import get_required , map_opt
30
30
@@ -557,6 +557,22 @@ def migrate(
557
557
]
558
558
del obj ["properties" ]["eo:{}" .format (field )]
559
559
560
+ # eo:epsg became proj:epsg
561
+ eo_epsg = PREFIX + "epsg"
562
+ proj_epsg = projection .PREFIX + "epsg"
563
+ if eo_epsg in obj ["properties" ] and proj_epsg not in obj ["properties" ]:
564
+ obj ["properties" ][proj_epsg ] = obj ["properties" ].pop (eo_epsg )
565
+ obj ["stac_extensions" ] = obj .get ("stac_extensions" , [])
566
+ if (
567
+ projection .ProjectionExtension .get_schema_uri ()
568
+ not in obj ["stac_extensions" ]
569
+ ):
570
+ obj ["stac_extensions" ].append (
571
+ projection .ProjectionExtension .get_schema_uri ()
572
+ )
573
+ if not any (prop .startswith (PREFIX ) for prop in obj ["properties" ]):
574
+ obj ["stac_extensions" ].remove (EOExtension .get_schema_uri ())
575
+
560
576
if version < "1.0.0-beta.1" and info .object_type == pystac .STACObjectType .ITEM :
561
577
# gsd moved from eo to common metadata
562
578
if "eo:gsd" in obj ["properties" ]:
You can’t perform that action at this time.
0 commit comments