EMBRAPA Solos API¶
The embrapa_solos module provides soil profiles and the pedological map of Brazil via the EMBRAPA GeoInfo WFS.
Functions¶
perfis¶
PronaSolos soil profiles (tabular).
async def perfis(
*,
uf: str | None = None,
bbox: tuple[float, float, float, float] | None = None,
max_registros: int | None = 50000,
tamanho_pagina: int | None = None,
as_polars: bool = False,
return_meta: bool = False,
) -> pd.DataFrame | tuple[pd.DataFrame, MetaInfo]
Parameters:
| Parameter | Type | Description |
|---|---|---|
uf |
str \| None |
Filter by state (abbreviation, e.g. "MT") |
bbox |
tuple \| None |
Bounding box (lon_min, lat_min, lon_max, lat_max) |
max_registros |
int \| None |
Cap on occurrences read in fid order (default 50,000; None reads the whole layer). Local filters only see this prefix; a cut that leaves the selection partial raises a UserWarning |
tamanho_pagina |
int \| None |
Occurrences per page: default 250 (profiles) / 500 (map), maximum 1000; with geometry (_geo or bbox), 100 / 25, maximum 100 |
as_polars |
bool |
Return a polars DataFrame |
return_meta |
bool |
Return a (DataFrame, MetaInfo) tuple |
The ano column uses nullable Int64, and data_colet uses datetime64[ns]. Source nulls and the literal NULL become missing values in these two columns. Under the date rule, a well-formed data_colet with a year outside 1900–2099 becomes NaT, with a UserWarning and the same message in meta.validation_warnings (on 2026-10-07, 73 of the layer's 34,464 records, with dates such as 0982-11-01 and 1892-07-14). An unrecognized year or date, or an impossible date (2024-02-30), raises ParseError; it is not silently converted to a missing value. Text uses the native pandas dtype (str on pandas 3, object on pandas 2). Empty tables have the same dtypes as populated tables.
Returns: DataFrame with 85 columns (embrapa_solos.perfis 3.0 contract), one row per horizon or layer. It starts with fid, uf, municipio, latitude, longitude, horizonte, profundidade, areia_total, silte, argila, ph_h2o, carbono_organico, ctc, saturacao_bases, aluminio, fosforo, classe_textural, nivel_levantamento, uso_atual, followed by the other published attributes, uf_original and feature_id. Laboratory values are the published text (including NULL); see the source page
Example:
from agrobr import embrapa_solos
# All profiles
df = await embrapa_solos.perfis()
# Mato Grosso profiles
df = await embrapa_solos.perfis(uf="MT")
perfis_geo¶
Soil profiles with geometry (GeoDataFrame). Requires pip install agrobr[geo].
async def perfis_geo(
*,
uf: str | None = None,
bbox: tuple[float, float, float, float] | None = None,
max_registros: int | None = 5000,
tamanho_pagina: int | None = None,
return_meta: bool = False,
) -> gpd.GeoDataFrame | tuple[gpd.GeoDataFrame, MetaInfo]
Parameters:
| Parameter | Type | Description |
|---|---|---|
uf |
str \| None |
Filter by state (abbreviation) |
bbox |
tuple \| None |
Bounding box (lon_min, lat_min, lon_max, lat_max) |
max_registros |
int \| None |
Cap on occurrences read in fid order (default 5,000; None reads the whole layer). Local filters only see this prefix; a cut that leaves the selection partial raises a UserWarning |
tamanho_pagina |
int \| None |
Occurrences per page: default 250 (profiles) / 500 (map), maximum 1000; with geometry (_geo or bbox), 100 / 25, maximum 100 |
return_meta |
bool |
Return a (GeoDataFrame, MetaInfo) tuple |
Returns: GeoDataFrame (Point, EPSG:4326) with the same columns as perfis() + geometry
Example:
from agrobr import embrapa_solos
# Profiles with geometry in a bbox
gdf = await embrapa_solos.perfis_geo(bbox=(-56, -16, -54, -14))
mapa_solos¶
Pedological map of Brazil — SiBCS classification (tabular).
async def mapa_solos(
*,
ordem: str | None = None,
bbox: tuple[float, float, float, float] | None = None,
max_registros: int | None = 50000,
tamanho_pagina: int | None = None,
as_polars: bool = False,
return_meta: bool = False,
) -> pd.DataFrame | tuple[pd.DataFrame, MetaInfo]
Parameters:
| Parameter | Type | Description |
|---|---|---|
ordem |
str \| None |
Filter by the order of the 1st component (ordem1): the whole class, one of the 15 published (13 orders plus AFLORAMENTOS DE ROCHAS and DUNAS), with case, accents and the singular accepted ("latossolo" means LATOSSOLOS), applied locally to the prefix read. A fragment ("latos"), a blank, non-text or out-of-domain value raises InvalidParameterError before collection, listing the classes. If the filter matches nothing after a complete read, UserWarning and MetaInfo.validation_warnings report the requested value and the ordem1 values observed. |
bbox |
tuple \| None |
Bounding box (lon_min, lat_min, lon_max, lat_max) |
max_registros |
int \| None |
Cap on occurrences read in fid order (default 50,000; None reads the whole layer). Local filters only see this prefix; a cut that leaves the selection partial raises a UserWarning |
tamanho_pagina |
int \| None |
Occurrences per page: default 250 (profiles) / 500 (map), maximum 1000; with geometry (_geo or bbox), 100 / 25, maximum 100 |
as_polars |
bool |
Return a polars DataFrame |
return_meta |
bool |
Return a (DataFrame, MetaInfo) tuple |
Returns: DataFrame with columns: fid, simbolos, comp1, comp2, comp3, legenda, area_km2, ordem1, subordem1, gdegrupo1, ordem2, subordem2, gdegrupo2, legenda_sinotica, classe_dom, ordem3, subordem3, gdegrupo3, feature_id
Example:
from agrobr import embrapa_solos
# Full map
df = await embrapa_solos.mapa_solos()
# Latosols
df = await embrapa_solos.mapa_solos(ordem="LATOSSOLO")
mapa_solos_geo¶
Pedological map with geometry (GeoDataFrame). Requires pip install agrobr[geo].
async def mapa_solos_geo(
*,
ordem: str | None = None,
bbox: tuple[float, float, float, float] | None = None,
max_registros: int | None = 3000,
tamanho_pagina: int | None = None,
return_meta: bool = False,
) -> gpd.GeoDataFrame | tuple[gpd.GeoDataFrame, MetaInfo]
Parameters:
| Parameter | Type | Description |
|---|---|---|
ordem |
str \| None |
Filter by the order of the 1st component (ordem1): the whole class, one of the 15 published (13 orders plus AFLORAMENTOS DE ROCHAS and DUNAS), with case, accents and the singular accepted ("latossolo" means LATOSSOLOS), applied locally to the prefix read. A fragment ("latos"), a blank, non-text or out-of-domain value raises InvalidParameterError before collection, listing the classes. If the filter matches nothing after a complete read, UserWarning and MetaInfo.validation_warnings report the requested value and the ordem1 values observed. |
bbox |
tuple \| None |
Bounding box (lon_min, lat_min, lon_max, lat_max) |
max_registros |
int \| None |
Cap on occurrences read in fid order (default 3,000; None reads the whole layer). Local filters only see this prefix; a cut that leaves the selection partial raises a UserWarning |
tamanho_pagina |
int \| None |
Occurrences per page: default 250 (profiles) / 500 (map), maximum 1000; with geometry (_geo or bbox), 100 / 25, maximum 100 |
return_meta |
bool |
Return a (GeoDataFrame, MetaInfo) tuple |
Returns: GeoDataFrame (MultiPolygon, EPSG:4326) with the same columns as mapa_solos() + geometry
Example:
from agrobr import embrapa_solos
# Soil polygons in a bbox
gdf = await embrapa_solos.mapa_solos_geo(bbox=(-56, -16, -54, -14))
Synchronous Version¶
from agrobr.sync import embrapa_solos
df = embrapa_solos.perfis(uf="MT")
df = embrapa_solos.mapa_solos()
Notes¶
- Source: EMBRAPA GeoInfo — license
nc(CC BY-NC 3.0 BR) - The
_geo()functions requirepip install agrobr[geo](geopandas) - 34,464 horizon/layer records (~9K points, PronaSolos 2020) and 2,852 pedological polygons
- Automatic WFS pagination
bboxand GeoDataFrame in EPSG:4326, the default CRS of both layers in the WFS