A GBDX task for tiling images using gdal_translate. Tiling speeds up pixel extraction from large image files as in chip-from-vrt and expedites adding overlays.
The task tiles all the images found in the input directory. Here are the steps for a sample execution of the task.
-
In an Python terminal create a GBDX interface and specify the input location:
from gbdxtools import Interface from os.path import join import uuid gbdx = Interface() input_location = 's3://gbd-customer-data/32cbab7a-4307-40c8-bb31-e2de32f940c2/platform-stories/tile-strips/'
-
Create a task instance and set the imagery input:
tiler = gbdx.Task('tile-strips') tiler.inputs.images = join(input_location, 'images')
-
Create a workflow and specify where the output will be saved:
tiler_wf = gbdx.Workflow([tiler]) tiler_wf.savedata(tiler.outputs.tiled_images, 'platform-stories/trial-runs/tiled-images')
-
Execute the workflow:
tiler_wf.execute()
Name | Type | Description | Required |
---|---|---|---|
images | Directory | Contains images to be tiled. All images with a '.tif' extension will be tiled. | True |
Name | Type | Description: |
---|---|---|
tiled_images | Directory | Contains tiled input images. |
You need to install Docker.
Clone the repository:
git clone https://github.com/platformstories/tile-strips
Then:
cd tile-strips
docker build -t yourusername/tile-strips .
Then push the image to Docker Hub:
docker push yourusername/tile-strips
The image name should be the same as the image name under containerDescriptors in tile-strips.json.
In a Python terminal:
import gbdxtools
gbdx = gbdxtools.Interface()
gbdx.task_registry.register(json_filename='tile-strips.json')