Skip to content

Rectify HiRISE/LROC detail patches against north — orient texture by source product metadata, not axis-aligned square #309

@chipi

Description

@chipi

Problem

The Tier-2 detail layer on /mars and /moon flat-patch view shows HiRISE / LROC NAC imagery rotated relative to the surrounding CTX / LROC WAC regional layer. User feedback 2026-06-08: "HiRISE image does not match CTX since it overlaps in weird way."

Root cause

The detail patch is pasted onto an axis-aligned (north-aligned) square on the sphere — but the source HiRISE / LROC NAC product was oriented to the spacecraft track, not to north. So:

  • Regional layer (CTX / LROC WAC) — north-aligned mosaic, georeferenced to ±100 m.
  • Detail layer (HiRISE / LROC NAC) — a 2048² crop of a product that has arbitrary rotation relative to north; we drop it on a north-aligned square anyway.

Result: the rectangle outlines line up, but the content inside the rectangle is rotated relative to the content around it.

Two related side issues the same fix can address:

  1. Acquisition-time mismatch — HiRISE and CTX were taken years apart; different sun angle = different shadows. Residual mismatch is inherent and not fixable here.
  2. Georeferencing precision — HiRISE is ±50 m vs CTX's ±100 m, so they can be physically offset by tens of metres even when correctly oriented.

Proposed fix

Read each source product's actual orientation + footprint metadata (from the PDS label .LBL or geo-PDS sidecar), and either:

  • a) Rotate the texture in the image pipeline so the texture itself is north-aligned, then paste onto the existing square (simplest); or
  • b) Build a 4-corner polygon geometry per product matching the source product's actual ground footprint (more accurate; handles polar tilt + edge skew).

Either path requires:

  • A per-image metadata field (orientation_deg + 4-corner lat/lon) in the image-provenance entries.
  • An update to the hotspot-surface-patch builder to consume the metadata instead of assuming north-aligned axis-aligned squares.
  • A pipeline pass that scrapes the metadata for the products we ship (or hand-curates it for the ~30 hotspots that have detail patches).

Out of scope

  • Tier-1 (regional CTX) stays as-is — it's already north-aligned.
  • Acquisition-time mismatch is a data-source reality, not solvable in code.
  • /earth launch-site commercial-sat insets are TBD anyway and will need the same metadata path from day one.

Trigger

Filed at user request after the 2026-06-08 /mars flat-patch session.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions