How to View GeoJSON on a Map

Published · Last updated

Inspect location datasets visually before using them in a transport system, web application, API integration or GIS project.

Try it now: Interactive GeoJSON viewer and editor

Before you start

GeoJSON is a popular format for storing geographic features such as locations, roads, administrative boundaries and delivery areas. However, geographic coordinates are not particularly easy to interpret when looking at a JSON document.

Visualizing GeoJSON on a map makes it easier to understand the geographic distribution of features, identify incorrect coordinates and inspect individual geometries.

In a transport workflow, this can be a quick check that delivery points cluster in the expected area, a route LineString follows the supplied coordinates, or a service-area polygon covers the intended region. Visual inspection does not establish that a route is drivable or that an address match is exact.

You can use the GeoJSON viewer to load geographic data and display it on an interactive map.

Before loading your data, make sure it is valid GeoJSON. If necessary, use the GeoJSON validator to identify structural and syntax errors.

GeoJSON geometry types

GeoJSON supports several geometry types. Each type represents a different kind of geographic feature.

  • Point: Represents a single geographic location, such as a warehouse or delivery address.
  • MultiPoint: Represents multiple individual locations.
  • LineString: Represents a connected line, such as a road or transport route.
  • MultiLineString: Represents several connected or separate lines.
  • Polygon: Represents an area, such as a building footprint or administrative boundary.
  • MultiPolygon: Represents multiple polygon areas, such as a collection of islands.
  • GeometryCollection: Contains multiple geometries that can have different geometry types.

A map viewer uses these geometry types to determine how each feature should be displayed.

Worked example

Consider a GeoJSON FeatureCollection containing three delivery locations. Each point has a name stored in its properties.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Warehouse"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [12.5683, 55.6761]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "name": "Delivery Point 1"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [12.5500, 55.6900]
      }
    },
    {
      "type": "Feature",
      "properties": {
        "name": "Delivery Point 2"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [12.5900, 55.6600]
      }
    }
  ]
}

When displayed on a map, the three points should appear around Copenhagen. Their properties can be used to identify which location each point represents.

Notice that the coordinates are written as longitude followed by latitude. GeoJSON does not use latitude-first coordinate order.

Step-by-step visualization

  1. Open the GeoJSON viewer.
  2. Prepare your GeoJSON as a Feature or FeatureCollection.
  3. Load or paste the GeoJSON using the viewer's input functionality.
  4. Inspect the resulting features on the interactive map.
  5. Zoom in and out to examine the geographic distribution of the data.
  6. Select individual features where supported to inspect their geometry and properties.
  7. Use the available editing functionality to modify or simplify the data if required.
  8. Export or download the resulting GeoJSON when you are finished.

Inspecting geographic data

Visual inspection is an important part of working with geospatial data. A GeoJSON document can be structurally valid but still contain incorrect geographic information.

Pay particular attention to the following:

  • Geographic location: Verify that features appear in the expected country, city or region.
  • Coordinate order: GeoJSON uses longitude followed by latitude.
  • Geometry: Check that polygons, lines and points are represented correctly.
  • Feature distribution: Look for unexpected gaps, duplicates or features far away from the expected area.
  • Properties: Verify that important feature attributes are present.

For larger datasets, consider using the viewer's editing and simplification functionality to work with the geometry more efficiently.

Common problems

  • Nothing appears on the map. Check whether the GeoJSON contains valid geometries and whether the coordinates are within valid geographic ranges.
  • Features appear in the wrong country. Check that longitude and latitude have not been reversed.
  • Coordinates are outside the expected area. The source may use a projected coordinate system instead of WGS84.
  • Polygons look incorrect. Check the polygon coordinate structure, ring closure and geometry validity.
  • The GeoJSON cannot be loaded. Validate the source using the GeoJSON validator and fix any reported errors.

Viewing GeoJSON on a map is a useful way to verify geographic data before using it in a web application, GIS project or transport system.

If the data came from a GIS export, see converting Shapefile to GeoJSON. To check its extent, use the GeoJSON bounding-box guide; to exchange the data with another mapping application, see GeoJSON to KML.

Tools used in this guide

Related guides

Browse all technical guides