mapsbr.helpers package

Submodules

mapsbr.helpers.ibgetools module

mapsbr.helpers.ibgetools.build_url(geolevel)[source]
mapsbr.helpers.ibgetools.code_to_name(geolevel)[source]

Make dictionary to map location code to IBGE name.

mapsbr.helpers.ibgetools.ibge_decode(locations, geolevel)[source]

Vectorized function to turn locations codes into their corresponding IBGE name.

Parameters:
  • locations (str, iterables, Series, GeoSeries) – Series with locations’ codes.
  • geolevel (str) – Geographic level, e.g. “estados”, “mesoregions”.
Returns:

Return type:

ndarray

Raises:

AssertionError – If all values passed are strings or if invalid geographic level is passed.

mapsbr.helpers.ibgetools.ibge_encode(locations, geolevel)[source]

Vectorized function to turn locations names into their corresponding IBGE code.

Parameters:
  • locations (str, iterables, Series, GeoSeries) – Series with locations’ names.
  • geolevel (str, default "states") – Geographic level, e.g. “estados”, “mesoregions”.
Returns:

Return type:

ndarray

Raises:
  • AssertionError – If try to pass numbers or strings as numbers.
  • ValueError – If invalid geographic level is passed.
mapsbr.helpers.ibgetools.name_to_code(geolevel)[source]

Make dictionary to map location name to IBGE code.

mapsbr.helpers.request module

mapsbr.helpers.request.get_geojson[source]

mapsbr.helpers.utils module

mapsbr.helpers.utils.get_features(geojson)[source]

Helper function to extract features from dictionary. If it doesn’t find it, raise a value error with a more informative error message.

mapsbr.helpers.utils.is_iter(something)[source]

Helper vectorized function to test if something is an iterable other than a str.

Module contents