Verified display media and local viewing#

Use this procedure for the default single-scene ship-finding report or a visual replay of a completed detection. Network requests, credentials, downloads, and any viewing server belong to the host runtime. The bundled renderer remains an offline, one-shot utility.

NOTICE AND DISCLAIMER: This software automatically retrieves, accesses or interacts with external materials. Those retrieved materials are not distributed with this software and are governed solely by separate terms, conditions and licenses. You are solely responsible for finding, reviewing and complying with all applicable terms, conditions, and licenses, and for verifying the security, integrity and suitability of any retrieved materials for your specific use case. This software is provided “AS IS”, without warranty of any kind. The author makes no representations or warranties regarding any retrieved materials, and assumes no liability for any losses, damages, liabilities or legal consequences from your use or inability to use this software or any retrieved materials. Use this software and the retrieved materials at your own risk.

Discover the authorized API#

Resolve the GeoNeMo HTTP API origin from trusted host configuration or an explicit user-supplied HTTP origin. An MCP endpoint or catalog:// record reference does not identify the media API origin; do not guess ports or treat a catalog URI as a download URL. If the origin is unavailable, continue authorized detection/result retrieval and request the missing origin before downloading.

At that origin, read GET /v1/discovery. Require an available media capability advertising product-manifest, inspect, and download. Keep the discovery response as provenance. Use host-authorized HTTP access with finite timeouts and no redirects to other origins; stop on unavailable capability or incompatible contract instead of probing alternate endpoints.

Exhaust the product manifest and select RGB#

First exact-read the succeeded run and exhaust all detector result pages. Preserve the pages unchanged, require stable run/source/model metadata and unique candidate IDs, and check that the aggregate candidate count equals total. Reuse this exact bundle when already available.

Construct record routes using the GeoNeMo media contract: encode the unchanged record ID’s UTF-8 bytes as unpadded URL-safe base64, prefix with b64., and use that as the {record_id} path segment. Preserve the original ID in metadata. The authorized GeoNeMo client performs this encoding when available; do not splice a raw ID containing slashes into a route.

Read GET /v1/media/records/{collection}/{record_id}/product-manifest?limit=100, following every opaque next_cursor on the same record until null. Product manifests require contract 2.1 or newer within major 2, completeness: complete-safe, and stable page metadata. Require collection, record ID, product type, canonical_safe_name, inventory_sha256, and tree_sha256 to match the detector source (canonical_product_name is its corresponding name field). Reject repeated cursors, duplicate asset IDs, changed metadata, or an aggregate file count different from total_files; bound retrieval to the contract’s 4096-file maximum. Keep every original page.

From the complete files list, select exactly one entry per band with:

  • spectral_band equal to B04, B03, or B02, respectively;

  • resolution_m equal to 10 and semantic role equal to measurement;

  • an exact asset id, supported raster media_type, nonzero byte_size, and SHA-256.

The same band can also occur at 20 or 60 metres. Do not select by filename or band alone, resample another resolution, or substitute TCI, thumbnails, previews, or quality assets. Ambiguous or missing 10-metre assets make visualization incomplete. The order passed to the renderer is B04/B03/B02.

Inspect, download, and verify#

Use GET /v1/media/records/{collection}/{record_id}/inspect?asset={asset_id} for each exact selected asset. Require the same collection, record, selected asset, supported georeferencing, and method affine_crs; retain the inspection response. Download with GET /v1/media/records/{collection}/{record_id}/download?asset={asset_id} into a new run-scoped workspace directory. Use host-selected filenames under sources/, not remote filesystem paths.

Original product-member downloads use the HTTP header X-GeoNemo-Media-Role: manifest. This is the download representation label; the product-manifest entry’s semantic role is measurement. Do not compare these two roles for equality or reject an original band because its download label is manifest. Require both roles at their respective boundaries and preserve the raw headers.

Verify the response media type, X-GeoNemo-Media-Asset, X-GeoNemo-Asset-SHA256, and X-GeoNemo-SAFE-Inventory-SHA256 against the selected asset and detector-bound manifest. Require complete bytes, exact advertised byte_size, and the computed file SHA-256 to match. For bounded range downloads, validate every Content-Range and contiguous assembly before accepting the full file; one partial response is not a complete asset. Preserve download receipts with asset ID, inventory hash, byte size, computed hash, and raw response headers. Stop on any mismatch.

Create the renderer input with every unchanged result page and one descriptor per verified band: band, collection, record_id, asset_id, media_contract_version, media_type, media_role: source, georeferencing_method: affine_crs, staging-relative file, and sha256. Here source describes the verified local renderer input; it does not rewrite the retained HTTP manifest label. Derive all identity and hash values from the exact responses. Follow the rendering contract for invocation and output hashes.

Completion and viewing#

Before reporting completion, verify the output manifest and hashes, source image, hollow candidate circles, searchable table with every candidate, row-to-source-pixel navigation, provenance and limitations, and a working clickable link to report.html. A succeeded zero-candidate run still gets its source image and empty table; never fabricate markers. Missing media, dependencies, rendering, or a usable link means the requested report is incomplete. Preserve the detector’s succeeded status and exact results; state the visualization error without substituting a generic report or declaring zero vessels.

When the user asks to serve or view the report, have the host start a viewing server bound to 127.0.0.1, serving only the generated report/ directory. For example, replace the absolute directory and choose an available port in this host command:

python3 -m http.server 8765 --bind 127.0.0.1 --directory /absolute/run-directory/report

Check an HTTP GET of http://127.0.0.1:8765/report.html and any referenced image assets, then give the working browser link. If execution is remote, provide an SSH local-forward command using the actual SSH host and port, such as ssh -N -L 8765:127.0.0.1:8765 user@execution-host; the user’s browser then opens http://localhost:8765/report.html. Do not claim a remote localhost link is reachable on the user’s machine without that connection. Keep the server available for viewing and report its process/port so the host can stop it when requested. Never expose the staging directory, credentials, or a public interface as part of this viewing step.