Skip to content

2026.2.0

Choose a tag to compare

@sgraaf sgraaf released this 16 May 22:27
· 41 commits to main since this release

Highlights

This second major release in the year 2026 adds the ability to overlay your own geometries on maps — drop in circle or icon markers, lines, and polygons directly, or load them from GeoJSON and GPX files via new add_* methods, the from_features/from_geojson/from_gpx classmethods (which can auto-fit the scale to your data with optional padding), and matching geojson and gpx CLI sub-commands. It also fixes broken URL templates for the Esri, USGS, ÖPNVKarte, and Mapy.cz tile providers.

Full Changelog

Added

  • Added papermap.features, papermap.geojson and papermap.gpx modules to overlay geometries on the map. features exposes CircleMarker, IconMarker, Line and Polygon dataclasses; geojson.geojson_to_features() parses GeoJSON files, dicts, or any object exposing __geo_interface__ (honouring simplestyle-spec properties); gpx.gpx_to_features() does the same for GPX. Features render above the base map but below the grid, and are clipped to the map area.
  • Added builder/loader methods on PaperMap: add_circle_marker(), add_icon_marker(), add_line(), add_polygon(), add_feature(), add_geojson() and add_gpx().
  • Added PaperMap.from_features(), PaperMap.from_geojson() and PaperMap.from_gpx() classmethods that build a PaperMap centred on the supplied geometries' bounding box and pre-populate them on the new map. All three accept auto_scale and padding keyword arguments: when auto_scale=True, the scale is computed to fit the geometries within the printable image area (paper size minus margins minus padding) and snapped up to the nearest common cartographic scale (1:1 000, 1:2 500, …, 1:50 000 000). Passing both auto_scale=True and an explicit scale raises ValueError.
  • Added geojson and gpx CLI sub-commands (e.g. papermap gpx hike.gpx Hike.pdf --auto-scale), with --auto-scale and --padding options in addition to the common CLI options. Reading GPX files from disk requires the optional gpx package; install it with pip install papermap[gpx].

Fixed

  • Fixed broken URL templates for the Esri, USGS, ÖPNVKarte, and Mapy.cz tile providers, where the upstream server/MapServer hostnames and paths had been incorrectly renamed to provider/MapProvider