geobr
geobr copied to clipboard
CEP data
Following up our conversation about adding CEP data to geobr.
The current idea is to map CEP numbers to h3 hexagons, so that each hexagon would have a list of CEPs.
API
get_cep_by_geo(latitude, longitude, h3_id)
"""
Gets H3 hexagon in that maps to the coordinates and returns a list of CEP numbers.
The user can use lat, lon or the h3_id to get the CEP numbers
Return
-------
Dataframe:
h3_id
h3_geometry
cep_number
"""
get_geo_by_cep(cep_number)
"""
Gets all H3 hexagons that contains the CEP number.
Return
-------
Dataframe:
h3_id
h3_geometry
cep_number
Infrastructure
get_cep_by_geo
- Map latitude, longitude to h3 cell using the H3 package that is available for python and R.
- Get the selected h3 cell parents
- Search a file system with the following structure: - h3_cell_resolution_4_id - h3_cell_resolution_5_id - h3_cell_resolution_6_id - ... up to a convenient resolution On a reasonable resolution, we should save a dataframe that is small enough to be downloaded and filtered.
- Download df, filter by h3 cell id and return
get_geo_by_cep
- Search a file system with the following structure:
- first CEP digit
- second CEP digit
- third CEP digit
- ....
On a reasonable CEP digit, we should save a dataframe that is small enough to be downloaded and filtered. - Download df, filter by h3 cell id and return
@rafapereirabr let me know what you think. It is not easy to build those indexes, but I it would be incredible to have it!
Hello everyone,
Maybe this project by @millengustavo may inspire some very useful feature, which allows to intersect geobr with DataSUS microdata.
https://github.com/millengustavo/ibge-censo-cep-coordenadas/blob/main/notebooks/ibge_data.ipynb
Thanks for your request to @JoaoCarabetta, and many many many Thanks to IPEA team for maintaining this project and IPEAData also. Great job guys!