Skip to content

File & folder naming

The canonical path

data/{body}/{CODE}/{CODE}_{LEVEL}.geojson
Segment Rule Example
body Lowercase body name earth, moon, mars
CODE Uppercase ISO 3166-1 alpha-3, or a body-specific code CHL, NZL, MARS
LEVEL ADM0–ADM5, or QUAD for planetary quadrangles ADM2

Worked example — this is what data/earth/CHL/ actually contains:

data/
├─ index.json                   # global index: every manifest, embedded
└─ earth/
   └─ CHL/
      ├─ manifest.json
      ├─ CHL_ADM0.geojson          # country outline (Natural Earth)
      ├─ CHL_ADM1.geojson          # 16 regiones
      ├─ CHL_ADM2.geojson          # 56 provincias
      ├─ CHL_ADM3.geojson          # 345 comunas, whole country
      ├─ ADM3/                     # …and split by region
      │  ├─ CL-AI.geojson
      │  ├─ CL-AN.geojson
      │  ├─ CL-AP.geojson
      │  └─ … (16 files)
      └─ preview/
         ├─ CHL_ADM0.preview.geojson
         ├─ CHL_ADM1.preview.geojson
         ├─ CHL_ADM2.preview.geojson
         └─ CHL_ADM3.preview.geojson

Gaps in the level sequence are expected and allowed — name each file for the level it actually represents rather than renumbering to close the gap. Guadeloupe and Martinique ship GLP_ADM4.geojson and MTQ_ADM4.geojson with nothing between ADM0 and ADM4, because that is the level at which geoBoundaries publishes their communes.

The municipal level is split by ADM1, when an ADM1 exists

The deepest level this project publishes is the municipal tier. (Intermediate levels above it are small and always ship as one whole-country file.) Wherever the country also has an ADM1 in this repository, that tier is split into one file per ADM1 parent:

data/{body}/{CODE}/{LEVEL}/{ADM1 code}.geojson

Brazil has 5,570 municipalities and Mexico 2,457; a single file per country would be tens of megabytes and unusable in a browser. Splitting by first-level division keeps every file small, lets consumers fetch only the state they care about, and keeps everything inside the per-file size budget.

Split levels exist today for AGO, ARG, BDI, BEL, BEN, BFA, BGR, BIH, BLR, BLZ, BOL, BRA, CAF, CHL, CIV, DEU, DJI, DNK, DOM, ECU, ESP, FRA, GBR, GIN, GMB, GRC, IRL, ITA, LBR, MEX, MKD, MLI, NGA, NLD, NOR, PRY, ROU, RWA, SDN, SEN, SLE, SSD, SWE, USA, ZAF, ZMB and ZWE.

Forty territories have a municipal tier but no ADM1 to split it by, so they ship the whole-country file only: BWA, COD, COG, COL, COM, CRI, EGY, ERI, GAB, GHA, GLP, GNQ, GTM, GUF, GUY, HND, HTI, ISL, LSO, LUX, MDG, MOZ, MRT, MTQ, MWI, MYT, NER, PAN, PRI, PRT, REU, SLV, SOM, SUR, SYC, TCD, TZA, UGA, UKR and VIR. (Most of these are countries whose geoBoundaries ADM1 is copyleft; see the Roadmap.)

Part codes

The part code is the ADM1 unit's key — its shapeISO, an ISO 3166-2 code (CL-RM, US-CA) — and it is the same string three times over: the file name, the adm1ISO value on every feature inside the part, and the key of the ADM1's own id (USA:ADM1:US-SD ↔ USA/ADM2/US-SD.geojson). The manifest's parts[].code records the mapping so consumers never have to guess. Two things to know:

  • Documented upstream errors are corrected, not passed through. The corrections live in pipeline/src/wgj/tables/shapeiso_fixes.json and the parts follow them: South Dakota's 66 counties are in USA/ADM2/US-SD.geojson although geoBoundaries codes the state SU-SD; Mexico's MX-CMX.geojson (the 16 alcaldías of Ciudad de México) and Ecuador's EC-X.geojson (the 7 cantons of Cotopaxi) exist because the upstream had given each of those units a neighbour's code, so MX-MEX.geojson now holds the 125 municipios of the State of Mexico and EC-H.geojson the 10 cantons of Chimborazo. See Property dictionary → shapeISO.
  • Units whose parent could not be determined go to {LEVEL}/unassigned.geojson rather than being dropped, with adm1ISO: "unassigned" and no parentID, and the manifest records the count in unassigned. Today: ARG ADM2 (8 — the comunas of Buenos Aires city, which the upstream ADM1 omits), BRA ADM2 (3), USA ADM2 (1) and FRA ADM5 (129 — the communes of the five overseas departments).

The pipeline falls back to a slug of the ADM1 name if the upstream code is empty; no part currently needs it.

The whole-country file is conditional

A combined file (CHL_ADM3.geojson) is published only when it stays under the 18 MiB per-file budget, which keeps it below the 20 MB per-file limit that jsDelivr documents. Above that, only the split files exist, and the dataset's catalog page says so explicitly.

Brazil is the live example: its combined ADM2 would be 33 MB, so data/earth/BRA/ has an ADM2/ folder with 28 parts and no BRA_ADM2.geojson. France's communes are the other: 43 MB in 14 parts (13 regions and unassigned). Chile's communes fit (7 MB), so both forms exist.

So: check the catalog page or the manifest rather than assuming a combined file exists.

parentISO is the immediate parent, not the file key

A commune's parentISO names its province — the immediate parent in the official hierarchy — even though the file it lives in is keyed by region. Those are different things and both are useful, so both are recorded: parentISO for the hierarchy, adm1ISO for the file it belongs to.

Every sub-national feature carries them, in every country: adm1ISO wherever the country has an ADM1 (combined files included), and parentISO together with parentID — the parent's feature id — wherever a parent level is published. Where the parent level is the ADM1, as for US counties, parentISO and adm1ISO coincide. See the Property dictionary.

Rules

  • Files must use the .geojson extension. Not .json.
  • Every country directory must contain a manifest.json (format).
  • Simplified previews must live in preview/ and be named {stem}.preview.geojson.
  • Directory and file names must not contain spaces, accents or non-ASCII characters. Accents belong in property values, never in paths.
  • One administrative level per file. Do not bundle levels into a single FeatureCollection.

Why not .json as well?

The repository root still ships both comunas.geojson and comunas.json, byte-identical. Git stores them as a single blob, so the duplication costs nothing in repository size — but it doubles the working tree, and it makes the catalog ambiguous about which path is canonical. Under data/ there is exactly one file per dataset.

Why ISO 3166-1 alpha-3

Alpha-3 (CHL) rather than alpha-2 (CL):

  • No collisions with subdivision codes. Alpha-2 country codes overlap US state abbreviations and other subnational schemes, which becomes a real problem in a repository that also stores subdivisions.
  • It is what the reference datasets use. geoBoundaries and GADM both key on alpha-3, so cross-referencing against them requires no translation table.
  • More visually distinct in a directory listing of two hundred entries.

The alpha-2 code is still recorded in manifest.json as iso_a2, because many consumers want it.

Territories and dependencies

Some non-sovereign territories have their own alpha-3 code. Use it, and treat them as top-level entries:

Territory Code Not filed under
Puerto Rico PRI USA
Greenland GRL DNK
Hong Kong HKG CHN

Territories without their own alpha-3 code are filed as ADM1/ADM2 features of their administering country, exactly as the upstream source models them. Do not invent codes. If you believe a territory genuinely needs its own entry and has no ISO code, open an issue rather than choosing a code yourself — inventing identifiers is how registries become unusable.

This is where sovereignty disputes surface

Deciding whether a place is a country, a territory or a subdivision is frequently the substance of a political dispute rather than a filing question. This project does not adjudicate. Follow the upstream source, record it in the manifest, and read Disputed boundaries before opening a PR on contested ground.

Planetary paths

The Moon and Mars have no ISO 3166 equivalent — no such registry exists. They use the body's own name as the code, and their features are named from the IAU Gazetteer of Planetary Nomenclature:

data/moon/MOON/MOON_QUAD.geojson
data/mars/MARS/MARS_QUAD.geojson

Body codes are chosen so they can never collide with a real or future ISO alpha-3. See Planetary bodies.