wfmackey / absmapsdata

Use ABS ASGS data easily in R
58 stars 18 forks source link

absmapsdata_file_list not updated fully with 2021 ASGS data #55

Closed SteveLane closed 2 years ago

SteveLane commented 2 years ago

In attempting to use strayr::read_abs('lga2021') I get an error that lga2021 is not in the list absmapsdata_file_list. It's in the data directory, so the list must not contain it. (I assume the list can be created straightforwardly, so didn't consider opening a PR myself 😄 )

strayr::read_absmap('lga2021')
#> Error in strayr::read_absmap("lga2021"): lga2021 not found. Applicable files are:
#>  absmapsdata_file_list, aus2021, ced2018, ced2021, dz2011, dz2016, dz2021, employment_regions2015, gcc2011, gcc2016, gcc2021, lga2011, lga2016, lga2018, postcode2016, postcode2021, ra2011, ra2016, regional_ivi2008, sa12011, sa12016, sa12021, sa22011, sa22016, sa22021, sa32011, sa32016, sa32021, sa42011, sa42016, sa42021, sed2018, sed2021, sos2016, sosr2016, state2011, state2016, state2021, sua2016, tourism2016, tourism2021, ucl2016

Created on 2022-02-04 by the reprex package (v2.0.1)

wfmackey commented 2 years ago

Oop - thanks @SteveLane, will fix now

wfmackey commented 2 years ago

(for now, you can do strayr::read_absmap('lga2021', .validate_name = FALSE))

wfmackey commented 2 years ago

Fixed in df0cd96

library(strayr)
library(sf)
#> Linking to GEOS 3.8.1, GDAL 3.2.1, PROJ 7.2.1

read_absmap("lga2021")
#> Simple feature collection with 566 features and 7 fields (with 19 geometries empty)
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: 96.81696 ymin: -43.74036 xmax: 167.9969 ymax: -9.219923
#> Geodetic CRS:  WGS 84
#> First 10 features:
#>    lga_code_2021     lga_name_2021 state_code_2021 state_name_2021
#> 1          10050            Albury               1 New South Wales
#> 2          10180 Armidale Regional               1 New South Wales
#> 3          10250           Ballina               1 New South Wales
#> 4          10300         Balranald               1 New South Wales
#> 5          10470 Bathurst Regional               1 New South Wales
#> 6          10500     Bayside (NSW)               1 New South Wales
#> 7          10550       Bega Valley               1 New South Wales
#> 8          10600         Bellingen               1 New South Wales
#> 9          10650          Berrigan               1 New South Wales
#> 10         10750         Blacktown               1 New South Wales
#>    areasqkm_2021  cent_lat cent_long                       geometry
#> 1       305.6386 -36.02653  146.9705 MULTIPOLYGON (((146.8177 -3...
#> 2      7809.4406 -30.36711  151.8986 MULTIPOLYGON (((151.2922 -3...
#> 3       484.9692 -28.85284  153.4862 MULTIPOLYGON (((153.4496 -2...
#> 4     21690.7493 -33.94918  143.6138 MULTIPOLYGON (((143.5525 -3...
#> 5      3817.8645 -33.42946  149.5260 MULTIPOLYGON (((149.8696 -3...
#> 6        50.6204 -33.94952  151.1671 MULTIPOLYGON (((151.155 -33...
#> 7      6278.5013 -36.82454  149.7177 MULTIPOLYGON (((149.9762 -3...
#> 8      1600.4338 -30.40380  152.7286 MULTIPOLYGON (((152.8035 -3...
#> 9      2065.8878 -35.73427  145.7111 MULTIPOLYGON (((145.4845 -3...
#> 10      238.8471 -33.74092  150.8641 MULTIPOLYGON (((150.8129 -3...

Created on 2022-02-04 by the reprex package (v2.0.1)

SteveLane commented 2 years ago

Thanks mate, I did use the code above in meantime. Great package 👍