Skip to main content

Projections

A projection defines how the sphere of the Earth is flattened onto the map canvas. Different projections make different tradeoffs between shape accuracy, area accuracy, and visual familiarity. maproll picks a sensible default per scope, but you can override it.

All five projections come from d3-geo. The height is auto-derived from the projection's natural aspect ratio when you omit the height parameter.

Examples

All examples use the same world scope so the deformation differences are visible.

naturalEarth1 — world default, balanced compromise

https://api.maproll.io/map.svg?scope=world&data=US:1,RU:1,CA:1&theme=light-blue&projection=naturalEarth1
World map — Natural Earth 1 projection

equalEarth — honest country sizes

https://api.maproll.io/map.svg?scope=world&data=US:1,RU:1,CA:1&theme=light-blue&projection=equalEarth
World map — Equal Earth projection

mercator — shape-preserving, extreme pole distortion

https://api.maproll.io/map.svg?scope=world&data=US:1,RU:1,CA:1&theme=light-blue&projection=mercator
World map — Mercator projection

conicConformal — regional default with auto-parallels

https://api.maproll.io/map.svg?scope=RO&data=RO-B:500,RO-CJ:200,RO-IS:150,RO-TM:180&theme=light&projection=conicConformal
Romania — conic conformal projection

Parameters

ParamTypeDefaultAllowedNotes
projectionstringscope-dependentnaturalEarth1, albersUsa, conicConformal, mercator, equalEarthCase-sensitive. Returns 400 if unrecognised.

Scope defaults

ScopeDefault projectionWhy
worldnaturalEarth1A compromise projection — neither conformal nor equal-area but familiar and visually balanced at world scale
USalbersUsaAlbers USA insets Alaska and Hawaii into a standard continental frame, which is the expected layout for US state-level data
All other scopesconicConformalParallels are derived automatically from the feature collection's bounding box, giving a sensible fit for any country or region

When to pick which

naturalEarth1 — the best all-around world projection. Shapes are recognisable and the polar regions are not heavily distorted. Use it as your world default unless you have a specific reason to switch.

equalEarth — an equal-area world projection. Africa, North America, and Antarctica appear in their true relative sizes. Use it when accurately communicating country size or density matters (population maps, emissions per km²).

mercator — a conformal projection: shapes are locally accurate, but areas are severely exaggerated toward the poles. Greenland and Russia appear much larger than they are. Use it when you are zooming into a small area where local shape accuracy matters more than world context.

conicConformal — the automatic default for any non-world scope. Parallels are derived from the latitude extent of the feature collection, so you do not need to configure anything. Shapes are accurate for mid-latitude regions. Appropriate for any single country or subnational scope.

albersUsa — the standard US layout, with Alaska and Hawaii repositioned as insets below the lower-48. Only useful with the US scope (or if you manually pass US state data to world).

Notes

  • When height is omitted, the server fits the projection to the requested width first, then computes the height from the projected bounding box. This is a two-pass operation and produces exact aspect-ratio-correct output without rounding error.
  • For conicConformal, parallels are set to [midLat − span/3, midLat + span/3] derived from the feature collection's bounding box. This is automatic; there is no URL parameter to override the parallels directly.
  • Passing an unknown projection name returns 400 with {"error":"invalid_projection", ...}.
  • Scopes — each scope has a default projection
  • Size and format — how width/height interact with auto-fitting
  • GET /map — full query-parameter reference