How to open a GeoJSON file on a Mac
A .geojson file is plain text, so any editor will open
it. That is rarely what you want: the attributes are buried in nested
JSON, and a large one is a single line thousands of characters wide.
What is inside a GeoJSON file
GeoJSON is JSON with a fixed shape. A FeatureCollection holds
a list of features, and each feature has a geometry (a point,
line or polygon, as longitude and latitude pairs) and a
properties object with everything else: names, ids, counts.
Most questions about a GeoJSON file are really questions about those properties. How many features are there, which ones have a given value, which are largest. That makes it a table with a geometry column, and a table is easiest to read in a grid.
Ways to open one
DuckDB's command line (free)
DuckDB reads every format on this page through its spatial extension, which the command line downloads the first time you ask for it:
brew install duckdb
duckdb -c "INSTALL spatial; LOAD spatial; SELECT * FROM ST_Read('parks.geojson') LIMIT 20"
GDAL's ogrinfo (free)
GDAL is the library almost every GIS tool reads files through, and its command-line tools describe a file without opening anything else:
brew install gdal
ogrinfo -so -al parks.geojson
That prints the layer, the coordinate system, the extent and the field types. It is a summary, not a table you can scroll.
QGIS (free)
The full open-source desktop GIS. If you need to see the shapes on a map, style them or edit them, this is the right tool, and it is free. It is a lot of application to start if all you wanted was to read the attribute table.
Python
geopandas.read_file('parks.geojson') gives you a GeoDataFrame,
and is the right answer when the next step is code. It loads the whole
file into memory.
Doing it in Datapuddle
Datapuddle is a Mac app with DuckDB and its spatial extension compiled in, so a GeoJSON file opens the same way a CSV does.
- Double-click the file in Finder, drag it onto the app icon, or use File ▸ Open….
- Each feature becomes a row and each property a
column. The geometry column shows as readable text, such as
POLYGON ((-73.98 40.76, …)). - The editor is filled in with
SELECT * FROM ST_Read('…')for that file, so the next query is an edit, not a blank page.
From there it is SQL. To rank features by their real area in square kilometres:
SET geometry_always_xy = true;
SELECT name, ST_Area_Spheroid(geom) / 1e6 AS km2
FROM ST_Read('parks.geojson')
ORDER BY km2 DESC;
The SET line tells DuckDB the coordinates are longitude,
latitude, as they always are in GeoJSON. Leave it out and the areas
come out wrong, or as NaN.
Every column header draws its own distribution and null share, so a property that is missing on half the features shows before you write a query to find out.
Which to use
- Seeing it on a map: QGIS.
- A quick summary:
ogrinfo. - Feeding a pipeline: geopandas.
- Reading and querying the attributes: something with a grid and SQL, which is what Datapuddle is.
Datapuddle on the Mac App Store — 7 day trial, then $39.99 once. Apple silicon, macOS 26 or later. · Docs Guides · Home