@radiantearth/stac-migrate 1.5.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -66
- package/migrate.js +996 -886
- package/package.json +43 -39
package/README.md
CHANGED
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
# stac-migrate
|
|
2
|
-
|
|
3
|
-
A library to update STAC files to the latest version (**1.0.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* Migrate a STAC
|
|
19
|
-
* Migrate a STAC
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* Migrate
|
|
34
|
-
* Migrate a
|
|
35
|
-
* Migrate a STAC
|
|
36
|
-
* Migrate a STAC
|
|
37
|
-
* Migrate a STAC
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
# stac-migrate
|
|
2
|
+
|
|
3
|
+
A library to update STAC files to the latest version (**1.1.0-beta.1** at the moment of writing).
|
|
4
|
+
Supports updating **STAC versions 0.6.0 and later**.
|
|
5
|
+
|
|
6
|
+
Version of this library: **2.0.0-beta.1**
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
### JavaScript / Node
|
|
11
|
+
|
|
12
|
+
Add to your project with `npm install @radiantearth/stac-migrate --save`
|
|
13
|
+
|
|
14
|
+
Import the library: `const Migrate = require('@radiantearth/stac-migrate');`
|
|
15
|
+
|
|
16
|
+
* Migrate (auto-detection): `Migrate.stac(stac: object, updateVersionNumber: boolean = true) => object`<br />
|
|
17
|
+
*This method does not migrate the Commons extension - use `Migrate.item` if you have used the Commons extension.*
|
|
18
|
+
* Migrate a STAC Collection: `Migrate.collection(collection: object, updateVersionNumber: boolean = true) => object`
|
|
19
|
+
* Migrate a STAC Catalog: `Migrate.catalog(catalog: object, updateVersionNumber: boolean = true) => object`
|
|
20
|
+
* Migrate a STAC Item: `Migrate.item(item: object, collection: object = null, updateVersionNumber: boolean = true) => object`
|
|
21
|
+
|
|
22
|
+
*The `collection` parameter is only required to migrate the Commons extension. Otherwise, you don't need to pass this paramater.*
|
|
23
|
+
* Migrate a STAC CollectionCollection: `Migrate.collectionCollection(apiCollections: object, updateVersionNumber: boolean = true) => object`
|
|
24
|
+
* Migrate a STAC ItemCollection: `Migrate.itemCollection(apiItems: object, updateVersionNumber: boolean = true) => object`
|
|
25
|
+
|
|
26
|
+
**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));`.
|
|
27
|
+
|
|
28
|
+
### CLI
|
|
29
|
+
|
|
30
|
+
You can also use the CLI to migrate a single file.
|
|
31
|
+
The commands follow the different methods above and has the same "restrictions" as above.
|
|
32
|
+
|
|
33
|
+
* Migrate (auto-detection, override): `npx stac-migrate <source_path>`
|
|
34
|
+
* Migrate (auto-detection, save to a different file with 4 spaces indentation): `npx stac-migrate <source_path> --dest <dest_path> --indent 4`
|
|
35
|
+
* Migrate a STAC Collection: `npx stac-migrate <source_path> <dest_path> --collection`
|
|
36
|
+
* Migrate a STAC Catalog: `npx stac-migrate <source_path> <dest_path> --catalog`
|
|
37
|
+
* Migrate a STAC Item: `npx stac-migrate <source_path> <dest_path> --item --collection_path <collection_path>`
|
|
38
|
+
* Migrate a STAC Item Collection: `npx stac-migrate <source_path> <dest_path> --item_collection`
|
|
39
|
+
* Migrate a STAC Collection Collection: `npx stac-migrate <source_path> <dest_path> --collecions`
|
|
40
|
+
|
|
41
|
+
## Supported Extensions
|
|
42
|
+
|
|
43
|
+
* Checksum (legacy, use `Migrate.enableMultihash(require('multihashes'))` to enable conversion from pre-0.9 checksums - disabled by default to keep the bundle size low)
|
|
44
|
+
* Classification 2.0.0
|
|
45
|
+
* Collection Assets (legacy)
|
|
46
|
+
* Commons (legacy)
|
|
47
|
+
* Data Cube 2.2.0
|
|
48
|
+
* Datetime Range (legacy)
|
|
49
|
+
* Electro-Optical 2.0.0-beta.1
|
|
50
|
+
* File 2.1.0 (and 1.0.0 for `nodata`)
|
|
51
|
+
* Item Asset Definition 1.0.0 (legacy)
|
|
52
|
+
* Label 1.0.1
|
|
53
|
+
* Point Cloud 1.0.0
|
|
54
|
+
* Processing 1.2.0
|
|
55
|
+
* Projection 2.0.0
|
|
56
|
+
* Raster 2.0.0-beta.1
|
|
57
|
+
* SAR 1.0.0
|
|
58
|
+
* Satellite 1.0.0
|
|
59
|
+
* Scientific Citation 1.0.0
|
|
60
|
+
* Single Item
|
|
61
|
+
* Table 1.2.0
|
|
62
|
+
* Timestamps 1.1.0
|
|
63
|
+
* Versioning Indicators 1.2.0
|
|
64
|
+
* View Geometry 1.0.0
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
Run the tests: `npm test`
|