Releases: GeoThai/data
Data v4
GeoThai Data - Version 4
Welcome to GeoThai Data Version 4! 🌏📊 This directory contains the ultra-fast lookup optimized version of geographic data for Thailand. Version 4 is specifically designed for maximum performance with denormalized structures, embedded hierarchies, and multiple access patterns.
📁 Directory Structure
geo.json: Complete hierarchical structure with all provinces, districts, and subdistricts embeddedprovinces_flat.json: Provinces keyed by province code with full nested datapostal_lookup.json: Postal codes mapped to complete address informationsearch_index.json: Optimized search index for name-based queriesmetadata.json: Version information and statistics
📊 Data Details
geo.json
File: geo.json
Description: Complete array of all provinces with fully embedded districts and subdistricts. This is the most comprehensive single file for accessing all geographic data.
Example Structure:
[
{
"code": 10,
"name_en": "Bangkok",
"name_th": "กรุงเทพมหานคร",
"name_en_lower": "bangkok",
"name_th_lower": "กรุงเทพมหานคร",
"districts": [
{
"code": 1001,
"name_en": "Phra Nakhon",
"name_th": "พระนคร",
"name_en_lower": "phra nakhon",
"name_th_lower": "พระนคร",
"province_code": 10,
"subdistricts": [
{
"code": 100101,
"name_en": "Phra Borom Maha Ratchawang",
"name_th": "พระบรมมหาราชวัง",
"name_en_lower": "phra borom maha ratchawang",
"name_th_lower": "พระบรมมหาราชวัง",
"district_code": 1001,
"province_code": 10,
"postal_code": 10200
}
// Additional subdistricts...
]
}
// Additional districts...
]
}
// Additional provinces...
]provinces_flat.json
File: provinces_flat.json
Description: Object/map structure with provinces keyed by province code. Each province contains full nested districts and subdistricts for fast O(1) lookups.
Example Structure:
{
"10": {
"code": 10,
"name_en": "Bangkok",
"name_th": "กรุงเทพมหานคร",
"name_en_lower": "bangkok",
"name_th_lower": "กรุงเทพมหานคร",
"districts": [...]
}
// Additional provinces...
}postal_lookup.json
File: postal_lookup.json
Description: Map of postal codes to complete address information. Each postal code includes all associated provinces, districts, and subdistricts.
Example Structure:
{
"10200": {
"postal_code": 10200,
"addresses": [
{
"province_code": 10,
"province_name_en": "Bangkok",
"province_name_th": "กรุงเทพมหานคร",
"district_code": 1001,
"district_name_en": "Phra Nakhon",
"district_name_th": "พระนคร",
"subdistrict_code": 100101,
"subdistrict_name_en": "Phra Borom Maha Ratchawang",
"subdistrict_name_th": "พระบรมมหาราชวัง"
}
// Additional addresses...
]
}
// Additional postal codes...
}search_index.json
File: search_index.json
Description: Optimized search index with lowercase normalized keys for fast name-based lookups. Supports both English and Thai names with case-insensitive matching.
Example Structure:
{
"provinces": {
"bangkok": {
"code": 10,
"name_en": "Bangkok",
"name_th": "กรุงเทพมหานคร"
},
"กรุงเทพมหานคร": {
"code": 10,
"name_en": "Bangkok",
"name_th": "กรุงเทพมหานคร"
}
// Additional province entries...
},
"districts": {
"phra nakhon|10": {
"code": 1001,
"name_en": "Phra Nakhon",
"name_th": "พระนคร",
"province_code": 10
}
// Additional district entries...
},
"subdistricts": {
"phra borom maha ratchawang|1001": {
"code": 100101,
"name_en": "Phra Borom Maha Ratchawang",
"name_th": "พระบรมมหาราชวัง",
"district_code": 1001,
"province_code": 10
}
// Additional subdistrict entries...
}
}Note: District and subdistrict keys include parent codes (e.g., name|province_code for districts) to handle duplicate names across different provinces.
metadata.json
File: metadata.json
Description: Contains version information, update timestamp, and comprehensive statistics.
Example Structure:
{
"version": "4.0.0",
"last_updated": "2025-10-15T11:49:41.851Z",
"source": "GeoThai Team (https://github.com/GeoThai/data.git)",
"stats": {
"provinces": 77,
"districts": 928,
"subdistricts": 7436,
"postal_codes": 954
},
"description": "Version 4: Ultra-fast lookup optimized structure with denormalized data, embedded hierarchies, and multiple access patterns",
"features": [
"Denormalized hierarchical structure for minimal lookups",
"Embedded full province/district/subdistrict relationships",
"Fast postal code to complete address lookup",
"Case-insensitive search index with normalized keys",
"Single-file operations for common queries",
"Pre-computed lowercase keys for search optimization"
]
}📚 Documentation
For more context on the structure and usage of this repository, see the main README. Each schema file can also be used to validate corresponding data programmatically.
📝 License
This dataset is licensed under the MIT License. See the LICENSE file for full terms.
🙋♂️ Contact
Have questions or feedback? Reach out to us at geothai@fasu.dev.
Thank you for using GeoThai Data Version 4! 🚀
Data v3
GeoThai Data - Version 3
Welcome to GeoThai Data Version 3! 🌏📊 This directory contains the latest and most modular version of the geographic data for Thailand. Version 3 introduces schema-based validation and decomposes the dataset into atomic, reusable structures optimized for performance and maintainability.
📁 Directory Structure
Version 3 is composed of structured JSON files, each validated against a corresponding schema. This modular architecture improves reliability and facilitates integration with various applications.
provinces.json: Map of province data keyed by province code.districts.json: Map of district data keyed by district code.subdistricts.json: Map of subdistrict data keyed by subdistrict code.postal_codes.json: Map of postal code data keyed by postal code.- Name maps:
province_name_map.jsondistrict_name_map.jsonsubdistrict_name_map.json
- Index maps:
province_index.jsondistrict_index.jsonsubdistrict_index.jsonpostal_code_map.json
- Metadata:
metadata.json
- Schemas:
- JSON Schema definitions for validation (e.g.,
provinces.schema.json,metadata.schema.json, etc.)
- JSON Schema definitions for validation (e.g.,
📊 Data Details
Provinces
File: provinces.json
Each province entry contains:
code: Integer province codename_en/name_th: English and Thai namesdistricts: List of district codes
Districts
File: districts.json
Each district entry includes:
code: Integer district codeprovince_code: Parent province codename_en/name_th: English and Thai namessubdistricts: List of subdistrict codes
Subdistricts
File: subdistricts.json
Each subdistrict entry includes:
code: Integer subdistrict codedistrict_code: Parent district codeprovince_code: Parent province codename_en/name_th: English and Thai namespostal_code: Associated postal code
Postal Codes
File: postal_codes.json
Each postal code maps to one or more subdistrict codes.
Name Maps
These files provide reverse mappings from Thai or English names to their respective IDs:
Index Maps
These files enable efficient lookup of hierarchical relationships:
province_index.json: List of province codesdistrict_index.json: Districts grouped by province codesubdistrict_index.json: Subdistricts grouped by district codepostal_code_map.json: Subdistricts grouped by postal code
Metadata
File: metadata.json
Contains versioning and summary statistics such as:
{
"version": "3.0.0",
"last_updated": "YYYY-MM-DD HH:MM:SS",
"source": "GeoThai Team (https://github.com/GeoThai/data.git)",
"stats": {
"provinces": 77,
"districts": 928,
"subdistricts": 7436,
"postal_codes": 954
}
}📚 Documentation
For more context on the structure and usage of this repository, see the main README. Each schema file can also be used to validate corresponding data programmatically.
📝 License
This dataset is licensed under the MIT License. See the LICENSE file for full terms.
🙋♂️ Contact
Have questions or feedback? Reach out to us at contact@fasu.dev.
Thank you for using GeoThai Data Version 3! 🚀
Data v2
GeoThai Data - Version 2
Welcome to GeoThai Data Version 2! 🌏📊 This directory contains the updated geographic data for Thailand in Version 2 format. The data is organized into files that offer a more integrated structure with additional postal code information.
📁 Directory Structure
provinces.json: Contains data about Thai provinces, including associated districts.districts.json: Contains data about districts within each province, including associated subdistricts.subdistricts.json: Contains data about subdistricts within each district.postal_codes.json: Contains data about postal codes and their associated areas.metadata.json: Provides metadata for this version of the data.
📊 Data Details
Provinces
File: provinces.json
Description: This file includes details about each province in Thailand, along with the IDs of districts within each province.
Example Structure:
[
{
"id": 10,
"en": "Bangkok",
"th": "กรุงเทพมหานคร",
"districts": [1001, 1002, 1003]
}
// Additional provinces...
]Districts
File: districts.json
Description: This file contains information about districts within each province, including the IDs of subdistricts within each district.
Example Structure:
[
{
"id": 1001,
"province_id": 10,
"en": "Phra Nakhon",
"th": "พระนคร",
"subdistricts": [100101, 100102, 100103]
}
// Additional districts...
]Subdistricts
File: subdistricts.json
Description: This file provides details about subdistricts within each district.
Example Structure:
[
{
"id": 100101,
"district_id": 1001,
"en": "Phra Borom Maha Ratchawang",
"th": "พระบรมมหาราชวัง",
"postal_code": 10200
}
// Additional subdistricts...
]Postal Codes
File: postal_codes.json
Description: This file includes postal codes and the areas (subdistrict IDs) associated with each postal code.
Example Structure:
[
{
"postal_code": 10200,
"areas": [100101, 100102, 100201]
},
{
"postal_code": 10300,
"areas": [100202, 100203, 100301]
}
// Additional postal codes...
]Metadata
File: metadata.json
Description: This file contains metadata about the dataset, including version information, last update timestamp, and total counts.
Example Structure:
{
"version": "2.0.0",
"last_updated": "YYYY-MM-DD HH:MM:SS",
"source": "GeoThai Team (https://github.com/GeoThai/data.git)",
"total_provinces": 77,
"total_districts": 928,
"total_subdistricts": 7436,
"total_postal_codes": 954
}📚 Documentation
For more details on the overall repository and other versions of the data, visit the main GeoThai Data README.
📝 License
This dataset is licensed under the MIT License. See the LICENSE file in the root directory for more details.
🙋♂️ Contact
For any questions or feedback, please reach out to us at contact@fasu.dev.
Thank you for using GeoThai Data Version 2! 🌟
Data v1
GeoThai Data - Version 1
Welcome to GeoThai Data Version 1! 🌏📊 This directory contains geographic data for Thailand in Version 1 format. The data is organized into separate JSON files for provinces, districts, and subdistricts.
📁 Directory Structure
provinces.json: Contains data about Thai provinces.districts.json: Contains data about districts within each province.subdistricts.json: Contains data about subdistricts within each district.metadata.json: Provides metadata for this version of the data.
📊 Data Details
Provinces
File: provinces.json
Description: This file includes details about each province in Thailand.
Example Structure:
[
{
"id": 1,
"province_id": 10,
"province_name_en": "Bangkok",
"province_name_th": "กรุงเทพมหานคร"
}
// Additional provinces...
]Districts
File: districts.json
Description: This file contains information about districts within each province.
Example Structure:
[
{
"id": 1,
"province_id": 10,
"district_id": 1001,
"district_name_en": "Phra Nakhon",
"district_name_th": "พระนคร",
"postal_code": 10200
}
// Additional districts...
]Subdistricts
File: subdistricts.json
Description: This file provides details about subdistricts within each district.
Example Structure:
[
{
"id": 1,
"province_id": 10,
"district_id": 1001,
"subdistrict_id": 100101,
"subdistrict_name_en": "Phra Borom Maha Ratchawang",
"subdistrict_name_th": "พระบรมมหาราชวัง",
"postal_code": 10200
}
// Additional subdistricts...
]Metadata
File: metadata.json
Description: This file contains metadata about the dataset, including version information, last update timestamp, and total counts.
Example Structure:
{
"version": "1.0.0",
"last_updated": "YYYY-MM-DD HH:MM:SS",
"source": "GeoThai Team (https://github.com/GeoThai/data.git)",
"total_provinces": 77,
"total_districts": 928,
"total_subdistricts": 7436
}📚 Documentation
For more details on the overall repository and other versions of the data, visit the main GeoThai Data README.
📝 License
This dataset is licensed under the MIT License. See the LICENSE file in the root directory for more details.
🙋♂️ Contact
For any questions or feedback, please reach out to us at contact@fasu.dev.
Thank you for using GeoThai Data Version 1! 🌟