# Ground Zero DEM Acquisition

## Purpose

This document records the official USGS 3DEP DEM product selected for the Ground
Zero MVP tile.

## Acquisition Script

```text
Scripts/acquire_ground_zero_dem.py
```

The script:

- Reads the Ground Zero tile bounds from `Data/Tiles/ground_zero_tiles.json`.
- Converts the 1 km UTM tile bounds to latitude/longitude.
- Queries the USGS TNMAccess API for `Digital Elevation Model (DEM) 1 meter`
  products in GeoTIFF format.
- Stores the full TNM query response and selected product record.
- Downloads the selected GeoTIFF source.
- Updates the tile registry source record.

## Selected Product

```text
title: USGS 1 Meter 10 x54y416 CA_CaliforniaGaps_B23
dataset: Digital Elevation Model (DEM) 1 meter
format: GeoTIFF
publication_date: 2025-08-20
source: USGS TNMAccess / ScienceBase / 3DEP
```

The product is a 10 km x 10 km 1-meter DEM tile that covers the 1 km Ground Zero
MVP tile.

## Local Files

```text
Data/Terrain/Sources/gz_us_ca_pacifica_utm10n_e544_n4160/
```

Expected files:

- `gz_us_ca_pacifica_utm10n_e544_n4160_tnm_1m_dem_product.json`
- `USGS_1M_10_x54y416_CA_CaliforniaGaps_B23.tif`
- `USGS_1M_10_x54y417_CA_CaliforniaGaps_B23.tif`

Ground Zero sits on a 3DEP 10 km tile boundary, so both source GeoTIFFs are
needed to extract the full 1 km MVP tile.

## Subset Extraction

```text
Scripts/extract_ground_zero_dem_subset.py
```

This script extracts the exact 1 km Ground Zero subset from the source GeoTIFFs.
It requires `rasterio` or equivalent GDAL Python support.

The extraction output is:

```text
Data/Terrain/Extracted/gz_us_ca_pacifica_utm10n_e544_n4160/
```

Generated files:

- `gz_us_ca_pacifica_utm10n_e544_n4160_1m_dem_subset.tif`
- `gz_us_ca_pacifica_utm10n_e544_n4160_1m_dem_subset_metadata.json`

Current extracted subset:

```text
size: 1000 x 1000 pixels
pixel_size: 1 m x 1 m
crs: EPSG:26910 / NAD83 UTM zone 10N
bounds: E 544000-545000, N 4160000-4161000
```

## Notes

- The USGS product is the final MVP target elevation source.
- The older USGS EPQS 33 x 33 heightmap remains useful as a fast prototype and
  sanity check, but the 1-meter GeoTIFF is the source we should use for the real
  Unreal terrain tile.
- The selected products are larger than the 1 km MVP tile; this is expected for
  3DEP 1-meter DEM products.
