GeoJSON Specification Guide (RFC 7946): Structure, Features & Best Practices

A comprehensive technical reference for web developers and GIS engineers working with JSON-based spatial vector data.

By Spatial-Sandbox Engineering • Updated: September 2026 • Reading Time: 14 min

1. What is GeoJSON (RFC 7946)?

GeoJSON is an open, standard format designed for representing simple geographical features along with their non-spatial attributes. Based on JavaScript Object Notation (JSON), it was standardized by the Internet Engineering Task Force (IETF) under RFC 7946 in August 2016, superseding the original 2008 community specification.

GeoJSON has become the de facto data exchange format for modern web mapping engines including Leaflet, Mapbox GL JS, OpenLayers, and Cesium. Unlike desktop-oriented binary formats like ESRI Shapefiles, GeoJSON is natively readable by JavaScript, REST APIs, and NoSQL databases like MongoDB and CouchDB.

2. The 7 GeoJSON Geometry Types

Every GeoJSON geometry is a JSON object with two required keys: "type" and "coordinates". RFC 7946 defines seven fundamental geometry primitives:

1. Point

{
  "type": "Point",
  "coordinates": [-73.985130, 40.748817]
}

2. MultiPoint

{
  "type": "MultiPoint",
  "coordinates": [
    [-73.985, 40.748],
    [-73.975, 40.755]
  ]
}

3. LineString

{
  "type": "LineString",
  "coordinates": [
    [-73.985, 40.748],
    [-73.975, 40.755],
    [-73.960, 40.770]
  ]
}

4. MultiLineString

{
  "type": "MultiLineString",
  "coordinates": [
    [[-73.98, 40.74], [-73.97, 40.75]],
    [[-73.96, 40.76], [-73.95, 40.77]]
  ]
}

5. Polygon

An array of linear rings. The first element is the exterior ring, and any subsequent elements are interior rings (holes):

{
  "type": "Polygon",
  "coordinates": [
    [
      [-73.98, 40.74],
      [-73.96, 40.74],
      [-73.96, 40.76],
      [-73.98, 40.76],
      [-73.98, 40.74]
    ]
  ]
}

6. MultiPolygon

{
  "type": "MultiPolygon",
  "coordinates": [
    [
      [[-73.98, 40.74], [-73.96, 40.74], [-73.96, 40.76], [-73.98, 40.74]]
    ],
    [
      [[-73.95, 40.77], [-73.94, 40.77], [-73.94, 40.79], [-73.95, 40.77]]
    ]
  ]
}

7. GeometryCollection

{
  "type": "GeometryCollection",
  "geometries": [
    { "type": "Point", "coordinates": [-73.98, 40.74] },
    { "type": "LineString", "coordinates": [[-73.98, 40.74], [-73.96, 40.76]] }
  ]
}

3. Features vs FeatureCollections

While naked geometries describe pure shapes, real-world GIS data requires associating geometries with tabular metadata (e.g. name, population, speed limit, status). GeoJSON achieves this through Feature and FeatureCollection wrappers.

The Feature Object

A Feature combines a single geometry with an arbitrary dictionary of properties:

{
  "type": "Feature",
  "id": "parc-10482",
  "geometry": {
    "type": "Point",
    "coordinates": [-73.9851, 40.7488]
  },
  "properties": {
    "name": "Empire State Building",
    "category": "Landmark",
    "height_meters": 381,
    "year_built": 1931
  }
}

The FeatureCollection Object

The standard root wrapper for publishing multi-record spatial datasets:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [-73.98, 40.74] },
      "properties": { "name": "Site Alpha" }
    },
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [-73.96, 40.76] },
      "properties": { "name": "Site Beta" }
    }
  ]
}

4. Coordinate Ordering: The [Longitude, Latitude] Rule

CRITICAL RULE: In GeoJSON (RFC 7946 Section 3.1.1), coordinates MUST always be written as [Longitude, Latitude] (or [X, Y]). Never write [Latitude, Longitude].

Because humans speak "Latitude and Longitude" colloquially (e.g. "40.71° North, 74.00° West"), developers frequently invert coordinates, writing [40.71, -74.00]. When parsed by standard web map libraries like Leaflet or Mapbox, this inverted point lands in Antarctica or off the coast of Somalia!

Memory Trick: Think of standard Cartesian coordinates: X (horizontal axis / West-East / Longitude) comes before Y (vertical axis / South-North / Latitude).

5. Polygon Ring Orientation & Right-Hand Rule

RFC 7946 introduced the strict Right-Hand Rule for polygon winding orientation:

  • Exterior Rings: Must wind counter-clockwise (CCW). When walking along the boundary vertices in order, the interior of the polygon is always to your left.
  • Interior Rings (Holes): Must wind clockwise (CW).

Why does this matter? On a spherical globe, an un-oriented polygon ring could represent either a small parcel of land OR the entire rest of the planet with a parcel-sized hole cut out! Strict winding order disambiguates which surface is inside versus outside.

6. Bounding Boxes (bbox) for Fast Spatial Indexing

Any GeoJSON object can include an optional "bbox" member to accelerate spatial filtering, map zooming, and viewport bounds calculation:

{
  "type": "FeatureCollection",
  "bbox": [-74.05, 40.70, -73.90, 40.85],
  "features": [ ... ]
}

For 2D geometries, the array structure is [minX, minY, maxX, maxY] (Southwest Longitude, Southwest Latitude, Northeast Longitude, Northeast Latitude).

7. Coordinate Precision & File Size Optimization

A common mistake in GIS web export is outputting coordinates with 14 decimal digits of floating-point precision:

// Inefficient (bloats JSON payload):
[-73.98513082719482, 40.74881729481726]

// Optimized (saves ~60% file size):
[-73.98513, 40.74882]
Decimal Places Ground Resolution at Equator Typical Use Case
2 decimal places ~1.1 km State or large regional boundaries
4 decimal places ~11 meters Neighborhoods, streets, city blocks
5 decimal places ~1.1 meters Property boundaries, building footprints
6 decimal places ~0.11 meters (11 cm) High-precision survey and utility mapping
7+ decimal places Millimeters to micrometers Unnecessary web bloat (tectonic plate shift level)

8. GeoJSON vs TopoJSON: When to Use Which?

While GeoJSON is the universal standard for geographic data exchange, TopoJSON is an extension that encodes topology:

  • GeoJSON: Stores complete coordinate rings independently. If two country polygons share a border (e.g. US and Canada), that shared boundary is duplicated in both polygons.
  • TopoJSON: Stores shared boundaries once as "arcs" and references them by index. This eliminates redundancy and allows file size reductions of 70% to 80% for boundary-heavy datasets.

9. Inspecting GeoJSON in Spatial-Sandbox

Test and debug your GeoJSON payloads instantly:

  • GeoJSON Visualizer — Upload or paste any GeoJSON payload to inspect attributes, examine coordinate winding, and colorize features.
  • WKT Viewer & Plotter — Convert between GeoJSON and Well-Known Text formats with a single click.