Skip to content

Geolibre Integration#425

Open
amit-spatial wants to merge 9 commits into
developmentfrom
feat/geolibre-cog-download
Open

Geolibre Integration#425
amit-spatial wants to merge 9 commits into
developmentfrom
feat/geolibre-cog-download

Conversation

@amit-spatial

@amit-spatial amit-spatial commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces KYL's /download_layers interface with an embedded GeoLibre workspace generated for the selected state, district, and tehsil.

Implementation

  • Loads only Administrative Boundaries and Socio-Economic Profile initially, both visible at 0.8 opacity.
  • Keeps every other vector and raster lazy: it loads on first toggle and is reused when toggled again.
  • Fits the full tehsil bbox once; later layer hydration does not move the map.
  • Organizes layers as Demographic → Hydrology → LULC 3 → LULC 2 → LULC 1 → Land → Agriculture → Restoration → Climate → NREGA; micro-watersheds and hydrological variables belong to Hydrology.
  • Uses Google Satellite Hybrid by default, with an environment override for another MapLibre style.
  • Shows one minimized, bottom-right GeoLibre legend control containing only visible layers. Toggling a layer updates the available legend entries.
  • Preserves styled WMS display and full-coverage GeoTIFF (COG) export for raster layers.
  • Uses human recovery messages and offers a bounded downloadable .log for technical support.
  • Adds the official GeoLibre User Guide beside QGIS Documentation.
  • Adds visible fallback guidance linking to the CoRE Stack QGIS Styles repository.
  • Records the CoRE Stack dataset CC BY 4.0 license in project metadata and module documentation.
  • Continues targeting the official GeoLibre v2.2.0 release while accepting compatible 2.x viewers from 2.0.0 onward.

The catalog contains 45 entries: 13 vectors, 24 LULC rasters, and 8 other rasters. Existing /kyl_dashboard behavior is unchanged.

Local testing

git fetch origin
git switch feat/geolibre-cog-download
git pull --ff-only
npm ci

echo -e "REACT_APP_API_URL=https://geoserver.core-stack.org/api/v1\nREACT_APP_GEOSERVER_URL=https://geoserver.core-stack.org:8443/geoserver/" >> .env

HOST=0.0.0.0 PORT=3000 BROWSER=none npm start

Alternatively, use cp .env.example .env. Open http://localhost:3000; another device on the same network can use http://YOUR_PC_IP:3000 after checking hostname -I and allowing port 3000 through the firewall.

Check:

  1. /kyl_dashboard still loads.
  2. Download Layers opens GeoLibre at the selected tehsil bbox.
  3. Only the two Demographic layers are initially enabled.
  4. The legend starts minimized and initially lists only those two layers.
  5. Toggling a layer adds its legend; toggling it off removes that entry.
  6. Other vectors and rasters load only on first toggle and are reused afterward.
  7. Later toggles do not refit the map.
  8. Raster WMS display and GeoTIFF (COG) export work.

Validation completed:

  • GeoLibre project tests: 10 passed, including visibility-driven legends and lazy-layer reuse.
  • Targeted ESLint: passed for all changed JavaScript files.
  • Production build: succeeded. Existing warnings outside this integration remain unchanged.
  • Changed files use LF line endings.

Deployment

Merge feat/geolibre-cog-download into development, then build with:

REACT_APP_API_URL=https://geoserver.core-stack.org/api/v1
REACT_APP_GEOSERVER_URL=https://geoserver.core-stack.org:8443/geoserver/
npm ci
npm run build

Deploy build/ with SPA fallback for direct /download_layers?... URLs. CSP/CORS must permit the GeoLibre iframe, GeoServer WFS/WMS/WCS requests, and https://mt1.google.com imagery.

For an exactly pinned self-hosted viewer, configure REACT_APP_GEOLIBRE_VERSION, REACT_APP_GEOLIBRE_URL_TEMPLATE, and REACT_APP_GEOLIBRE_STRICT_VERSION=true. No earlier GeoLibre branch needs to be merged separately.

@amit-spatial
amit-spatial requested a review from Ksheetiz-24 July 22, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant