mapsbr package

Submodules

mapsbr.arcgis module

mapsbr.arcgis.build_url(service, baseurl=None, service_type='MapServer', layer=0, count=0)[source]

Helper function to build valid ARCGIS url.

mapsbr.arcgis.folders(folder=None, baseurl=None)[source]

Search available folders in a ArcGIS server.

Parameters:
Returns:

A DataFrame listing folders.

Return type:

DataFrame

mapsbr.arcgis.get_all_features(service, baseurl=None, service_type='MapServer', layer=0)[source]

Helper function to get all features from a service layer. This is a work around the API 1000 row limit per response.

mapsbr.arcgis.get_map(service, baseurl=None, service_type='MapServer', layer=0)[source]

Get geometries associated with an ARCGIS host service.

Parameters:
  • service (str) – Service identifier, part of the url after “services/”
  • baseurl (str, default None) – Base url or host. By default, it will be https://mapasinterativos.ibge.gov.br/arcgis/rest/services
  • service_type (str, default "MapServer") – Service type
  • layer (int or str, default 0) – Service layer
Returns:

Return type:

GeoDataFrame

mapsbr.arcgis.layers(service_path, baseurl=None)[source]

Search available layers in a ArcGIS service.

Parameters:
Returns:

A DataFrame listing service layers.

Return type:

DataFrame

mapsbr.arcgis.parse_geojson(geojson)[source]

Helper function to read GeoJSON to get all geometries and properties.

mapsbr.arcgis.services(folder=None, baseurl=None)[source]

Search available services in a ArcGIS server folder.

Parameters:
Returns:

A DataFrame listing services.

Return type:

DataFrame

mapsbr.ibgemaps module

mapsbr.ibgemaps.build_url(code, including=None)[source]

Helper function to build valid URL for IBGE API.

mapsbr.ibgemaps.geocode(locations, geolevel=None)[source]

Function to turn several locations code or name into its corresponding geometric shapely object.

Parameters:
  • locations (str, int, iterable) – Locations’ names
  • geolevel (str, default None) – Geographic level of location, needed if location is a string.
Returns:

shapely object or list of shapely objects

Return type:

shapely objects

mapsbr.ibgemaps.get_geometry[source]

Get geometry of a single location code/name

mapsbr.ibgemaps.get_map(location, including=None, geolevel=None)[source]

Get and turn a GeoJSON of a IBGE location into a GeoSeries.

Parameters:
  • location (int or str) – Location identifier (code or string) as in IBGE.
  • including (str, default None) – Map level of detail, e.g. “states” “municipalities”, etc. By default, include no details.
  • geolevel (str) – If location is a name, the geographic level of that location. This is needed so the name can be converted to IBGE’s code.
Returns:

A GeoSeries with shapely objects only.

Return type:

GeoSeries

mapsbr.ibgemaps.parse_geojson(geojson)[source]

Helper function to parse GeoJSON so as to get all geometries in all features.

Module contents