Getting Images into Google Earth Engine¶
For the simplest users getting images into GEE begins with the Image upload tool located inside GEE. Once you have added the filename you can edit additional metadata such as start time, cloud cover information if you have that from the metadata file among other things. This tool does not have a way for you to ingest any metadata automatically so it has to be fed manually.
The image name is automatically filled in with the filename that you select when uploading.
Note you cannot select more than one image and upload as a single image if they overlap each other. To handle which we have the concept of image collections. Where you can upload many images. To import images into collections, you have to either import them manually as images first and then copy them into the collection one by one or for now use an external tool to help.
For now you can use the tool I made to batch upload collections along with their metadata into Google Earth Engine. You can read about the tool, it's setup and it's operation at this Planet Story
Incase you have a Google Cloud Storage bucket you can also push images automatically to be ingested into GEE. Though this requires interaction with gsutil and starting ingestion function for each image. The GEE guide for image ingestion can be found here
Batch upload using ppipe¶
The script creates an Image Collection from GeoTIFFs in your local directory. By default, the collection name is the same as the local directory name; with optional parameter you can provide a different name. You have to process the metadata for images, which is covered in the next section along with a manifest type for Planet image and asset: For this you have to first parse the metadata
usage: ppipe upload [-h] --source SOURCE --dest DEST [-m METADATA] [-mf MANIFEST] [--large] [--nodata NODATA] [-u USER] [-s SERVICE_ACCOUNT] [-k PRIVATE_KEY] [-b BUCKET] optional arguments: -h, --help show this help message and exit Required named arguments.: --source SOURCE Path to the directory with images for upload. --dest DEST Destination. Full path for upload to Google Earth Engine, e.g. users/pinkiepie/myponycollection -m METADATA, --metadata METADATA Path to CSV with metadata. -mf MANIFEST, --manifest MANIFEST Manifest type to be used,Choose PS OrthoTile(PSO)|PS OrthoTile DN(PSO_DN)|PS OrthoTile Visual(PSO_V)|PS4Band Analytic(PS4B)|PS4Band DN(PS4B_DN)|PS4Band SR(PS4B_SR)|PS3Band Analytic(PS3B)|PS3Band DN(PS3B_DN)|PS3Band Visual(PS3B_V)|RE OrthoTile (REO)|RE OrthoTile Visual(REO_V) -u USER, --user USER Google account name (gmail address). Optional named arguments: --large (Advanced) Use multipart upload. Might help if upload of large files is failing on some systems. Might cause other issues. --nodata NODATA The value to burn into the raster as NoData (missing data) -s SERVICE_ACCOUNT, --service-account SERVICE_ACCOUNT Google Earth Engine service account. -k PRIVATE_KEY, --private-key PRIVATE_KEY Google Earth Engine private key file. -b BUCKET, --bucket BUCKET Google Cloud Storage bucket name.