Skip to content

GeoParquet stores features as a columnar table. A .parquet URL on a geojson source is all it takes: maplibre-yaml reads the file into the source, so layers, popups, classify:, the legend and fitTo behave exactly as for a .geojson file — and it reads only the columns the document uses. Click a district; zoom in past 11 to see the stations, which are read by view.

Edit this map in the playground

geoparquet-source.yaml
# GeoParquet files as GeoJSON sources — YAML only. The .parquet file
# name is the only hint; layers, popups, classify, the legend and fitTo work
# as for a .geojson file, and only the columns this document uses are read.
# Synthetic, public-domain data (a fictional sea area).
type: map
id: geoparquet-source
config:
center: [10.2, 42.15]
zoom: 8
mapStyle: "https://tiles.openfreemap.org/styles/positron"
fitTo: { source: districts, padding: 24 }
legend:
title: District population
sources:
districts:
type: geojson
url: /gallery-assets/cloud-native/districts.parquet
points:
type: geojson
url: /gallery-assets/cloud-native/points.parquet
load: { mode: viewport, minzoom: 11 }
layers:
- id: districts
type: fill
source: districts
label: Population
classify:
field: population
method: quantile
classes: 4
palette: Blues
paint:
fill-opacity: 0.75
fill-outline-color: "#1d3557"
interactive:
click:
popup:
- h3: [{ property: name }]
- p: [{ str: "Category: " }, { property: category }]
- p: [{ str: "Population " }, { property: population }]
- id: points
type: circle
source: points
paint:
circle-radius: 4
circle-color: ["match", ["get", "kind"], "well", "#e63946", "station", "#264653", "#2a9d8f"]
circle-stroke-width: 1
circle-stroke-color: "#ffffff"
legend: { label: "Stations (from zoom 11)", color: "#264653", shape: circle }
  • type: geojson stays the MapLibre source type; the .parquet file name tells maplibre-yaml to read it as GeoParquet. For a URL without the extension, add format: geoparquet.
  • Only the columns this document references are read: name, category and population from the districts (the popup and classify:), kind from the stations (the colour). Set columns: to choose yourself, or columns: all.
  • districts is read whole (the default, load: all), so classify: computes its quantile classes from every district.
  • points uses load: { mode: viewport, minzoom: 11 }: only the rows in view are read, using the file’s bbox column and its location-sorted row groups, and re-read as the map moves. Below zoom 11 nothing is read. This needs a host with HTTP range requests (GitHub Pages, Netlify, S3, R2; not python -m http.server).
  • fitTo frames the decoded districts.
  • Data: synthetic and public domain (a fictional sea area), generated by scripts/fixtures/cloud-native.py.

More: GeoParquet — making a GeoParquet file, sizes, hosting, and what the map says when a file can’t be read.