Guide - Geospatial File Format Selection

Overview

Selecting the right geospatial file format depends on your use case: web display, analysis, archival, or data exchange. This guide helps you choose the optimal format for your needs.

Quick Decision Matrix

Vector Data

Use CaseRecommended FormatAlternatives
Web mappingGeoJSON, FlatGeobufTopoJSON
Database storagePostGIS, GeoPackage-
Data exchangeGeoPackage, GeoJSONShapefile
Analytical processingGeoParquet, GeoPackage-
ArchivalGeoPackageGeoJSON
ArcGIS workflowsFile GeodatabaseShapefile

Raster Data

Use CaseRecommended FormatAlternatives
Cloud storageCloud Optimized GeoTIFF (COG)-
Local analysisGeoTIFF-
Web displayCOG, Tiles (PNG/JPEG)-
Multi-dimensionalNetCDF, ZarrHDF5
Data exchangeGeoTIFF-

Tile Archives

Use CaseRecommended Format
Vector tilesPMTiles, MBTiles
Raster tilesPMTiles, MBTiles
Self-hostedPMTiles (no server needed)

Vector Formats

GeoJSON

Best for: Web applications, API responses, data exchange

AspectDetails
FormatJSON with geometry
SizeLarger (text-based)
StreamingNot natively
CRSWGS84 (EPSG:4326) only per spec
{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [-122.4, 37.8]
  },
  "properties": {
    "name": "San Francisco"
  }
}

GeoPackage

Best for: Desktop GIS, data exchange, archival

AspectDetails
FormatSQLite database
SizeCompact
FeaturesVector + raster, multiple CRS
StandardOGC official

GeoParquet

Best for: Cloud analytics, big data, columnar queries

AspectDetails
FormatApache Parquet with geometry
SizeHighly compressed
StreamingYes (row groups)
Best WithDuckDB, Spark, Arrow

FlatGeobuf

Best for: Web streaming, fast random access

AspectDetails
FormatBinary, seekable
SizeCompact
StreamingYes (HTTP range requests)
Best WithMapLibre, Leaflet

Shapefile (Legacy)

Best for: Legacy compatibility only

AspectDetails
Limitations2GB max, 10-char field names, no NULL, single geometry type
RecommendationMigrate to GeoPackage

Raster Formats

Cloud Optimized GeoTIFF (COG)

Best for: Cloud storage, web access, remote sensing

AspectDetails
FormatGeoTIFF with internal tiles and overviews
AccessHTTP range requests
Best WithSTAC catalogs, cloud storage

NetCDF / Zarr

Best for: Multi-dimensional data (climate, oceanography)

AspectDetails
NetCDFMature, widespread support
ZarrCloud-native, chunked arrays
DimensionsTime, depth, bands, etc.

Tile Formats

PMTiles

Best for: Serverless tile hosting

AspectDetails
FormatSingle-file tile archive
HostingStatic file hosting (S3, CloudFlare)
TypesVector (MVT) and raster

MBTiles

Best for: Tile archives with server

AspectDetails
FormatSQLite container
ServerRequires tile server

Mapbox Vector Tiles (MVT)

Best for: Web map rendering

AspectDetails
FormatProtocol Buffers
StandardOGC Community Standard
Best WithMapLibre, Mapbox

Format Conversion

Using GDAL/OGR

# shapefile to geopackage
ogr2ogr -f GPKG output.gpkg input.shp
 
# geojson to geoparquet
ogr2ogr -f Parquet output.parquet input.geojson
 
# geotiff to cog
gdal_translate -of COG input.tif output_cog.tif

Using R

library(sf)
 
# read shapefile, write geopackage
sf::st_read("input.shp") |>
  sf::st_write("output.gpkg")
 
# read, write geoparquet
sfarrow::st_read_parquet("input.parquet") |>
  sfarrow::st_write_parquet("output.parquet")

Using Python

import geopandas as gpd
 
# read shapefile, write geoparquet
gdf = gpd.read_file("input.shp")
gdf.to_parquet("output.parquet")

Format Comparison

FormatTypeSizeStreamingCloud-NativeStandard
GeoJSONVectorLargeNoNoIETF RFC
GeoPackageVector/RasterMediumNoNoOGC
GeoParquetVectorSmallYesYesCommunity
FlatGeobufVectorSmallYesYesCommunity
ShapefileVectorMediumNoNoDe facto
COGRasterMediumYesYesOGC
PMTilesTilesSmallYesYesCommunity

Notes

  • Default choice for vector: GeoPackage (most compatible)
  • Cloud analytics: GeoParquet with DuckDB
  • Web streaming: FlatGeobuf or PMTiles
  • Raster in cloud: Always use COG
  • Avoid Shapefile for new projects

Appendix

Created: 2024-12-22 | Modified: 2024-12-22

See Also


(c) No Clocks, LLC | 2024