MCPcopy
hub / github.com/google/earthengine-api / _build_tile_options

Function _build_tile_options

python/ee/batch.py:1713–1753  ·  view source on GitHub ↗

Builds a TileOptions from values in a config dict. Args: config: All the user-specified export parameters. Will be modified in-place by removing parameters used in the TileOptions. Returns: A TileOptions containing information extracted from config.

(config: dict[str, Any])

Source from the content-addressed store, hash-verified

1711
1712
1713def _build_tile_options(config: dict[str, Any]) -> dict[str, Any]:
1714 """Builds a TileOptions from values in a config dict.
1715
1716 Args:
1717 config: All the user-specified export parameters. Will be modified in-place
1718 by removing parameters used in the TileOptions.
1719
1720 Returns:
1721 A TileOptions containing information extracted from config.
1722 """
1723 tile_options = {}
1724
1725 if 'maxZoom' in config:
1726 if 'scale' in config:
1727 raise ee_exception.EEException('Both maxZoom and scale are specified.')
1728 tile_options['endZoom'] = config.pop('maxZoom')
1729
1730 if 'endZoom' in config:
1731 if 'scale' in config:
1732 raise ee_exception.EEException('Both endZoom and scale are specified.')
1733 tile_options['endZoom'] = config.pop('endZoom')
1734
1735 if 'scale' in config:
1736 tile_options['scale'] = config.pop('scale')
1737
1738 if 'minZoom' in config:
1739 tile_options['startZoom'] = config.pop('minZoom')
1740
1741 if 'startZoom' in config:
1742 tile_options['startZoom'] = config.pop('startZoom')
1743
1744 if config.pop('skipEmptyTiles', False):
1745 tile_options['skipEmpty'] = True
1746
1747 if 'skipEmpty' in config:
1748 tile_options['skipEmpty'] = config.pop('skipEmpty')
1749
1750 if 'mapsApiKey' in config:
1751 tile_options['mapsApiKey'] = config.pop('mapsApiKey')
1752
1753 return tile_options
1754
1755
1756def _build_earth_engine_destination(config: dict[str, Any]) -> dict[str, Any]:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected