Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ tiles = gt.registry.load_blocks_for_region(bounds=bbox, year=2024)
embeddings = gt.fetch_embeddings(tiles)

# Export as GeoTIFF
files = gt.export_embedding_geotiffs(bbox=bbox, output_dir="./output", year=2024)
files = gt.export_embedding_geotiffs(tiles_to_fetch=tiles, output_dir="./output")
```

### Registry Operations
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,14 @@ for year, tile_lon, tile_lat, embedding_array, crs, transform in embeddings:

```python
# Export embeddings for a region as individual GeoTIFF files
# Step 1: Get the tiles for the region
bbox = (-0.2, 51.4, 0.1, 51.6)
tiles_to_fetch = gt.registry.load_blocks_for_region(bounds=bbox, year=2024)

# Step 2: Export those tiles as GeoTIFFs
files = gt.export_embedding_geotiffs(
bbox=(-0.2, 51.4, 0.1, 51.6),
tiles_to_fetch=tiles_to_fetch,
output_dir="./output",
year=2024,
bands=None, # Export all 128 bands (default)
compress="lzw" # Compression method
)
Expand All @@ -248,9 +252,8 @@ print(f"Created {len(files)} GeoTIFF files")

# Export specific bands only (e.g., first 3 for RGB visualization)
files = gt.export_embedding_geotiffs(
bbox=(-0.2, 51.4, 0.1, 51.6),
tiles_to_fetch=tiles_to_fetch,
output_dir="./rgb_output",
year=2024,
bands=[0, 1, 2] # Only export first 3 bands
)
```
Expand Down
41 changes: 19 additions & 22 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,15 @@ Complete analysis workflow::
selected_tiles = [r for r in results if r['mean_band_50'] > threshold]

print(f"Exporting {len(selected_tiles)} tiles above threshold")

files = []
for tile in selected_tiles:
file = gt.export_embedding_geotiffs(
bbox=(tile['lon']-0.05, tile['lat']-0.05,
tile['lon']+0.05, tile['lat']+0.05),
output_dir="./selected_tiles",
year=2024,
bands=[40, 50, 60] # Bands around band 50
)
files.extend(file)

# Prepare tiles for export
tiles_to_export = [(2024, tile['lon'], tile['lat']) for tile in selected_tiles]

files = gt.export_embedding_geotiffs(
tiles_to_fetch=tiles_to_export,
output_dir="./selected_tiles",
bands=[40, 50, 60] # Bands around band 50
)

# Create PCA visualization from selected tiles
# CLI: geotessera visualize ./selected_tiles pca_selected.tif
Expand Down Expand Up @@ -468,17 +466,16 @@ Use both numpy and GeoTIFF formats in the same workflow::
selected_coords.append((lon, lat))

print(f"Selected {len(selected_coords)} interesting tiles")

# Step 2: Export selected tiles as GeoTIFF
all_files = []
for lon, lat in selected_coords:
files = gt.export_embedding_geotiffs(
bbox=(lon-0.05, lat-0.05, lon+0.05, lat+0.05),
output_dir="./interesting_tiles",
year=2024,
bands=[60, 64, 68] # Bands around interesting band 64
)
all_files.extend(files)

# Step 2: Export selected tiles as GeoTIFF
# Prepare tiles for export
tiles_to_export = [(2024, lon, lat) for lon, lat in selected_coords]

all_files = gt.export_embedding_geotiffs(
tiles_to_fetch=tiles_to_export,
output_dir="./interesting_tiles",
bands=[60, 64, 68] # Bands around interesting band 64
)

# Step 3: Create PCA visualization from selected tiles
print("Creating PCA visualization...")
Expand Down
Loading