Provide geographic attribute files as hosted parquet, including pre-2006 censuses

オープン
#233 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
r
領域
backend, data

調査の方向性

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 の本文から書いたものです。

説明

enhancement

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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mountainMath/cancensus のほかの issue

mountainMath/cancensus の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。