-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support zonal statistics and fs-based raster db
- Loading branch information
Showing
31 changed files
with
2,224 additions
and
869 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
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
File renamed without changes.
File renamed without changes.
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 +1 @@ | ||
libgdal=3.0.2 | ||
conda-forge::gdal=3.8.5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-c requirements.txt | ||
mypy | ||
pip-tools | ||
pre-commit | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
from typing import Self | ||
|
||
from django.conf import settings | ||
from django.core.management.base import BaseCommand | ||
|
||
from snodas.management import utils | ||
from snodas.snodas.db import RasterDatabase | ||
|
||
|
||
class Command(BaseCommand): | ||
help = ( | ||
'Create the raster database for SNODAS COGs, AOI rasters, ' | ||
'and other required datasets.' | ||
) | ||
|
||
requires_system_checks = [] # type: ignore # noqa: RUF012 | ||
can_import_settings = True | ||
|
||
def add_arguments(self: Self, parser: ArgumentParser) -> None: | ||
super().add_arguments(parser) | ||
parser.add_argument( | ||
'--dem', | ||
required=True, | ||
type=utils.path_exists, | ||
help='Path to reference DEM layer', | ||
) | ||
parser.add_argument( | ||
'-F', | ||
'--force', | ||
action='store_true', | ||
default=False, | ||
help='Attempt database creation even if already exists', | ||
) | ||
|
||
def handle(self: Self, dem: Path, *_, force: bool = False, **__) -> None: | ||
RasterDatabase.create( | ||
path=settings.SNODAS_RASTERDB, | ||
input_dem_path=dem, | ||
force=force, | ||
) |
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
Oops, something went wrong.