SimonbJohnson / quickX3

HXLDash. Create data visualisations quickly by leveraging the humanitarian exchange language
https://hxldash.com/
MIT License
8 stars 4 forks source link

Added Brazil ADM1 capabilities #78

Closed Rydela closed 4 years ago

Rydela commented 4 years ago

Created pcodes for Brazil and added visual possibility of ADM1 (State/UF) level.

fititnt commented 4 years ago

On a quick look, the admin1Pcode needs revision. Rio de Janeiro seems right, but several others ( like São Paulo) seems to have a different number. On this example:

While (just for State/UF) would be possible to just edit manually, when come to commit the cities this would hard if we somewhat don't extract the codes from the database that comes with the shapefiles. But for the first commit I could just edit the direct file, and later we see how to create the cities.

Current commit

I'm using this URL to preview https://github.com/SimonbJohnson/quickX3/blob/development/hxldash/static/geoms/topojson/BRA/1/geom.json (exact version: https://github.com/SimonbJohnson/quickX3/blob/2cee17881d49133367eb66712ecea6aedddb5bc5/hxldash/static/geoms/topojson/BRA/1/geom.json)

Captura de tela de 2020-05-01 23-33-34


IBGE references

In addition to the shapefiles, here some places that have the numbers:

https://www.ibge.gov.br/explica/codigos-dos-municipios.php

Captura de tela de 2020-05-01 23-38-09

ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2018/Leia_me_Malha_Digital_2018.pdf

Captura de tela de 2020-05-01 23-38-45


What I did not tested.

I did not checked if the file size could be optimized for be less than 188 KB with acceptable loss of precision to save page load.

Rydela commented 4 years ago

On a quick look, the admin1Pcode needs revision. Rio de Janeiro seems right, but several others ( like São Paulo) seems to have a different number.

Thanks for pointing that out, I had to review what happened. I think the UF names were sorted alphabetically somewhere and the códigos got out of order when that happened. I'll fix it today.

fititnt commented 4 years ago

@Rydela I can confirm that now the the 27 UFs are exactly the IBGE code prefixed with BR.

Thanks!

SimonbJohnson commented 4 years ago

Great work @Rydela