stac-validator 3.9.1__tar.gz → 3.9.3__tar.gz
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.
- {stac_validator-3.9.1 → stac_validator-3.9.3}/PKG-INFO +2 -2
- {stac_validator-3.9.1 → stac_validator-3.9.3}/README.md +1 -1
- {stac_validator-3.9.1 → stac_validator-3.9.3}/setup.py +1 -1
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator/validate.py +38 -6
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/PKG-INFO +2 -2
- {stac_validator-3.9.1 → stac_validator-3.9.3}/LICENSE +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/pyproject.toml +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/setup.cfg +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator/__init__.py +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator/stac_validator.py +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator/utilities.py +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/SOURCES.txt +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/dependency_links.txt +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/entry_points.txt +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/requires.txt +0 -0
- {stac_validator-3.9.1 → stac_validator-3.9.3}/stac_validator.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac_validator
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.3
|
|
4
4
|
Summary: A package to validate STAC files
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-validator
|
|
6
6
|
Author: James Banting, Jonathan Healy
|
|
@@ -26,7 +26,7 @@ License-File: LICENSE
|
|
|
26
26
|
<img src="https://raw.githubusercontent.com/stac-utils/stac-validator/main/assets/stac-validator.png" width=560>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
|
-
[](https://pepy.tech/projects/stac-validator)
|
|
30
30
|
[](https://github.com/stac-utils/stac-validator/graphs/contributors)
|
|
31
31
|
[](https://github.com/stac-utils/stac-validator/stargazers)
|
|
32
32
|
[](https://github.com/stac-utils/stac-validator/network/members)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<img src="https://raw.githubusercontent.com/stac-utils/stac-validator/main/assets/stac-validator.png" width=560>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
[](https://pepy.tech/projects/stac-validator)
|
|
10
10
|
[](https://github.com/stac-utils/stac-validator/graphs/contributors)
|
|
11
11
|
[](https://github.com/stac-utils/stac-validator/stargazers)
|
|
12
12
|
[](https://github.com/stac-utils/stac-validator/network/members)
|
|
@@ -618,12 +618,32 @@ class StacValidate:
|
|
|
618
618
|
if link["rel"] in ("child", "item"):
|
|
619
619
|
address = link["href"]
|
|
620
620
|
if not is_valid_url(address):
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
621
|
+
if is_valid_url(str(base_url)):
|
|
622
|
+
# If base is a URL, handle URL joining
|
|
623
|
+
from urllib.parse import urljoin
|
|
624
|
+
|
|
625
|
+
self.stac_file = urljoin(
|
|
626
|
+
(
|
|
627
|
+
str(base_url) + "/"
|
|
628
|
+
if not str(base_url).endswith("/")
|
|
629
|
+
else str(base_url)
|
|
630
|
+
),
|
|
631
|
+
address,
|
|
632
|
+
)
|
|
633
|
+
else:
|
|
634
|
+
# Handle local file paths
|
|
635
|
+
current_dir = os.path.dirname(
|
|
636
|
+
os.path.abspath(str(base_url))
|
|
637
|
+
)
|
|
638
|
+
self.stac_file = os.path.normpath(
|
|
639
|
+
os.path.join(current_dir, address)
|
|
640
|
+
)
|
|
641
|
+
# Convert to relative path for cleaner output if it's under the current working directory
|
|
642
|
+
try:
|
|
643
|
+
self.stac_file = os.path.relpath(self.stac_file)
|
|
644
|
+
except ValueError:
|
|
645
|
+
# If paths are on different drives (Windows) or other relpath issues, use the absolute path
|
|
646
|
+
pass
|
|
627
647
|
else:
|
|
628
648
|
self.stac_file = address
|
|
629
649
|
|
|
@@ -681,10 +701,22 @@ class StacValidate:
|
|
|
681
701
|
Args:
|
|
682
702
|
item_collection (dict): The dictionary representation of the item collection.
|
|
683
703
|
"""
|
|
704
|
+
# Store the original stac_file to restore it later
|
|
705
|
+
original_stac_file = self.stac_file
|
|
706
|
+
|
|
684
707
|
for item in item_collection["features"]:
|
|
708
|
+
# Update the path to include the item ID for better traceability
|
|
709
|
+
if isinstance(original_stac_file, str) and "id" in item:
|
|
710
|
+
# Remove any query string from the URL before appending the item ID
|
|
711
|
+
base_url = original_stac_file.split("?")[0]
|
|
712
|
+
self.stac_file = f"{base_url}/{item['id']}"
|
|
713
|
+
|
|
685
714
|
self.schema = ""
|
|
686
715
|
self.validate_dict(item)
|
|
687
716
|
|
|
717
|
+
# Restore the original stac_file
|
|
718
|
+
self.stac_file = original_stac_file
|
|
719
|
+
|
|
688
720
|
def validate_collections(self) -> None:
|
|
689
721
|
"""
|
|
690
722
|
Validate STAC Collections from a /collections endpoint.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac-validator
|
|
3
|
-
Version: 3.9.
|
|
3
|
+
Version: 3.9.3
|
|
4
4
|
Summary: A package to validate STAC files
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-validator
|
|
6
6
|
Author: James Banting, Jonathan Healy
|
|
@@ -26,7 +26,7 @@ License-File: LICENSE
|
|
|
26
26
|
<img src="https://raw.githubusercontent.com/stac-utils/stac-validator/main/assets/stac-validator.png" width=560>
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
|
-
[](https://pepy.tech/projects/stac-validator)
|
|
30
30
|
[](https://github.com/stac-utils/stac-validator/graphs/contributors)
|
|
31
31
|
[](https://github.com/stac-utils/stac-validator/stargazers)
|
|
32
32
|
[](https://github.com/stac-utils/stac-validator/network/members)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|