What is GeoJSON?

GeoJSON is a standard format for encoding geographic data structures using JSON (JavaScript Object Notation). It represents simple geographical features like points, lines, and polygons, along with their properties. Think of it as a way to describe locations, routes, boundaries, and areas on a map in a format that computers can easily read and display. GeoJSON is widely used in web mapping applications, GIS software, and location-based services because it's human-readable, lightweight, and works seamlessly with modern web technologies.

How does GeoJSON work?

GeoJSON organizes geographic data into features, where each feature has a geometry (the shape and coordinates) and optional properties (descriptive information). The geometry types include Point (a single location), LineString (a connected path), Polygon (an enclosed area), and their multi-part variants. Coordinates are stored as longitude-latitude pairs in decimal degrees. This standardized structure allows different mapping tools and applications to interpret and display the same geographic data consistently, making GeoJSON a universal language for sharing location information.

Tool description

The GeoJSON Viewer is an interactive tool that visualizes GeoJSON data on a map. Upload a GeoJSON file or paste JSON code directly to see your geographic features rendered on an interactive Leaflet map. The tool automatically calculates statistics including the number of features and total distance for LineString geometries.

Features

  • Multiple Input Methods: Upload GeoJSON files (.json, .geojson, .geojsonl) or paste JSON code directly
  • Interactive Map Visualization: View geographic features on an interactive Leaflet map with zoom and pan controls
  • Automatic Statistics: Displays feature count and calculated distances for line geometries
  • Distance Calculation: Computes total distance for LineString and MultiLineString features in both kilometers and miles using the Haversine formula
  • Smart Centering: Automatically centers the map on your first feature for optimal viewing
  • GeoJSON Validation: Validates input to ensure proper GeoJSON FeatureCollection format
  • Multiple Geometry Support: Handles Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon geometries
  • Error Handling: Provides clear error messages for invalid files or malformed JSON

Use Cases

  • Route Visualization: Display GPS tracks, hiking trails, or delivery routes on a map
  • Boundary Mapping: Visualize geographic boundaries like city limits, districts, or property lines
  • Data Analysis: Quickly inspect GeoJSON data to verify coordinates and feature properties
  • GIS Development: Test and preview GeoJSON files during development of mapping applications
  • Location Planning: Visualize multiple points of interest or locations for trip planning
  • Geographic Data Validation: Verify that exported GeoJSON from other tools renders correctly
  • Distance Measurement: Calculate the total length of routes or paths in your GeoJSON data
  • Educational Purposes: Learn about GeoJSON structure by visualizing real geographic data