Geospatial Data Formats Guide: Shapefile vs GeoJSON vs KML vs GPX vs WKT

A comprehensive architectural evaluation of spatial vector formats, comparing encoding models, attribute capabilities, performance limits, and conversion workflows.

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

1. The Landscape of GIS Vector Formats

Geographic Information Systems (GIS) rely on digital file formats to record points, lines, polygons, and their associated metadata. However, no single format is optimal for all situations: desktop spatial analysis demands raw binary speed and indexed random access, web applications demand lightweight text easily parsed by browser engines, and mobile fitness tracking demands compact time-series elevation streams.

2. Master Comparison Matrix

Feature GeoJSON ESRI Shapefile KML / KMZ GPX WKT
Encoding JSON text (UTF-8) Binary + dBASE IV XML text (zipped in KMZ) XML text Plain ASCII text
Standard IETF RFC 7946 Proprietary (ESRI, 1992) OGC Standard Topografix XML schema OGC Simple Features
Web Native Yes (Native JS) No (requires parser) Partial (Google Earth) No (requires parser) Partial (text string)
Attributes Arbitrary nested JSON Flat 10-char DBF columns HTML balloon markup GPS telemetry only None (geometry only)
Styling Simplestyle spec External (.sld, .qml) Embedded KML styles None None
Size Limit Unlimited (browser memory) 2 GB hard limit Unlimited Unlimited Unlimited
Coordinate System WGS 84 (EPSG:4326) only Any (.prj file) WGS 84 only WGS 84 only Defined by context/SRID

3. ESRI Shapefile (.shp, .shx, .dbf)

Developed by ESRI in the early 1990s for ArcView GIS, the Shapefile remains the most widely circulated legacy GIS format. A "shapefile" is not a single file, but a bundle of at least three mandatory files sharing the same prefix:

  • .shp — Stores geometric shape coordinates in binary format.
  • .shx — Spatial index of geometry offsets for quick seeking.
  • .dbf — dBASE IV tabular database containing attributes.
  • .prj (Optional but critical) — Plain text WKT projection definition.

Shapefile Limitations to Keep in Mind:

  1. Hard 2 GB maximum file size on each component (.shp and .dbf).
  2. Column names in .dbf are strictly truncated to 10 characters.
  3. Text values are capped at 254 characters per cell.
  4. No support for modern nested structures, dates with timestamps, or Unicode UTF-8 in older desktop versions.

4. GeoJSON (RFC 7946)

GeoJSON is the crown jewel of web GIS. Because it is standard JSON, any JavaScript runtime can parse it with JSON.parse() with zero third-party dependencies.

Key Advantages:

  • Web Developer Friendly: Seamless integration with React, Vue, Svelte, Node.js, and Leaflet.
  • Flexible Properties: The properties object can hold nested arrays, dictionaries, boolean values, or rich text.
  • Human Readable: Easy to inspect, version control with Git, and edit in any code editor.

5. KML / KMZ (Keyhole Markup Language)

Originally authored by Keyhole Inc. (acquired by Google in 2004) to power Google Earth, KML is an XML-based language for geographic visualization. KMZ is a standard ZIP archive containing a primary doc.kml file and associated assets (icons, images, 3D Collada models).

KML's unique strength is that it couples geometry with visual presentation: you can specify icon URLs, line widths, fill transparencies, camera viewpoints (heading, tilt, altitude), and HTML popup balloons directly within the file.

6. GPX (GPS Exchange Format)

GPX is an XML schema created by Topografix for exchanging GPS data between navigation hardware and sports software (e.g. Garmin, Strava, Apple Health).

GPX structures data into three specific spatial elements:

  • <wpt> (Waypoint): A single marked point of interest with elevation and name.
  • <rte> (Route): An ordered list of turn-by-turn navigation points.
  • <trk> (Track): A recorded breadcrumb path made of <trkpt> elements with timestamp (<time>), elevation (<ele>), speed, and heart rate telemetry.

7. WKT (Well-Known Text)

WKT is an OGC standard representing pure spatial geometry in concise text. Because WKT carries zero overhead (no attribute tables, no styling, no XML tags), it is the premier format for database queries, spatial indexing, and debugging.

8. Format Selection Recommendations by Use Case

  1. Building a Web Map or REST API: Use GeoJSON (or Mapbox Vector Tiles for datasets > 5 MB).
  2. Querying Spatial Databases (PostGIS, Snowflake): Use WKT or binary WKB.
  3. Exporting for Google Earth or 3D Flights: Use KMZ.
  4. Fitness Tracking & GPS Outdoor Trails: Use GPX.
  5. Sharing with Traditional Surveyors / CAD / Desktop GIS: Use Shapefile (or modern GeoPackage).

Visualize & Validate: Paste or upload your WKT and GeoJSON files in Spatial-Sandbox WKT Viewer or GeoJSON Viewer to render them immediately on interactive satellite and street maps.