Historical Map Generator
Generate beautiful vintage-style historical maps from GeoJSON data.
Quick Start
CODEBLOCK0
What It Does
- - Historical boundaries from 10,000 BC to 2010 AD (50+ time slices)
- Multiple projections: Lambert Azimuthal, Lambert Conformal Conic, Mollweide, Plate Carrée
- 4 color palettes: Vintage (HOI4-inspired), Pastel, Dark, Satellite
- Decorative elements: Compass rose, scale bar, timeline, legend, ocean labels
- Post-processing: Parchment overlay, vignette darkening, paper grain noise
- Customizable: Override any country color, add custom events, swap basemap textures
Available Time Slices
Commonly used years from historical-basemaps:
CODEBLOCK1
Usage Examples
Basic: Europe 1914
CODEBLOCK2
World map with custom palette
CODEBLOCK3
China with custom colors
CODEBLOCK4
Custom region (Balkans)
CODEBLOCK5
With custom events timeline
Create
my_events.json:
[
{"year": "1789", "label": "Revolution", "cn": "法国大革命", "color": "#4169E1"},
{"year": "1804", "label": "Empire", "cn": "拿破仑称帝", "color": "#2E5E2E"},
{"year": "1815", "label": "Fall", "cn": "滑铁卢", "color": "#8B0000"}
]
CODEBLOCK7
Custom country colors
CODEBLOCK8
Parameters
| Parameter | Default | Description |
|---|
| INLINECODE1 | required | Historical year (must match a GeoJSON file) |
| INLINECODE2 |
europe | Region preset or
lon_min,lat_min,lon_max,lat_max |
|
--projection |
laea |
laea,
lcc,
mollweide,
platecarree |
|
--palette |
vintage |
vintage,
pastel,
dark,
satellite |
|
--title | auto | Main title (Latin/English) |
|
--title-cn | auto | Chinese subtitle |
|
--data | auto-detect | Path to GeoJSON file |
|
--basemap | none | Path to satellite basemap image |
|
--parchment | none | Path to parchment texture image |
|
--events | auto-preset | Path to events JSON file |
|
--dpi | 300 | Output resolution |
|
--no-timeline | false | Disable bottom timeline |
|
--no-compass | false | Disable compass rose |
|
--no-postprocess | false | Skip vignette/noise effects |
|
--output |
historical_map.png | Output file path |
Region Presets
| Key | Coverage |
|---|
| INLINECODE29 | Full European continent |
| INLINECODE30 |
Balkan Peninsula |
|
world | Global view |
|
asia | Asian continent |
|
china | China and surroundings |
|
mediterranean | Mediterranean basin |
|
middle_east | Middle East |
|
americas | North + South America |
Color Palettes
Vintage (Default)
HOI4-inspired desaturated military colors. Ocean: dark teal. Perfect for war maps.
Pastel
Light, soft colors on off-white background. Great for educational content.
Dark
Deep navy background with gold accents. Dramatic, cinematic feel.
Satellite
Modern cartography style with clean lines. Professional and neutral.
Post-Processing Pipeline
- 1. Parchment overlay — Semi-transparent parchment texture (alpha=18/255)
- Vignette — Edge darkening for focal point emphasis
- Paper grain — Subtle noise for aged paper texture
- Desaturation — 14% color reduction for vintage feel
Python API
CODEBLOCK9
Data Source
historical-basemaps by @aourednik.
50+ GeoJSON time slices covering 10,000 BC to 2010 AD.
Note: Border precision varies. The BORDERPRECISION field indicates accuracy (1=high, 3=approximate). Some regions (especially Balkans) may have minor gaps between neighboring territories. For publication-quality maps, consider manually editing the GeoJSON or using commercial data.
Requirements
- - Python 3.9+
- geopandas >= 0.14
- matplotlib >= 3.8
- numpy >= 1.24
- Pillow >= 10.0
- pyproj >= 3.6
- shapely >= 2.0
License
MIT
Credits
Developed by Lumielle / OpenClaw Agent
Data: historical-basemaps (CC BY 4.0)
历史地图生成器
从GeoJSON数据生成精美的复古风格历史地图。
快速开始
bash
安装依赖
pip install geopandas matplotlib numpy Pillow pyproj shapely
下载历史GeoJSON数据
git clone https://github.com/aourednik/historical-basemaps.git
将world_YYYY.geojson文件复制到./data/目录
生成地图
python generate.py --year 1914 --region europe --output europe_1914.png
功能特性
- - 历史边界:覆盖公元前10000年至公元2010年(50+时间切片)
- 多种投影:兰勃特方位等积投影、兰勃特正形圆锥投影、摩尔威德投影、等距圆柱投影
- 4种配色方案:复古(HOI4风格)、柔和、暗色、卫星
- 装饰元素:罗盘玫瑰、比例尺、时间轴、图例、海洋标签
- 后处理:羊皮纸叠加、暗角加深、纸张纹理噪点
- 可定制:覆盖任意国家颜色、添加自定义事件、替换底图纹理
可用时间切片
来自historical-basemaps的常用年份:
worldbc3000.geojson, worldbc1500.geojson, world_100.geojson
world500.geojson, world1000.geojson, world_1200.geojson
world1400.geojson, world1492.geojson, world_1600.geojson
world1700.geojson, world1783.geojson, world_1815.geojson
world1880.geojson, world1900.geojson, world_1914.geojson
world1920.geojson, world1930.geojson, world_1938.geojson
world1945.geojson, world1960.geojson, world_2000.geojson
使用示例
基础:1914年欧洲
bash
python generate.py --year 1914 --region europe --output europe_1914.png
自定义配色的世界地图
bash
python generate.py --year 1600 --region world --projection mollweide --palette dark --output world_1600.png
自定义颜色的中国地图
bash
python generate.py --year 1400 --region china --palette pastel \
--title MING DYNASTY --title-cn 明朝疆域 --output ming.png
自定义区域(巴尔干半岛)
bash
python generate.py --year 1815 --region 18,34,32,48 --output balkans_1815.png
带自定义事件时间轴
创建my_events.json:
json
[
{year: 1789, label: Revolution, cn: 法国大革命, color: #4169E1},
{year: 1804, label: Empire, cn: 拿破仑称帝, color: #2E5E2E},
{year: 1815, label: Fall, cn: 滑铁卢, color: #8B0000}
]
bash
python generate.py --year 1815 --events my_events.json --output napoleon.png
自定义国家颜色
bash
python generate.py --year 1945 --region world \
--title POST-WAR WORLD --title-cn 二战后的世界 \
--palette vintage --output postwar.png
参数说明
| 参数 | 默认值 | 描述 |
|---|
| --year | 必填 | 历史年份(必须匹配GeoJSON文件) |
| --region |
europe | 区域预设或经度最小值,纬度最小值,经度最大值,纬度最大值 |
| --projection | laea | laea, lcc, mollweide, platecarree |
| --palette | vintage | vintage, pastel, dark, satellite |
| --title | 自动 | 主标题(拉丁/英文) |
| --title-cn | 自动 | 中文副标题 |
| --data | 自动检测 | GeoJSON文件路径 |
| --basemap | 无 | 卫星底图图像路径 |
| --parchment | 无 | 羊皮纸纹理图像路径 |
| --events | 自动预设 | 事件JSON文件路径 |
| --dpi | 300 | 输出分辨率 |
| --no-timeline | false | 禁用底部时间轴 |
| --no-compass | false | 禁用罗盘玫瑰 |
| --no-postprocess | false | 跳过暗角/噪点效果 |
| --output | historical_map.png | 输出文件路径 |
区域预设
| 键名 | 覆盖范围 |
|---|
| europe | 整个欧洲大陆 |
| balkans |
巴尔干半岛 |
| world | 全球视图 |
| asia | 亚洲大陆 |
| china | 中国及周边地区 |
| mediterranean | 地中海盆地 |
| middle_east | 中东地区 |
| americas | 北美洲+南美洲 |
配色方案
复古(默认)
HOI4风格的低饱和度军事配色。海洋:深青色。非常适合战争地图。
柔和
浅色、柔和的色彩搭配米白色背景。非常适合教育内容。
暗色
深海军蓝背景搭配金色点缀。具有戏剧性的电影感。
卫星
现代制图风格,线条清晰。专业且中性。
后处理流程
- 1. 羊皮纸叠加 — 半透明羊皮纸纹理(透明度=18/255)
- 暗角 — 边缘变暗以突出焦点
- 纸张纹理 — 微妙的噪点营造旧纸质感
- 去饱和度 — 14%的色彩降低以获得复古感
Python API
python
from generate import HistoricalMapGenerator
gen = HistoricalMapGenerator(
datapath=data/world1914.geojson,
basemap_path=textures/satellite.jpg,
parchment_path=textures/parchment.jpg,
)
gen.generate(
year=1914,
region=europe,
projection=laea,
title=EUROPA ANNO DOMINI MCMXIV,
title_cn=第一次世界大战前夜的欧洲,
color_palette=vintage,
dpi=300,
outputpath=mymap.png,
)
数据来源
historical-basemaps by @aourednik。
50+个GeoJSON时间切片,覆盖公元前10000年至公元2010年。
注意:边界精度因数据而异。BORDERPRECISION字段表示准确性(1=高精度,3=近似值)。某些地区(尤其是巴尔干半岛)的相邻领土之间可能存在微小间隙。如需出版级质量的地图,建议手动编辑GeoJSON或使用商业数据。
系统要求
- - Python 3.9+
- geopandas >= 0.14
- matplotlib >= 3.8
- numpy >= 1.24
- Pillow >= 10.0
- pyproj >= 3.6
- shapely >= 2.0
许可证
MIT
致谢
由Lumielle / OpenClaw Agent开发
数据来源:historical-basemaps(CC BY 4.0)