mapsbr package¶
Subpackages¶
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: - baseurl (str, default None) – Server url. By default, it will be https://mapasinterativos.ibge.gov.br/arcgis/rest/services
- folder (str, default None) – Path to search for folders.
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: - service_path (str) – Path to service.
- baseurl (str, default None) – Server url. By default, it will be https://mapasinterativos.ibge.gov.br/arcgis/rest/services
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: - baseurl (str, default None) – Server url. By default, it will be https://mapasinterativos.ibge.gov.br/arcgis/rest/services
- folder (str, default None) – Path to search for services.
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_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