-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from eea/develop
Release of CLMS STAC generator v0.1.0
- Loading branch information
Showing
39 changed files
with
2,070 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,6 @@ target/ | |
|
||
# Pycopy | ||
__pycache__/ | ||
|
||
# macOS | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import logging | ||
|
||
from scripts.clc.collection import create_collection, populate_collection | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
logging.basicConfig(filename="create_clc_collection.log") | ||
collection = create_collection() | ||
populate_collection(collection, data_root="../CLC_100m") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import logging | ||
|
||
from scripts.euhydro.collection import create_euhydro_collection | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
if __name__ == "__main__": | ||
logging.basicConfig(filename="create_euhydro_collection.log") | ||
create_euhydro_collection("<euhydro-root>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import logging | ||
|
||
from scripts.n2k.collection import create_n2k_collection | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
if __name__ == "__main__": | ||
logging.basicConfig(filename="create_n2k_collection.log") | ||
create_n2k_collection("<path-to-n2k-root-directory>") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import logging | ||
from glob import glob | ||
|
||
from scripts.uabh.collection import create_uabh_collection, get_stac_validator | ||
from scripts.uabh.constants import COLLECTION_ID, STAC_DIR, WORKING_DIR | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
logging.basicConfig(filename="create_uabh_collection.log") | ||
item_list = glob(f"{WORKING_DIR}/{STAC_DIR}/{COLLECTION_ID}/**/*.json") | ||
validator = get_stac_validator("schema/products/uabh.json") | ||
create_uabh_collection(item_list, validator) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import logging | ||
from glob import glob | ||
|
||
from scripts.uabh.item import create_uabh_item, get_stac_validator | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
logging.basicConfig(filename="create_uabh_items.log") | ||
validator = get_stac_validator("schema/products/uabh.json") | ||
zip_list = glob("/Users/chung-xianghong/Downloads/uabh_samples/**/*.zip") | ||
for zip_file in zip_list: | ||
create_uabh_item(zip_file, validator) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import logging | ||
from glob import glob | ||
|
||
from scripts.vpp.collection import create_vpp_collection, get_stac_validator | ||
from scripts.vpp.constants import COLLECTION_ID, STAC_DIR, WORKING_DIR | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
logging.basicConfig(filename="create_vpp_collection.log") | ||
item_list = glob(f"{WORKING_DIR}/{STAC_DIR}/{COLLECTION_ID}/**/*.json") | ||
validator = get_stac_validator("schema/products/vpp.json") | ||
create_vpp_collection(item_list, validator) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import itertools as it | ||
import logging | ||
from concurrent.futures import ThreadPoolExecutor | ||
|
||
from tqdm import tqdm | ||
|
||
from scripts.vpp.constants import AWS_SESSION, BUCKET | ||
from scripts.vpp.item import create_page_iterator, create_product_list, create_vpp_item, get_stac_validator | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def main(): | ||
logging.basicConfig(filename="create_vpp_items.log") | ||
validator = get_stac_validator("schema/products/vpp.json") | ||
product_list = create_product_list(2017, 2023) | ||
|
||
for product in product_list: | ||
page_iterator = create_page_iterator(AWS_SESSION, BUCKET, product) | ||
for page in page_iterator: | ||
tiles = [prefix["Prefix"] for prefix in page["CommonPrefixes"]] | ||
with ThreadPoolExecutor(max_workers=100) as executor: | ||
list( | ||
tqdm( | ||
executor.map( | ||
create_vpp_item, it.repeat(AWS_SESSION), it.repeat(BUCKET), it.repeat(validator), tiles | ||
), | ||
total=len(tiles), | ||
) | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#Libraries that your project use | ||
boto3 | ||
pyproj | ||
pystac | ||
pystac[validation] | ||
rasterio | ||
shapely |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Oops, something went wrong.