diff --git a/.example.env b/.example.env index c3fb4b62..984a692e 100644 --- a/.example.env +++ b/.example.env @@ -40,3 +40,4 @@ VEDA_CLOUDFRONT= VEDA_CLOUDFRONT_OAC=[OPTIONAL, CONFIGURES ORIGIN ACCESS CONTROL, DEFAULTS TO TRUE] VEDA_CUSTOM_HOST= VEDA_SHARED_WEB_ACL_ID=[OPTIONAL ID ARN for WEB ACL] +VEDA_DISABLE_DEFAULT_APIGW_ENDPOINT=[OPTIONAL BOOL TO DISABLE DEFAULT API GATEWAY ENDPOINTS] diff --git a/config.py b/config.py index c792b1b7..93bb6d8c 100644 --- a/config.py +++ b/config.py @@ -109,6 +109,11 @@ class vedaAppSettings(BaseSettings): None, description="Custom domain name, i.e. veda-backend.xyz" ) + disable_default_apigw_endpoint: Optional[bool] = Field( + False, + description="Boolean to disable default API gateway endpoints for stac, raster, and ingest APIs. Defaults to false.", + ) + def cdk_env(self) -> dict: """Load a cdk environment dict for stack""" diff --git a/ingest_api/infrastructure/config.py b/ingest_api/infrastructure/config.py index 31a894bb..a4ca9d37 100644 --- a/ingest_api/infrastructure/config.py +++ b/ingest_api/infrastructure/config.py @@ -88,6 +88,11 @@ class IngestorConfig(BaseSettings): description="Raster API root path. Used to infer url of raster-api before app synthesis.", ) + disable_default_apigw_endpoint: Optional[bool] = Field( + False, + description="Boolean to disable default API gateway endpoints for stac, raster, and ingest APIs. Defaults to false.", + ) + class Config: case_sensitive = False env_file = ".env" diff --git a/ingest_api/infrastructure/construct.py b/ingest_api/infrastructure/construct.py index d7dcd05f..5f298b86 100644 --- a/ingest_api/infrastructure/construct.py +++ b/ingest_api/infrastructure/construct.py @@ -91,6 +91,7 @@ def __init__( construct_id=construct_id, handler=self.api_lambda, custom_host=config.custom_host, + disable_default_apigw_endpoint=config.disable_default_apigw_endpoint, ) stack_name = Stack.of(self).stack_name @@ -188,6 +189,7 @@ def build_api( construct_id: str, handler: aws_lambda.IFunction, custom_host: Optional[str], + disable_default_apigw_endpoint: Optional[bool], ) -> aws_apigatewayv2_alpha.HttpApi: integration_kwargs = dict(handler=handler) if custom_host: @@ -211,6 +213,7 @@ def build_api( self, f"{stack_name}-{construct_id}", default_integration=ingest_api_integration, + disable_execute_api_endpoint=disable_default_apigw_endpoint, ) def build_jwks_url(self, userpool_id: str) -> str: diff --git a/raster_api/infrastructure/config.py b/raster_api/infrastructure/config.py index f3474226..f5e5a055 100644 --- a/raster_api/infrastructure/config.py +++ b/raster_api/infrastructure/config.py @@ -84,6 +84,10 @@ class vedaRasterSettings(BaseSettings): "VEDA (Visualization, Exploration, and Data Analysis)", description="Name of the STAC Catalog", ) + disable_default_apigw_endpoint: Optional[bool] = Field( + False, + description="Boolean to disable default API gateway endpoints for stac, raster, and ingest APIs. Defaults to false.", + ) class Config: """model config""" diff --git a/raster_api/infrastructure/construct.py b/raster_api/infrastructure/construct.py index b75a9f21..389e29f5 100644 --- a/raster_api/infrastructure/construct.py +++ b/raster_api/infrastructure/construct.py @@ -99,6 +99,7 @@ def __init__( self, f"{stack_name}-{construct_id}", default_integration=raster_api_integration, + disable_execute_api_endpoint=veda_raster_settings.disable_default_apigw_endpoint, ) CfnOutput( diff --git a/raster_api/runtime/src/cmap_data/README.md b/raster_api/runtime/src/cmap_data/README.md index 91c39ecc..1a489350 100644 --- a/raster_api/runtime/src/cmap_data/README.md +++ b/raster_api/runtime/src/cmap_data/README.md @@ -80,3 +80,33 @@ for c, v in internal_colormap.items(): np.save("nlcd.npy", cmap) ``` + +##### Soil texture colormap + +```python +from rio_tiler.colormap import parse_color +import numpy as np + +# These categories are based on a USGS soil texture chart, not an official set of color mappings for soil texture categories +texture_categories = { + "1": "#F89E61", + "2": "#BA8560", + "3": "#D8D2B4", + "4": "#AE734C", + "5": "#9E8478", + "6": "#C6A365", + "7": "#B4A67D", + "8": "#E1D4C4", + "9": "#BEB56D", + "10": "#777C7A", + "11": "#A89B6F", + "12": "#E9E2AF" +} + +cmap = np.zeros((256, 4), dtype=np.uint8) +cmap[:] = np.array([0, 0, 0, 255]) +for k in texture_categories.keys(): + cmap[int(k)] = np.array(parse_color(texture_categories[k])) + +np.save("soil_texture.npy", cmap) +``` \ No newline at end of file diff --git a/raster_api/runtime/src/cmap_data/soil_texture.npy b/raster_api/runtime/src/cmap_data/soil_texture.npy new file mode 100644 index 00000000..1a1a6518 Binary files /dev/null and b/raster_api/runtime/src/cmap_data/soil_texture.npy differ diff --git a/stac_api/infrastructure/config.py b/stac_api/infrastructure/config.py index 2196a430..bba00ea4 100644 --- a/stac_api/infrastructure/config.py +++ b/stac_api/infrastructure/config.py @@ -57,6 +57,10 @@ class vedaSTACSettings(BaseSettings): stac_enable_transactions: bool = Field( False, description="Whether to enable transactions endpoints" ) + disable_default_apigw_endpoint: Optional[bool] = Field( + False, + description="Boolean to disable default API gateway endpoints for stac, raster, and ingest APIs. Defaults to false.", + ) @root_validator def check_transaction_fields(cls, values): diff --git a/stac_api/infrastructure/construct.py b/stac_api/infrastructure/construct.py index c3ca56a0..10b4879b 100644 --- a/stac_api/infrastructure/construct.py +++ b/stac_api/infrastructure/construct.py @@ -106,6 +106,7 @@ def __init__( self, f"{stack_name}-{construct_id}", default_integration=stac_api_integration, + disable_execute_api_endpoint=veda_stac_settings.disable_default_apigw_endpoint, ) CfnOutput(