Get the FREE Ultimate OpenClaw Setup Guide →

geoprocessing-brazil

npx machina-cli add skill pablodiegoo/Data-Pro-Skill/geoprocessing-brazil --openclaw
Files (1)
SKILL.md
1.7 KB

Geoprocessing Brazil

This skill unifies the process of geographic data treatment and map visualization for the Brazilian territory.

1. Municipality Normalization

Cleaning and standardizing city and state names from diverse strings (e.g., "São Paulo - SP", "Rio/RJ").

  • Script: scripts/municipality_mapper.py
  • Functionality: Detects, cleans, and attaches metadata (Region, UF, IBGE Code if available).

2. Choropleth Map Generation

Creation of thematic maps based on scores or categories by State.

Capabilities:

  • Automatic Merge: Joins your data (DataFrame) with Brazil shapefiles.
  • Custom Styling: Sebrae-friendly color palettes and legend control.

Usage:

  • Script: scripts/map_generator.py
from scripts.map_generator import generate_brazil_map

# Example: Generate satisfaction map by UF
generate_brazil_map(df, score_col="Score", title="Satisfaction by State", filename="brazil_map.png")

3. Recommended Workflow

  1. Cleaning: Use municipality_mapper to ensure the UF column is standardized (e.g., 'SP', 'RJ').
  2. Aggregation: Group your data by the UF column (Example: df.groupby('UF')['Score'].mean()).
  3. Visualization: Pass the resulting DataFrame to map_generator.

[!NOTE] For city-level maps (beyond UF), check for specific shapefile availability or IBGE APIs.

Source

git clone https://github.com/pablodiegoo/Data-Pro-Skill/blob/main/src/datapro/data/skills/geoprocessing-brazil/SKILL.mdView on GitHub

Overview

Geoprocessing Brazil unifies geographic data treatment and map visualization for Brazil. It standardizes city and state strings, attaches regional metadata such as Region, UF and IBGE Code, and generates professional choropleth maps at the UF/state level using shapefiles. The workflow supports automation from cleaning to visualization for dashboards and reports.

How This Skill Works

Two scripts drive the workflow: municipality_mapper.py detects, cleans and attaches metadata to place names; map_generator.py automatically merges the data with Brazil shapefiles and renders choropleth maps with configurable styling.

When to Use It

  • You have survey data with city or state strings and need to normalize to standard UF codes
  • You want to create state level choropleth maps showing scores or categories
  • You need to merge a DataFrame with Brazil shapefiles automatically
  • You require Sebrae-friendly palettes and precise legend control
  • You are preparing map outputs for reports, dashboards, or client presentations

Quick Start

  1. Step 1: Run municipality_mapper.py to standardize UF and attach metadata
  2. Step 2: Group or aggregate your data by UF as needed (e.g., mean of Score)
  3. Step 3: Call generate_brazil_map with df, score_col, title, and filename to produce the map

Best Practices

  • Normalize the UF column first with municipality_mapper to ensure consistency
  • Aggregate data by UF (for example mean scores) before mapping
  • Validate alignment between data and shapefiles using UF or IBGE codes
  • For city-level maps, confirm shapefile availability or IBGE API access
  • Test the full pipeline on a small sample to tune color palettes and legend

Example Use Cases

  • Create a satisfaction by state map from a DataFrame using generate_brazil_map
  • Normalize strings like Sao Paulo - SP to standard UF codes with municipality_mapper
  • Attach regional metadata (Region, UF, IBGE Code) during cleaning
  • Auto-merge your data with Brazil shapefiles and render a choropleth with Sebrae palettes
  • Prepare city-level maps only when suitable shapefiles or IBGE API are available

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers