Skip to content

Minimap incorrectly renders metadata containing BBOX coordinates #151

@bennyistanto

Description

@bennyistanto

Replication Case: https://jkan.riskdatalibrary.org/datasets/rdls_lss-mdgundrr_desinventar_a/

This dataset contains the following BBOX information: "bbox": [ 43.22, -25.6, 50.5, -11.94 ]. This follows the standard geospatial array format of [min_lon, min_lat, max_lon, max_lat].

Image

Verification:

When plotting this exact BBOX using geojson.io, the geometry is perfectly correct and frames Madagascar as expected.

Click to view GeoJSON verification code
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Madagascar Bounding Box"
      },
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [43.22, -25.6],
            [50.5, -25.6],
            [50.5, -11.94],
            [43.22, -11.94],
            [43.22, -25.6]
          ]
        ]
      }
    }
  ]
}

Expected Behavior / Working Comparison:

Other datasets for the exact same country that do not have BBOX information render perfectly because the minimap falls back to using geoBoundaries files.

Working Case: https://jkan.riskdatalibrary.org/datasets/rdls_hev-mdg_grma_agriculturaldroughtrisk/

Image

Proposed Solutions

  1. Fix Leaflet Coordinate Parsing: The minimap appears to be using Leaflet, which expects coordinates in [Latitude, Longitude] format. The JSON metadata provides the BBOX in [min_lon, min_lat, max_lon, max_lat]. The frontend code needs a parsing step to map the JSON array to Leaflet's bounds correctly (e.g., formatting it as [[min_lat, min_lon], [max_lat, max_lon]] before passing it to L.latLngBounds).
  2. Metadata Fallback Logic:
    • Force country-level datasets (scale: national) to bypass the BBOX value entirely and strictly use geoBoundaries for visual consistency.
    • Restrict the BBOX rendering logic to only apply to global, regional, sub-national, and urban scales where standard administrative boundaries might not apply.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions