samgis_web.web package

Submodules

samgis_web.web.exception_handlers module

samgis_web.web.gradio_helpers module

samgis_web.web.middlewares module

samgis_web.web.web_helpers module

web helper functions

samgis_web.web.web_helpers.check_source_type_is_terrain(source)[source]

Check if the given source string or TileProvider is a terrain one, see

Parameters:

source (str | TileProvider) – source string or TileProvider

Return type:

bool

Returns:

a boolean (True if is a DEM/DTM/terrain TileProvider, False otherwise)

samgis_web.web.web_helpers.get_parsed_bbox_points_with_dictlist_prompt(request_input)[source]

Parse the raw input request into bbox, prompt and zoom. If the request is a string this function use ‘model_validate_json()’ method from instance Pydantic BaseModel.

Parameters:

request_input (ApiRequestBody | str) – input dict

Return type:

Dict

Returns:

dict with bounding box, prompt and zoom

samgis_web.web.web_helpers.get_source_name(source)[source]

Return TileProvider.name string based on the output from query_name(). See examples in xyzservices.lib.py, query_name() for details.

Parameters:

source (str | TileProvider) – source string or TileProvider

Return type:

str | bool

Returns:

a string name representing the input TileProvider or source string

samgis_web.web.web_helpers.get_source_tile(source_type)[source]

Return TileProvider instance based on the name query. See examples in xyzservices.lib.py, query_name() for details.

Parameters:

source_type (str) – source name to use in query_name()

Return type:

TileProvider

Returns:

a TileProvider instance

samgis_web.web.web_helpers.get_url_tile(source_type)

Return TileProvider instance based on the name query. See examples in xyzservices.lib.py, query_name() for details.

Parameters:

source_type (str) – source name to use in query_name()

Return type:

TileProvider

Returns:

a TileProvider instance

Module contents