Skip to content

Commit

Permalink
Un-launch ee.data.startExternalImageIngestion and external_image.
Browse files Browse the repository at this point in the history
We'd like to add some documentation before making this new functionality public.

PiperOrigin-RevId: 691962779
  • Loading branch information
Nate Schmitz authored and Google Earth Engine Authors committed Oct 31, 2024
1 parent bcddfda commit 007fcf0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
15 changes: 0 additions & 15 deletions python/ee/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1448,20 +1448,6 @@ def is_tf_record(path: str) -> bool:
return manifest


class UploadExternalImageCommand(UploadImageCommand):
name = 'external_image'

@_using_v1alpha
def run(
self, args: argparse.Namespace, config: utils.CommandLineConfig
) -> None:
"""Creates an external image synchronously."""
config.ee_init()
manifest = self.manifest_from_args(args)
name = ee.data.startExternalImageIngestion(manifest, args.force)['name']
print('Created asset %s' % name)


# TODO(user): update src_files help string when secondary files
# can be uploaded.
class UploadTableCommand:
Expand Down Expand Up @@ -1651,7 +1637,6 @@ class UploadCommand(Dispatcher):

COMMANDS = [
UploadImageCommand,
UploadExternalImageCommand,
UploadTableCommand,
]

Expand Down
37 changes: 0 additions & 37 deletions python/ee/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,6 @@ def _prepare_and_run_export(

# TODO(user): use StrEnum when 3.11 is the min version
_INTERNAL_IMPORT = 'INTERNAL_IMPORT'
_EXTERNAL_IMPORT = 'EXTERNAL_IMPORT'


def _startIngestion(
Expand All @@ -1934,10 +1933,6 @@ def _startIngestion(
image = _get_cloud_projects().image()
if import_mode == _INTERNAL_IMPORT:
import_request = image.import_(project=_get_projects_path(), body=request)
elif import_mode == _EXTERNAL_IMPORT:
import_request = image.importExternal(
project=_get_projects_path(), body=request
)
else:
raise ee_exception.EEException(
'{} is not a valid import mode'.format(import_mode)
Expand Down Expand Up @@ -1998,38 +1993,6 @@ def startIngestion(
return _startIngestion(request_id, params, allow_overwrite, _INTERNAL_IMPORT)


def startExternalImageIngestion(
image_manifest: Dict[str, Any],
allow_overwrite: bool = False,
) -> Dict[str, Any]:
"""Creates an external image.
Args:
image_manifest: The object that describes the import task, which can
have these fields:
name (string) The destination asset id (e.g.,
"projects/myproject/assets/foo/bar").
tilesets (array) A list of Google Cloud Storage source file paths
formatted like:
[{'sources': [
{'uris': ['foo.tif', 'foo.prj']},
{'uris': ['bar.tif', 'bar.prj']},
]}]
Where path values correspond to source files' Google Cloud Storage
object names, e.g., 'gs://bucketname/filename.tif'
bands (array) An optional list of band names formatted like:
[{'id': 'R'}, {'id': 'G'}, {'id': 'B'}]
In general, this is a dict representation of an ImageManifest.
allow_overwrite: Whether the ingested image can overwrite an
existing version.
Returns:
The name of the created asset.
"""
return _startIngestion(
'unused', image_manifest, allow_overwrite, _EXTERNAL_IMPORT)


def startTableIngestion(
request_id: str, params: Dict[str, Any], allow_overwrite: bool = False
) -> Dict[str, Any]:
Expand Down

0 comments on commit 007fcf0

Please sign in to comment.