Importing Geotiff with Overlay

Hello,

I am quite new to Labelbox and look forward to learning more about the platform.

My aim is to upload two satellite images and overlay them.

I have read that you cannot overlay two COG geotiff files together.

I am able to easily upload a single COG geotiff via Python. The file is store on Google Cloud.

When I upload a COG geotiff with the corresponding other satellite image as a PNG, the upload is successful. However, when I check the catalog, I get an error saying “cannot parse tiled data”. In annotate mode, the geotiff cannot be processed.

How should I resolve this issue in file uploading?

Thank you

Hey @aditya.kapur ,

Would you have a sample of the payload you are using to import your data (no need for the link just the structure and the attributes).

thanks!

Hello,

Thank you for the quick response @ptancre!

Here is a simple look at the Python script I am employing for the task.

Thank you for your help in advance!


API_KEY = 
client = Client(api_key=API_KEY)

dataset_name = 
dataset = client.create_dataset(name=dataset_name)

print(f"Dataset '{dataset_name}' created with ID: {dataset.uid}")

geotiff_url = 
overlay_url = 

assets = [
    {
        "row_data": geotiff_url, 
        "global_key": "geotiff-001",  
        "media_type": "TMS_GEO",
        "attachments": [
            {
                "type": "IMAGE_OVERLAY",
                "value": overlay_url,
                "name": "Overlay Layer"
            }
        ]
    }
]

task = dataset.create_data_rows(assets)
task.wait_till_done()

if task.errors:
    print("Errors:", task.errors)
else:
    print("GeoTIFF with overlay uploaded successfully!")```

I adapted the script version you have provided here:

geotiff_url = ""
overlay_url = ""

assets = [
    {
        "row_data": {
        "tile_layer_url": geotiff_url
        }, 
        "global_key": str(uuid4()),  
        "media_type": "TMS_GEO",
        "attachments": [
            {
                "type": "IMAGE_OVERLAY",
                "value": overlay_url,
                "name": "Overlay Layer"
            }
        ]
    }
]

task = dataset.create_data_rows(assets)
task.wait_till_done()

if task.errors:
    print("Errors:", task.errors)
else:
    print("GeoTIFF with overlay uploaded successfully!")

based on the documentation: Import geospatial data
You have alternativeLayers that can be useful if you want to have 2 GeoTiff file instead of a PNG.