GeoJSON · format guide

GeoJSON viewer online

GeoJSON is a JSON FeatureCollection where geometry sits alongside arbitrary properties. MapCrafter reads points, lines, polygons and mixed collections, offers the properties as fields for colour and labels, and renders everything on vector tiles. Because it is already the renderer’s native format, nothing is converted.

What a GeoJSON file is

GeoJSON is the lingua franca of web mapping and the format every other format gets converted into. A FeatureCollection holds Features, each with a geometry and a properties object, and the properties are what make it useful: they are the columns, and they can drive colour, size, labels and popups directly.

Because MapCrafter renders GeoJSON natively, an imported file keeps its properties exactly as written, including nested objects and arrays. There is no round trip through a database schema, so nothing is renamed, truncated or dropped.

The common difficulties with GeoJSON are practical rather than conceptual: files that are enormous because coordinates have fifteen decimal places, collections that mix geometry types, and coordinates in the wrong axis order. The first is fixable by quantising, the second is handled on import, and the third is the single most common reason a GeoJSON file appears on the wrong side of the world.

What MapCrafter reads from it

FeatureCollection
The normal container, with any mix of geometry types
A bare Feature or geometry
Wrapped automatically rather than rejected
Nested properties
Objects and arrays are kept and can be shown in popups
Mixed geometry
Kept in one layer, with a renderer for each geometry type present
Feature ids
Preserved, which keeps a round trip through export lossless

Mapping a GeoJSON file, step by step

  1. 1

    Drop the .geojson or .json file in

    The file is parsed and features are counted before anything renders.

  2. 2

    Check the geometry mix

    A mixed collection stays in one layer: polygons fill, lines stroke and points get markers. Use separate source files for independent layer controls.

  3. 3

    Style from the properties

    Any property can drive colour categorically or sequentially, or scale marker size.

  4. 4

    Export it back out

    Export retains imported feature properties and adds an _layer property naming the source layer.

Things that go wrong with GeoJSON

Every one of these is a property of the format rather than a bug in a particular tool, which is why they keep happening.

  • Everything is mirrored or off the coast of Somalia.

    Axis order. The specification says longitude first, but a lot of code writes latitude first because that reads naturally. If your points are mirrored across the diagonal, the two are swapped.

  • The file is 200 MB and the browser struggles.

    Coordinate precision. Fifteen decimal places is sub-micron on the ground and roughly doubles the file. Six decimal places is about 10 cm, which is plenty for anything short of surveying. Quantise with mapshaper or tippecanoe before importing.

  • Nothing renders and there is no error.

    Usually a valid JSON file that is not GeoJSON — a TopoJSON file, a bare array of coordinate pairs, or a FeatureCollection with a null geometry on every feature. Check the top-level "type" member.

  • Polygons have hairline gaps between neighbours.

    Two adjacent polygons each draw their own edge, and the antialiasing of both is visible. The standard fix is what MapCrafter does by default: draw the outlines in the land colour beneath the fills so the seams disappear.

  • Properties are missing after a round trip through another tool.

    Some tools only preserve properties they recognise, and Shapefile in particular truncates names to ten characters and drops types it cannot express. Going GeoJSON to Shapefile to GeoJSON is lossy in a way that is not obvious.

GeoJSON maps in the gallery

14 live maps built from GeoJSON data, each showing its source columns and the geometry that was detected.

GeoJSON questions

How do I view a GeoJSON file without writing code?
Drop the file into the studio. It is parsed in the browser and rendered on a vector basemap, with the properties offered as fields for colour, labels and popups. Parsing happens locally; basemap requests still use the network.
Does MapCrafter handle TopoJSON as well?
Yes. TopoJSON is detected and converted, which is worth knowing because topology stores shared arcs once, so a TopoJSON file is often a fifth the size of the equivalent GeoJSON.
Can I edit the properties?
Not yet. You can style by them and export them unchanged, but editing attribute values in the browser is on the roadmap rather than shipped.
What happens to a mixed FeatureCollection?
It stays in one mixed layer, with points, lines and polygons drawn using the applicable parts of its style. Import separate files when you need independent visibility, colour or popup settings.

Other formats MapCrafter reads

Start with your own file

Last updated 2026-10-22.