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

Đang mở
#233 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
r
Lĩnh vực
backend, data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
HTML
Star
90
Fork
14
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mountainMath/cancensus

Tất cả issue của mountainMath/cancensus

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.