Loader_Generate_Nation_Script — 为指定平台生成加载到县和州查找表中的 shell 脚本。
text loader_generate_nation_script(text os);
为指定平台生成 shell 脚本,将 County_all、county_all_lookup、state_all 表加载到 Tiger_data 架构中。 它们分别继承自tiger 模式中的 County、county_lookup、state 表。
它在 Linux 上使用 unzip(在 Windows 上默认为 7-zip)和 wget 来进行下载。 它使用Section 4.7.2, “使用Shapefile加载器”来加载数据。
它使用以下控制表 Tiger.loader_platform、tiger.loader_variables 和 Tiger.loader_lookuptables 来控制进程和不同操作系统 shell 语法变化。
loader_variables 跟踪各种变量,例如人口普查站点、年份、数据和暂存模式
loader_platform 各种平台的配置文件以及各种可执行文件所在的位置。 带有 windows 和 linux/unix。 还可以添加更多。
loader_lookuptables 每条记录定义一种表(州、县)、是否处理其中的记录以及如何加载它们。定义每个记录的导入数据、暂存数据、添加、删除列、索引和约束的步骤。 每个表都以状态为前缀,并继承自 Tiger 模式中的表。 例如 创建从tiger.faces继承的tiger_data.ma_faces
Enhanced: 2.4.1 修复了 ZIP Code 5 分析区(zcta5)的加载步骤;启用后,zcta5 数据会在全国级别脚本加载过程中被导入为单表zcta5_all。
可用性:2.1.0
|
|
|
如果你希望在全国级别的脚本加载过程中把 ZIP Code 5 分析区(zcta5)一起导入进去,按下面步骤操作即可: UPDATE tiger.loader_lookuptables SET load = true WHERE table_name = 'zcta510'; |
|
|
|
如果您运行的是 |
生成脚本来加载Windows的国家数据。
SELECT loader_generate_nation_script('windows');
生成脚本来加载 Linux/Unix 系统的数据。
SELECT loader_generate_nation_script('sh');