Stratoscale commited on
Commit
c295d2b
·
verified ·
1 Parent(s): 2cf6dfa

Add GeoNames postal codes Parquet (1.83M rows, 121 countries) and dataset card

Browse files
Files changed (2) hide show
  1. README.md +86 -1
  2. postal_codes.parquet +3 -0
README.md CHANGED
@@ -1,3 +1,88 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ pretty_name: GeoNames Postal Codes (Parquet)
4
+ tags:
5
+ - geospatial
6
+ - postal-codes
7
+ - pincode
8
+ - geocoding
9
+ - geonames
10
+ size_categories:
11
+ - 1M<n<10M
12
+ configs:
13
+ - config_name: default
14
+ data_files: postal_codes.parquet
15
  ---
16
+
17
+ # GeoNames Postal Codes — Parquet
18
+
19
+ The [GeoNames postal code dataset](https://download.geonames.org/export/zip/)
20
+ (`allCountries.txt`) converted to a single sorted, zstd-compressed Parquet file.
21
+ It is used as a postcode → lat/lon lookup table for joining tabular locations
22
+ onto gridded weather data (e.g. ERA5 Zarr) in
23
+ [zarr-datafusion](https://github.com/stratoscale-io/zarr-datafusion).
24
+
25
+ | | |
26
+ |---|---|
27
+ | Rows | 1,826,904 (one row per **place**, not per postcode) |
28
+ | Distinct `(country_code, postal_code)` | 1,080,715 |
29
+ | Countries | 121 |
30
+ | File | `postal_codes.parquet`, ~19 MB, zstd(3), sorted by `country_code, postal_code, place_name` |
31
+ | Source snapshot | GeoNames export of 2026-09-22 |
32
+
33
+ ## Schema
34
+
35
+ | column | type | nullable | notes |
36
+ |---|---|---|---|
37
+ | `country_code` | string | no | ISO 3166-1 alpha-2 |
38
+ | `postal_code` | string | no | text — many countries use letters (`EC1A`, `100-0001`) |
39
+ | `place_name` | string | yes | locality / post office |
40
+ | `admin_name1` / `admin_code1` | string | yes | state / province |
41
+ | `admin_name2` / `admin_code2` | string | yes | county / district |
42
+ | `admin_name3` / `admin_code3` | string | yes | community / sub-district |
43
+ | `latitude`, `longitude` | float64 | no | WGS84 decimal degrees |
44
+ | `accuracy` | int8 | yes | 1 = estimated, 4 = GeoNames place id, 6 = centroid of addresses or shape |
45
+
46
+ ## Caveats
47
+
48
+ - **One row per place.** A postcode can have many rows (Delhi `110001` has 21);
49
+ collapse to one point per `(country_code, postal_code)` before joining.
50
+ - **`accuracy` describes the method, not the error.** Countries without published
51
+ postal geometry are geocoded by place name. India, for example, has no
52
+ accuracy-6 rows, and over 100 Bengaluru `560xxx` pincodes share one fallback
53
+ district point ~28 km north of the city centre — including rows marked 4.
54
+ - **UK, Canada and the Netherlands** are outward/short codes only here; GeoNames
55
+ publishes full codes separately (`GB_full`, `CA_full`, `NL_full`), not included.
56
+
57
+ ## Usage
58
+
59
+ Direct HTTPS (supports range requests):
60
+
61
+ ```
62
+ https://huggingface.co/datasets/Stratoscale/GeoNamesPincode/resolve/main/postal_codes.parquet
63
+ ```
64
+
65
+ ```python
66
+ import duckdb
67
+ duckdb.sql("""
68
+ SELECT * FROM 'hf://datasets/Stratoscale/GeoNamesPincode/postal_codes.parquet'
69
+ WHERE country_code = 'IN' AND postal_code = '110001'
70
+ """)
71
+ ```
72
+
73
+ ## Reproduce
74
+
75
+ ```bash
76
+ curl -O https://download.geonames.org/export/zip/allCountries.zip
77
+ unzip allCountries.zip allCountries.txt
78
+ zarr-cli cookbook/pincode-lookup/build_postcodes.sql
79
+ ```
80
+
81
+ ## License and attribution
82
+
83
+ Licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), the
84
+ license of the source data. Contains data from
85
+ [GeoNames](https://www.geonames.org/) (© GeoNames, CC BY 4.0). The data is
86
+ provided "as is" without warranty of accuracy, timeliness or completeness.
87
+ Changes from the source: converted from TSV to Parquet, typed columns, sorted;
88
+ no rows added, removed or modified.
postal_codes.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f9273a1d4b75ab11b980a284557ba42414975fe4846b8ac6b646f046a302c46
3
+ size 20177129