Skip to content
Fundamentals7 min read

CSV vs GeoJSON vs Shapefile: Which Format Should You Ask For?

Four formats, four sets of limitations. Choosing the wrong one loses data silently, which is the worst way to lose it.

Author
HuiTu Technology
Published

When you commission a dataset, the format question usually gets answered in three seconds with whatever the requester's software opens by default. It deserves slightly more thought, because two of the common answers silently damage data.

The practical comparison
CSVGeoJSONShapefileGeoPackage
Geometry supportPoints only, as columnsAll typesOne type per fileAll types
Field name lengthUnlimitedUnlimited10 charactersUnlimited
Multiple layersNoNoNoYes
Coordinate system storedNoAssumed EPSG:4326Yes, in .prjYes
Data types preservedNoPartlyPartlyYes
Files per dataset114 to 71
Practical size ceilingLarge~100 MB in a browser2 GB hard limitVery large

CSV: fine for points, hopeless for anything else

CSV is the right delivery for a point dataset that will be opened in a spreadsheet or loaded into a database. It is universal, diffable and readable by everything. It stores no coordinate system, so anyone receiving it has to assume, and it cannot represent a line or a polygon without resorting to WKT strings in a column, which most spreadsheet users will then break.

GeoJSON: the web default

GeoJSON is plain text, human-readable, supported by every web mapping library and by all modern GIS software. It handles every geometry type and nested attributes. It is the natural answer for anything that will be displayed in a browser or consumed by an API.

Its weakness is size. Coordinates stored as text with excessive precision produce enormous files: the same layer that occupies 40 MB as GeoJSON might be 6 MB as a GeoPackage. Trimming coordinates to six decimal places, which is roughly 10 cm of precision, typically removes a third of the file with no meaningful loss.

# Trim coordinate precision and reproject in one pass
ogr2ogr -f GeoJSON out.geojson in.gpkg \
  -t_srs EPSG:4326 \
  -lco COORDINATE_PRECISION=6

# Anything over ~50 MB should become vector tiles instead
tippecanoe -o out.pmtiles -zg --drop-densest-as-needed out.geojson

Shapefile: still everywhere, still from 1993

The shapefile is not one file but a set of them, and if the .prj or .dbf is missing in transit the data is degraded or unusable. Its two genuinely damaging limitations are worth stating plainly.

  • Field names are truncated to 10 characters. 'population_density' becomes 'population', and if you also have 'population_total' you now have 'populati_1'. Meaning is destroyed silently.
  • There is a 2 GB size limit per file, which large modern layers exceed routinely.
  • Character encoding is not reliably declared, so non-ASCII names arrive corrupted often enough to plan around.
  • Only one geometry type per file, so a mixed layer has to be split.

Ask for shapefiles when your recipient's workflow genuinely requires them, which is still common in engineering and planning environments. When you do, ask for a field-name mapping table alongside, so the truncation is documented rather than discovered.

GeoPackage: the one to prefer

GeoPackage is a single SQLite file that holds multiple layers, preserves field names and types, stores coordinate systems properly and handles very large datasets. It is an OGC standard supported by QGIS, ArcGIS, GDAL, PostGIS and every modern toolchain.

If your recipient's software supports it, GeoPackage is almost always the correct answer for delivery, and GeoJSON is the correct answer for the web layer built from it.

What to ask for, by situation

A simple decision table
SituationAsk for
Points into a spreadsheet or BI toolCSV, plus Excel if identifiers have leading zeros
Web map or APIGeoJSON, or vector tiles above 50 MB
Analysis in QGIS or ArcGISGeoPackage
A colleague insists on shapefilesShapefile plus a field-name mapping table
Loading into a databaseDirect PostGIS load, or GeoPackage
Archiving for reuseGeoPackage plus a plain-text schema description

More from the blog

Keep reading

Next step

Need this done rather than explained?

If the article describes a problem you are facing, tell us the specifics and we will scope it with a fixed price.