Tags: ipea/geobr
Tags
new read_addresses() reader for CNEFE 2022, in R and Python (#453) * new read_addresses() reader for CNEFE 2022, in R and Python Reads the `cnefe_2022.parquet` asset of the geobr_prep_data v2.0.0 release: IBGE's National Registry of Addresses for Statistical Purposes. Point data, so no `simplified` argument, following read_municipal_seat() / read_schools(). No change was needed to the metadata sniffers -- the file name already parses to geo = "cnefe", year = 2022, simplified = FALSE in both languages. `code_muni` is required and has no default, unlike most readers. The data set is a single 1.2 GB file with ~111 million rows, so downloading the whole country has to be an explicit choice. read_statistical_grid() and read_census_tract() set the precedent. In R the check runs up front via cli_abort() rather than being left to lazy evaluation, which in read_statistical_grid() only fires after the download; in Python a positional argument with no default already raises at call time. Python also registers the geography in `_GEO_LOADERS` and `POINT_GEOGRAPHIES`, so it is reachable from query() and session(). Verified against the live release that the set of geographies with no simplified asset still equals POINT_GEOGRAPHIES once cnefe is added. The Python network test is marked `@pytest.mark.network`, unlike the other test_read_* modules, which are unmarked and do download in CI. At 1.2 GB across 3 OSs x 5 Python versions that is not reasonable; offline tests cover the geography name, simplified=False, the required argument and the export. `tests/samples/metadata_geobr_v2.parquet` gains the cnefe row, because the autouse conftest fixture hides the live metadata from every test. Verified: devtools::test(filter = 'read_addresses|list_geobr|download_metadata') -> 25 pass, 0 fail. uv run pytest -m "not network" -> 286 pass. Both readers were also exercised end to end against the real 1.2 GB file. Also carries an unrelated change that arrived in the working tree during this work: the removal of the internal check_connection() helper, its .Rd, its test, its coverage line, and the now-unused curl::has_internet import. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * qgis fix v0.4.0 * Fix python's filter issue --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: camilagb <camilagdebrito@gmail.com>
PreviousNext