{"id":13735323,"url":"https://github.com/stac-utils/stac-migrate","last_synced_at":"2025-06-23T17:12:25.787Z","repository":{"id":52450485,"uuid":"332839614","full_name":"stac-utils/stac-migrate","owner":"stac-utils","description":"A tool to migrate Items, Catalogs and Collections from old versions to the most recent one.","archived":false,"fork":false,"pushed_at":"2025-04-03T17:11:18.000Z","size":173,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T18:24:01.426Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stac-utils.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-25T18:13:14.000Z","updated_at":"2025-04-03T17:09:46.000Z","dependencies_parsed_at":"2024-06-19T00:26:30.108Z","dependency_job_id":"d9b6be9d-bca1-46be-839c-4ab41b190484","html_url":"https://github.com/stac-utils/stac-migrate","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"0a583c0e872353ec17a565c1c150b77cd8af3a2e"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-migrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-migrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-migrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stac-utils%2Fstac-migrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stac-utils","download_url":"https://codeload.github.com/stac-utils/stac-migrate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253059301,"owners_count":21847258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:05.561Z","updated_at":"2025-05-08T11:32:58.857Z","avatar_url":"https://github.com/stac-utils.png","language":"JavaScript","funding_links":[],"categories":["`Python` processing of optical imagery (non deep learning)"],"sub_categories":["Cloud Native Geospatial"],"readme":"# stac-migrate\n\nA library to update STAC files to the latest version (**1.1.0** at the moment of writing).\nSupports updating **STAC versions 0.6.0 and later**.\n\nVersion of this library: **2.0.2**\n\n## Usage\n\n### JavaScript / Node\n\nAdd to your project with `npm install @radiantearth/stac-migrate --save`\n\nImport the library: `const Migrate = require('@radiantearth/stac-migrate');`\n\n* Migrate (auto-detection): `Migrate.stac(stac: object, updateVersionNumber: boolean = true) =\u003e object`\u003cbr /\u003e\n  *This method does not migrate the Commons extension - use `Migrate.item` if you have used the Commons extension.*\n* Migrate a STAC Collection: `Migrate.collection(collection: object, updateVersionNumber: boolean = true) =\u003e object`\n* Migrate a STAC Catalog: `Migrate.catalog(catalog: object, updateVersionNumber: boolean = true) =\u003e object`\n* Migrate a STAC Item: `Migrate.item(item: object, collection: object = null, updateVersionNumber: boolean = true) =\u003e object`\n  \n  *The `collection` parameter is only required to migrate the Commons extension. Otherwise, you don't need to pass this paramater.*\n* Migrate a STAC CollectionCollection: `Migrate.collectionCollection(apiCollections: object, updateVersionNumber: boolean = true) =\u003e object`\n* Migrate a STAC ItemCollection: `Migrate.itemCollection(apiItems: object, updateVersionNumber: boolean = true) =\u003e object`\n\n**Note:** All changes will be applied in-place! If you don't want the input object to change, make a deep clone before. If you don't have a library which supports this (e.g. [lodash](https://lodash.com/docs/4.17.15#cloneDeep)) you can simply use `var clone = JSON.parse(JSON.stringify(object));`.\n\n### CLI\n\nYou can also use the CLI to migrate a single file.\nThe commands follow the different methods above and has the same \"restrictions\" as above.\n\n* Migrate (auto-detection, override): `npx stac-migrate \u003csource_path\u003e`\n* Migrate (auto-detection, save to a different file with 4 spaces indentation): `npx stac-migrate \u003csource_path\u003e --dest \u003cdest_path\u003e --indent 4`\n* Migrate a STAC Collection: `npx stac-migrate \u003csource_path\u003e \u003cdest_path\u003e --collection`\n* Migrate a STAC Catalog: `npx stac-migrate \u003csource_path\u003e \u003cdest_path\u003e --catalog`\n* Migrate a STAC Item: `npx stac-migrate \u003csource_path\u003e \u003cdest_path\u003e --item --collection_path \u003ccollection_path\u003e`\n* Migrate a STAC Item Collection: `npx stac-migrate \u003csource_path\u003e \u003cdest_path\u003e --item_collection`\n* Migrate a STAC Collection Collection: `npx stac-migrate \u003csource_path\u003e \u003cdest_path\u003e --collecions`\n\n## Supported Extensions\n\n* Checksum (legacy, use `Migrate.enableMultihash(require('multihashes'))` to enable conversion from pre-0.9 checksums - disabled by default to keep the bundle size low)\n* Classification 2.0.0\n* Collection Assets (legacy)\n* Commons (legacy)\n* Data Cube 2.2.0\n* Datetime Range (legacy)\n* Electro-Optical 2.0.0\n* File 2.1.0 (and 1.0.0 for `nodata`)\n* Item Asset Definition 1.0.0 (legacy)\n* Label 1.0.1\n* Point Cloud 1.0.0\n* Processing 1.2.0\n* Projection 2.0.0\n* Raster 2.0.0\n* SAR 1.0.0\n* Satellite 1.0.0\n* Scientific Citation 1.0.0\n* Single Item\n* Table 1.2.0\n* Timestamps 1.1.0\n* Versioning Indicators 1.2.0\n* View Geometry 1.0.0\n\n## Development\n\nRun the tests: `npm test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-migrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstac-utils%2Fstac-migrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstac-utils%2Fstac-migrate/lists"}