Download & CDN¶
There are several ways to get the data. They are not interchangeable.
jsDelivr CDN¶
Fast, globally cached, correct CORS headers — when it serves the repository.
jsDelivr may refuse this repository
jsDelivr documents two limits for its GitHub endpoint: 20 MB per file
and 150 MB per repository. Every file under data/ is under the first
— the largest is 14.9 MB, and levels that would exceed it are split by
ADM1. The repository as a whole currently exceeds the second, so jsDelivr
may refuse it. Treat the CDN as an optimisation to try, not a dependency:
raw GitHub URLs are the reliable path today, and the
Release assets are the pinned download.
The legacy 72 MB comunas.geojson in the repository root is above the
per-file limit regardless. Use data/earth/CHL/CHL_ADM3.geojson.
Pin a tag in production. @main follows the default branch, so a boundary
correction merged upstream changes what your application receives, silently.
v1.3.0 is the latest data release — see
Versioning & stability. The per-country zips
attached to its GitHub Release are the recommended pinned download.
Raw GitHub¶
Works for files of any size and sends Access-Control-Allow-Origin: *, so
browser fetch works. But it is not a CDN: no edge caching, and it is
rate-limited. Fine for development, scripts and server-side downloads; poor for
production browser traffic.
The same URL with a tag in place of main pins a data version:
Release assets¶
Every tag vX.Y.Z publishes a GitHub Release with the data as downloadable
assets — the bulk and offline channel, and the fallback when a CDN refuses the
repository for its size:
| Asset | Contents |
|---|---|
world-geojson-vX.Y.Z-{ISO3}.zip |
One per territory: the country folder with its files, manifest.json and preview/ |
world-geojson-vX.Y.Z-all.zip |
Everything under data/ |
index.json |
The global index |
SHA256SUMS |
Hashes of every asset |
The first was v1.0.0, tagged from the merge of the data contract; the
latest is v1.3.0, which adds Asia and Oceania:
https://github.com/andresgmg/World-GeoJSON/releases/tag/v1.3.0. The release
notes are the matching section of the Changelog.
The global index¶
Fetch data/index.json first and only then the files you need: it lists every
territory and dataset with path, bytes, sha256, bbox and licence, and
embeds every manifest, in about 1 MB (130 KB gzipped). It is served from the same
URLs as the data —
— and attached to every release. Its shape, and snippets that use it, are on Global index & schemas.
Previews¶
For a map in a browser you rarely want the full file. Every dataset has a simplified companion at
— at most 2 MB and usually a few hundred KB, coordinates at four decimals, and
only shapeName, shapeISO and shapeType — served from the same URLs as
the full files and fine to load directly. Chile's 345 communes are 425 KB as a
preview against 7 MB in full.
Git¶
For working with the data locally or in a pipeline.
The repository's pack is about 126 MiB and the working tree about 550 MB —
400 MB under data/ and most of the rest the four legacy files in the root.
A full clone is not enormous, but a sparse checkout of one country is a lot
smaller.
git clone --filter=blob:none --sparse https://github.com/andresgmg/World-GeoJSON.git
cd World-GeoJSON
git sparse-checkout set data/earth/CHL
--filter=blob:none makes the clone fetch file contents lazily, so you
download only the blobs you actually check out.
git clone --filter=blob:none --no-checkout https://github.com/andresgmg/World-GeoJSON.git
cd World-GeoJSON
git sparse-checkout set --no-cone '/*' '!/data/**' '/data/**/manifest.json'
git checkout main
Gets every manifest without a single GeoJSON file. This is exactly what this site's CI does — the documentation build reads manifests only.
Checksums¶
Each catalog page shows the first 16 hex characters of the file's SHA-256; the
full hash is in the country's manifest.json — and therefore in
data/index.json — as datasets[].sha256 and, for split levels,
parts[].sha256. Release assets come with a SHA256SUMS that
sha256sum -c SHA256SUMS checks in one go, and a full checkout is verified
with wgj validate --checksums, which re-hashes every file
against its manifest. Verify a single download with:
Line endings will break your checksum
Git normalises line endings on checkout. On Windows a .geojson checked
out as CRLF is one byte per line larger than the same file on Linux — for
the legacy 72 MB comunas.geojson, with one coordinate per line, that is
a 1.8 MB difference and a completely different hash.
The repository's .gitattributes pins *.geojson to LF precisely so that
published checksums match everywhere. If your hash disagrees, check
git config core.autocrlf before assuming the file is corrupt.