Provide geographic attribute files as hosted parquet, including pre-2006 censuses
评估
调研方向
Start by checking the R implementation of get_statcan_geographic_attributes() and the hosted storage status described in the issue; then inspect the listed source files and layouts for the older censuses. The work also requires deciding how to expose differing census fields and documenting provenance. Done means the missing parquet files are hosted with source and licence metadata, and the function can read them across the intended census years.
由索引模型根据 Issue 内容生成。
描述
The geographic attribute files are useful well beyond TongFen: they link the lowest census geography to the higher levels, with population, dwellings and representative points. get_statcan_geographic_attributes() only covers 2006 to 2021 and downloads from StatCan, which now puts at least the 2021 file behind a browser check (#228).
This proposes serving the attribute files as hosted parquet, written with r2parquet, and adding the older censuses.
Files
| Census | Source | Base geography | Records |
|---|---|---|---|
| 2021, 2016, 2011, 2006 | 92-151 attribute files |
DB | Not counted here |
| 2001 | GeoSuite 2001 geosuite2001.mdb, tables CB and DA |
Block, DA | 478,707 blocks, 52,993 DAs |
| 1996 | GAF1996.txt |
EA | 49,361 |
| 1991 | gaf91.txt |
EA | 45,995 |
| 1986 | GAF1986.txt |
EA | 44,042 |
| 1981 | GAF1981.txt |
EA | 41,197 |
I haven't found a separate 2001 attribute file. The GeoSuite CB table has similar content: population, dwellings, representative points, and the codes for higher levels. If StatCan did release a 2001 attribute file, it should replace this.
Hosting status
I found no attribute files in the public mountainmath S3 bucket under the tongfen, cancensus, statcan, census, gaf or attribute prefixes, and the existing mirror holds only correspondence files. R2 still needs checking, as I couldn't list its buckets.
What needs doing
- Confirm what's already hosted on R2, then convert and upload what's missing, with the source and the Statistics Canada Open Data licence in the parquet footer.
- Extend
get_statcan_geographic_attributes()to the older years and read from the hosted files. Keep the provenance visible, since re-hosting is the concern raised in #228. - Parse the older fixed-width layouts, which have a different structure for each census.
- Decide whether to return columns as released or harmonised across years. As released is simpler and closer to the source, but the older EA-based files have quite different fields from the DB-based ones.
- Decide on the function's scope. The existing name still fits, but pre-2006 results are at EA level.
- Consider the same treatment for
get_statcan_geo_suite(). Its 2001 download URL returned a Cloudflare challenge (HTTP 403) when tested from a script.
Related: mountainMath/tongfen#22, which covers the correspondence files for the same censuses.
- 主要语言
- HTML
- 星标
- 90
- 派生
- 14
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mountainMath/cancensus 的其他 Issue
-
user agent可能已有人在做 @mountainMath 于 4 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
mountainMath/cancensus#231 ·
-
难度 4/5 3-5 天 新手友好度 48/100
mountainMath/cancensus#234 ·
-
Translate API level labelling to "labelled" columns可能已有人在做 @mountainMath 于 4 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 28/100
mountainMath/cancensus#230 · 1 条评论 ·
-
French language labels可能已有人在做 @mountainMath 于 4 天前认领。 未关闭enhancement
难度 4/5 1-2 天 新手友好度 15/100
mountainMath/cancensus#229 · 2 条评论 ·
-
bug
难度 5/5 一周以上 新手友好度 25/100
mountainMath/cancensus#228 · 2 条评论 ·
查看 mountainMath/cancensus 的全部 Issue
相似的 Issue
-
complexity: high external-contributors test
难度 2/5 1-3 小时 新手友好度 84/100
Meet-hybrid/soroban-forge#583 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 68/100
Vakore/ZappierGames#285 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider impact:ux-release-blocker issue-rating: 🦞 diamond lobster no-stale P0
难度 2/5 1-3 小时 新手友好度 78/100
openclaw/openclaw#195576 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
agent-self
难度 2/5 1-3 小时 新手友好度 78/100
yologdev/yoyo-evolve#1160 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
eliasstravik/herdr-projects#845 ·