How joemattathil/geotiff-mapper works
This repository is a small, client-side GIS/mapping application built around Leaflet.
Overall architecture
The project is effectively a static browser app:
• index.html is the application shell.
• leaflet.js and leaflet.css provide the mapping engine and its styling.
• app.js contains the custom application logic.
• style.css contains the app-specific UI styling.
There is no backend service, database server, or build pipeline visible in the repository. The README explicitly says the tool is “locally based on instance memory,” which matches a frontend-only architecture where state lives in the browser session unless the app later exports/imports data.
Main subsystems
1. Presentation / page shell
index.html is the entry point that assembles the page and loads the assets. In a diagram, this is the browser-facing container that:
• loads Leaflet and the app code
• provides the DOM elements for map display and upload/legend controls
• serves as the host for all runtime state in the browser
2. Mapping engine
Leaflet is the core mapping subsystem:
• renders the interactive map
• manages zoom/pan/tiles/layers
• provides the canvas/DOM layer where overlays such as GeoTIFFs would be displayed
Because Leaflet is shipped as local files in the repository, it is part of the app’s runtime dependency set rather than an external CDN dependency.
3. Custom application logic
app.js is the main orchestration layer. Based on the README, it likely handles:
• GeoTIFF upload workflow
• reading/parsing the uploaded raster
• converting it into a form Leaflet can display as an overlay
• legend creation/editing
• maintaining current session state in memory
• possibly import/export of “local json or excel database” content if that capability is implemented
This is the central boundary in the system: it sits between user interaction, file handling, and the map rendering library.
4. Styling layer
style.css defines the visual layout around the map and controls:
• page layout
• control positioning
• legend appearance
• upload interface styling
This layer does not affect core data flow, but it shapes the UI structure around the map canvas.
Data flow
A typical runtime flow is:
1. User opens index.html in the browser.
2. The page loads Leaflet assets and app.js.
3. app.js initializes the map.
4. User uploads a GeoTIFF from the local machine.
5. The app processes the file in-browser and creates a map overlay or equivalent visual representation.
6. The overlay is added to the Leaflet map.
7. User creates or edits custom legends, which are kept in session memory or other local-only state.
8. If persistence exists, it would be via local import/export mechanisms rather than a server database, since no backend is present in the repository.
Key boundaries
Browser boundary
Everything runs inside the browser process. There is no evidence of network-backed services or server-side rendering.
File input boundary
The GeoTIFF comes from the user’s local filesystem and is handled client-side. This is the main external data ingress into the app.
Mapping/rendering boundary
Leaflet owns the map rendering surface, while app.js owns the business logic that decides what overlay/legend state gets shown.
Persistence boundary
The README mentions “local json or excel database,” but the repository itself does not show a real persistence layer. So the safe architectural reading is:
• primary state is in-memory during the session
• any durable storage is likely manual/local-file based, not a remote DB service
Deployment/runtime model
This looks like a static application that can be served from any basic web server or opened in a browser environment that permits local asset loading. There are no signs of:
• Node.js backend
• API server
• database engine
• build artifacts
• package/dependency manager metadata
What an architecture diagram should show
A correct diagram would have:
• a browser/client box containing:
- index.html
- app.js
- style.css
- leaflet.js/leaflet.css
• a GeoTIFF file coming from the user into the client
• app.js as the controller/logic layer
• Leaflet as the map rendering layer
• in-memory session state for overlays/legends
• optional local import/export path if the JSON/Excel workflow is implemented
In short: this is a frontend-only, Leaflet-based GeoTIFF mapping tool where the client browser is both the UI and the execution environment, and the map plus legend state is managed locally without a server-side database.
Main entry points: app.js app.js · index.html index.html · style.css style.css · leaflet.js leaflet.js
Components 9
Browser App
Static client-side GIS application
- index.html · Browser entry point that assembles the page and loads assets
index.html - app.js · Main application logic for file handling, map setup, and session coordination
app.js - style.css · App-specific layout and control styling
style.css - leaflet.js · Local Leaflet runtime used for interactive mapping
leaflet.js - leaflet.css · Leaflet's base styles for map rendering
leaflet.css - Map view · Interactive map canvas where tiles and overlays are displayed
- GeoTIFF file · Raster file selected from the user's machine
- Overlay legend · In-browser overlay and legend state kept during the session
- Local import/export · Optional local JSON or Excel workflow for moving data in and out of the app
Connections 12
- index.html → leaflet.js: loads · Includes the mapping library into the page
- index.html → leaflet.css: loads · Includes Leaflet styling
- index.html → app.js: loads · Bootstraps custom application logic
- index.html → style.css: loads · Applies app-specific styling
- app.js → Map view: initializes · Creates and configures the interactive map
- leaflet.js → Map view: renders · Provides map interaction and rendering primitives
- leaflet.css → Map view: styles · Provides baseline map layout and visuals
- GeoTIFF file → app.js: uploads to · GeoTIFF is handled client-side by the application logic
- app.js → Overlay legend: updates · Maintains overlay and legend state in memory
- app.js → Local import/export: imports/exports · Supports local file-based data exchange when used
- Overlay legend → Map view: displays on · Legend and overlay state are reflected in the map UI
- style.css → Overlay legend: positions · Controls legend and UI layout