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