← Projects

Tool · Public repository

Sharing an interactive map without a server or code

What it solves
It turns a table of positions and your geographic layers into a single HTML file with a legend, filters and detail cards, which anyone can open in a browser without installing anything.
My role
I designed and built the tool and maintain its public repository.
Tool facts and contents

Facts

Type
Local app with a web interface (Streamlit)
Technology
Python · Folium (Leaflet) · GeoPandas · pandas
Inputs
Excel, CSV or Parquet; SHP, GPKG, GeoJSON, KML, GML, FGB or ZIP layers
Output
One HTML file and, optionally, a .py script that rebuilds it
Example
Fictitious data created for this portfolio
Code
GitHub

The problem

Picture someone with a spreadsheet of positions (fishing hauls, samples, sightings) and a shapefile of zones, who needs someone else to explore them: filter by vessel, see what falls inside a zone, check the details of a point.

  • A screenshot is easy to share, but you cannot filter or query anything.
  • A GIS project needs the software installed and the same data paths on the other computer.
  • A web viewer means publishing the data on a server.

The generator fills the gap between those options: you load the data into a local app, choose colours, labels and filters without writing code, and get a single HTML file you can send or drop in a shared folder.

How it combines data and layers

The app is organised in three tabs that follow the natural order of the work:

  1. Positions

    Upload one or more position files (Excel, CSV, Parquet, or points in GPKG, SHP or GeoJSON). The app suggests the latitude, longitude and date columns. For each set you choose how to colour the points (one colour, by category or by numeric ranges), which fields the label and the detail card show, and which filters the map will have.

  2. Layers

    Add your own polygon, line or point layers (SHP, GPKG, GeoJSON, KML, GML, FGB or ZIP). When you pick a .shp, its companion files are collected automatically. Optionally, you can switch on reference layers (GSA, EEZ, FAO areas and countries) that the app reads from a configurable folder; those layers are not part of the repository.

  3. Title and map

    Add a title, subtitle and logo, and generate the map. The app reports how many rows were drawn and how many were dropped, for example because of empty coordinates. Then you download the HTML and, if you want, a .py script that rebuilds the same map.

Under the hood, the interface (app.py) only collects decisions. The engine (mapas/motor.py) reads the data with pandas and GeoPandas, converts it to WGS 84 geographic coordinates and builds the map with Folium. The same engine runs from the command line with a configuration file, so a map can be rebuilt with new data of the same structure.

What you get when you export

  • A single HTML file with the data inside. Points travel in the file itself and are drawn on a canvas, so the map stays smooth with many positions.
  • Legend and layer control. Each category is a layer you can switch on or off, with its number of features.
  • Filters inside the map. Searchable multi-select dropdowns and a date range filter.
  • Label and detail card. Hovering over a point shows a short label; clicking it opens the card with the chosen fields.
  • Reading tools. Minimap, scale, cursor coordinates, zoom to an area and back to the initial view, with three base maps to choose from.

The file opens with a double click in any browser. “Self-contained” refers to the data and the map settings: the base map and the libraries (Leaflet, Bootstrap, jQuery) load from public servers, so an internet connection is needed to see the background.

Reproducible example

For this portfolio I generated an example with the repository’s engine and made-up data: 150 catch records with date, vessel, port, species, gear, weight and position, three of them deliberately without coordinates, plus two fictitious zones in GeoJSON. The data come from a script with a fixed seed, so the result is exactly repeatable.

Map of the western Mediterranean between the coast of Murcia and Mallorca. There are two groups of coloured points, one south of Mallorca and one off Cartagena, each next to a dashed rectangle. At the top, a box with the title “Capturas de ejemplo” and three filters; at the bottom right, a legend with five species and two zones.
The HTML generated from the fictitious data, as it opens in the browser. Points are coloured by species and the dashed rectangles are the custom zones layer. At the top are the filters by vessel, port and date range; at the bottom right, the legend with the number of points per species; at the bottom left, the minimap and the scale. The map labels are in Spanish because that is the language of the tool.Own screenshot. Data made up for this portfolio, unrelated to any real catches or zones. Base map: Esri World Ocean Base (sources: GEBCO, NOAA, Esri, DeLorme, NAVTEQ and others), displayed with Leaflet.
Explore the example map

Opens as a separate page. It uses fictitious data; the base map and libraries need a connection.

The whole composition comes from a configuration file like this one. Each block says which file to read, how to colour it and which filters and labels to offer:

Excerpt from the example configuration (JSON)
"positions": [{
  "path": "datos/capturas_ficticias.csv",
  "lat": "Latitud", "lon": "Longitud", "date": "Fecha",
  "style": { "mode": "category", "column": "Especie" },
  "tooltip": ["Barco", "Especie", "Captura_kg"],
  "slicers": ["Barco", "Puerto"], "date_slicer": true
}],
"layers": [{
  "path": "datos/zonas_ficticias.geojson",
  "style": { "mode": "category", "column": "tipo" },
  "dashed": true, "fill_opacity": 0.25
}]

The engine drops the three rows without coordinates, logs it and draws 147 points.

Limitations

  • The HTML contains every point: with many positions, the file gets heavier and slower to open. The app warns about it and can subsample.
  • The base map and the libraries need an internet connection.
  • Reference layers depend on an external folder; if it is not reachable, they are skipped with a warning.
  • According to the repository itself, packaging, pinned dependency versions and automated tests are still pending.

Authorship and third-party resources

Third-party resources

  • Open-source libraries: Streamlit for the interface; Folium and Leaflet, with their minimap and coordinates plugins, for the map; pandas and GeoPandas for the data.
  • Base maps from Esri (World Ocean Base and World Imagery) and OpenStreetMap. Each one shows its attribution on the map itself.

My work

  • Design and development of the app: the three-tab interface, the engine that builds the map, the filters, the legend and the reusable configuration.
  • Documentation and maintenance of the public repository (GitHub).
  • The example on this page: the fictitious data, the configuration and the screenshot.

← Back to home

Ask about my work

Checking the service…

Write any question about my background, projects, education or publications. Answers are based only on the content of this site and link to their sources.

To get started

0 of 500 charactersAnswers generated by a language model from this site. The conversation is not stored.