Skip to content

Commit

Permalink
add geopackages to process_in_place script
Browse files Browse the repository at this point in the history
  • Loading branch information
sclaw committed Nov 22, 2024
1 parent 0048bb7 commit ac911fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions external_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from botocore.exceptions import ClientError

from ras_stac.ras1d.converter import append_geopackage
from ras_stac.ras1d.converter import append_geopackage, process_in_place_s3
from ras_stac.ras1d.utils.s3_utils import str_from_s3

warnings.filterwarnings("ignore")
Expand All @@ -24,8 +24,8 @@ def owp_wrapper(in_prefix: str, out_prefix: str) -> dict:
crs = crs_dict["best_crs"]
except ClientError:
crs = None
# return process_in_place_s3(in_prefix, crs, out_prefix)
return append_geopackage(in_prefix, crs, out_prefix)
return process_in_place_s3(in_prefix, crs, out_prefix)
# return append_geopackage(in_prefix, crs, out_prefix)


def main():
Expand Down
6 changes: 6 additions & 0 deletions ras_stac/ras1d/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,15 @@ def process_in_place_s3(in_prefix: str, crs: str, out_prefix: str):
logging.info("Discovering model contents")
converter = from_directory(in_prefix, crs)
converter.check_for_mip()

thumb_path = out_prefix + "Thumbnail.png"
logging.info(f"Generating thumbnail at {thumb_path}")
converter.export_thumbnail(thumb_path)

gpkg_path = out_prefix + f"{converter.idx}.gpkg"
logging.info(f"Generating geopackage at {gpkg_path}")
converter.export_gpkg(gpkg_path)

stac_path = out_prefix + f"{converter.idx}.json"
logging.info(f"Generating STAC item at {stac_path}")
converter.export_stac(stac_path)
Expand Down

0 comments on commit ac911fc

Please sign in to comment.