Skip to content

Thumbnail image and map coordinates are not tied to the same country for transnational/serial properties #482

Description

@zigzagdev

Description

Follow-up (backend side) of zigzagdev/world-heritage-frontend#387.

For transnational/serial World Heritage properties (one property spread across multiple countries), getHeritageById/getAllHeritages currently expose:

  • a single (latitude, longitude) pair per site,
  • a single main_image_url / per-image list with no country information attached.

Neither is linked to state_party_codes / primary_state_party_code, so the thumbnail image and the map pin can end up depicting different countries, and neither necessarily matches the displayed primary country.

Example: id 1321 ("The Architectural Work of Le Corbusier..."), 7 countries (ARG, BEL, CHE, DEU, FRA, IND, JPN):

  • main_image_url → depicts the Curutchet House in La Plata, Argentina.
  • latitude/longitude46.4684139, 6.8293361, which points to Switzerland.
  • primary_state_party_codeIND (India).

Three different countries depending on which field is read.

Root cause

UNESCO's source dataset stores exactly one (latitude, longitude) pair per heritage site record, even for serial/transnational properties spanning many countries and physical locations (see world_heritage_sites table — single latitude/longitude columns). Per-image data (world_heritage_site_images) has no country_code column, so there's no way to know which country a given image belongs to, or to pick an image consistent with a given coordinate (or vice versa).

Suggested direction (needs a decision before implementing)

  1. Minimal fix: keep a single stored coordinate per site, but change main_image_url/thumbnail selection logic to prefer an image known to be from primary_state_party_code. Coordinate itself stays as-is (still potentially "wrong" relative to the primary country, but at least the thumbnail and the country label agree).
  2. Fuller fix: extend the schema — add a country_code (or state_party_code) column to world_heritage_site_images, and/or store per-sub-site coordinates for serial properties — then expose enough of that in the API response for the frontend to pick a coordinate/image pair that's mutually consistent.

Acceptance Criteria

  • Decide between the minimal fix and the fuller schema fix (or a staged approach: minimal first, fuller later).
  • Whichever is chosen, the country implied by main_image_url/thumbnail and the country implied by latitude/longitude are consistent with primary_state_party_code for serial/transnational properties.
  • Audit other multi-country serial properties (not just id 1321) once the fix lands.

Related: zigzagdev/world-heritage-frontend#387

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions