# road_pov_template **Repository Path**: wangxiaofan1/road_pov_template ## Basic Information - **Project Name**: road_pov_template - **Description**: 一个pov路牌生成器 - **Primary Language**: Python - **License**: GPL-3.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 7 - **Forks**: 1 - **Created**: 2023-10-19 - **Last Updated**: 2025-08-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 公路 POV 模板元素自动化生成工具 高速公路 POV 模板元素自动化生成工具V1.0已基本开发完毕,目前支持的元素如下: 1. 直行方向/出口编号 2. 中文文本/中英双语文本 3. 国道/省道/县道/乡道编号标志 4. 城市道路/旅游区标志 5. 国家高速/省级高速编号标志 6. 地点距离预告标志 7. 服务区预告标志 ## 快速开始 - 安装 pip 依赖: ```sh pip install -r requirements.txt ``` - 安装用于模板元素生成的必要字体(Windows): ```sh ./install_fonts.bat ``` ## 使用 - 出口预告/直行标志 ```sh python ./main/main.py -d filepath ``` - 服务区预告标志 ```sh python ./main/sa_pa.py -d filepath ``` - 地点距离预告标志 ```sh python ./main/distance.py -d filepath ``` ## 组件介绍 - 组件结构 |字段|类型|含义| |-|-|-| |`type`|int|组件类型| |`info`|dictionary|组件详细信息| - 支持组件及对应的type和info结构 |组件类型|`type`|`info`| |-|-|-| |单语言纯文本|0|`text`:字符串,文本内容,使用A型交通标志字体| |国道|1|`name`:字符串,道路编号,如G101| |省道|2|`name`:字符串,道路编号,如S101| |县道、乡道|3|`name`:字符串,道路编号,如X101、Y101| |国家高速|4|`main_name`:字符串,主线编号;`sub_name`: 字符串。支线编号;如G4501,则`main_name`="G45",`sub_name`="01";`sub_name`可为空| |省级高速|5|`main_name`:字符串,主线编号;`sub_name`: 字符串。支线编号;`prov`:字符串,省份简称,如“吉高速”,则`prov`="吉";如S9955,则`main_name`="S99",`sub_name`="55";`sub_name`可为空| |街道|6|`name`:字符串,道路名称| |旅游区|7|`name`:字符串,旅游区名称| |中英双语纯文本|8|`text`:字符串,中文文本内容,使用A型交通标志字体;`en`:字符串,英文文本内容,使用B型交通标志字体| ## 组件示例 - 单语言纯文本 ```json { "type": 0, "info": { "text": "四平北" } } ``` ![Alt text](./example/plain_text.png) - 国道 ```json { "type": 1, "info": { "name": "G202" } } ``` ![Alt text](./example/national_road.png) - 省道 ```json { "type": 2, "info": { "name": "S023" } } ``` ![Alt text](./example/prov_road.png) - 县道/乡道 ```json { "type": 3, "info": { "name": "X021" } } ``` ![Alt text](./example/township_road.png) - 国家高速 ```json { "type": 4, "info": { "main_name": "G11", "sub_name": "12" } } ``` ![Alt text](./example/national_expressway.png) - 省级高速 ```json { "type": 5, "info": { "main_name": "S1", "prov": "吉" } } ``` ![Alt text](./example/prov_expressway.png) - 街道 ```json { "type": 6, "info": { "name": "三岔河大街" } } ``` ![Alt text](./example/street.png) - 旅游区 ```json { "type": 7, "info": { "name": "长白山景区" } } ``` ![Alt text](./example/tourist.png) - 中英双语文本 ```json { "type": 8, "info": { "text": "天津中心城区", "en": "Central Urban Of Tianjin" } } ``` ![Alt text](./example/zh_en.png) ## 出口预告 - 直行、出口JSON文件顶层结构 |字段|类型|含义|备注| |-|-|-|-| |`type`|int|指示牌类型|0:直行;1:右出口| |`exit`|dictionary|出口信息|仅对出口类型生效| |`lines`|array|指引信息列表|二维数组,Line[x][y]表示第x行第y个指引信息组件| - exit结构 |字段|类型|含义|备注| |-|-|-|-| |`seq`|string|出口编号(数值部分)|以输入为准,不截断低三位| |`sub`|string|出口编号(字母部分)|| ![Alt text](./example/example.png) ```json { "type": 1, "exit": { "seq": "428", "sub": "A-B" }, "lines": [ [ { "type": 4, "info": { "main_name": "G11", "sub_name": "12" } }, { "type": 5, "info": { "main_name": "S1", "prov": "吉" } }, { "type": 1, "info": { "name": "G102" } } ], [ { "type": 2, "info": { "name": "S023" } }, { "type": 3, "info": { "name": "X101" } }, { "type": 6, "info": { "name": "三岔河大街" } } ], [ { "type": 0, "info": { "text": "宝坻城区东" } }, { "type": 7, "info": { "name": "八达岭长城" } } ], [ { "type": 8, "info": { "text": "天津中心城区", "en": "Central Urban Of Tianjin" } }, { "type": 0, "info": { "text": "沂水" } } ] ] } ``` ## 服务区预告 - JSON结构 |字段|类型|含义|备注| |-|-|-|-| |`icons`|array|服务区功能类型|见下表| |`name`|组件|服务区名称|组件类型仅支持0(纯文本)、8(中英双语文本)| - 图标类型 |图标类型|图标| |-|-| |1|![Alt text](./resources/1.png)| |2|![Alt text](./resources/2.png)| |3|![Alt text](./resources/3.png)| |4|![Alt text](./resources/4.png)| |5|![Alt text](./resources/5.png)| |6|![Alt text](./resources/6.png)| ![Alt text](./example/sa_pa.png) ```json { "icons": [1, 2, 3, 4], "name": { "type": 8, "info": { "text": "蚌埠", "en": "Bengbu" } } } ``` ## 地点距离预告 - 地点距离预告JSON文件顶层结构 数组:元素为组件结构,并附加`distance`字段 ![Alt text](./example/distance.png) ```json [ { "type": 4, "info": { "main_name": "G11", "sub_name": "12" }, "distance": "12" }, { "type": 0, "info": { "text": "深圳" }, "distance": "98" }, { "type": 1, "info": { "name": "G102" }, "distance": "197" } ] ```