SFB — Servico Florestal Brasileiro¶
Overview¶
| Item | Detail |
|---|---|
| Provider | SFB (Servico Florestal Brasileiro) |
| Data | Public forests (CNFP), forest concessions, National Forest Inventory (IFN) |
| Access | ArcGIS REST API |
| Format | JSON without geometry (tabular) / GeoJSON (geo) |
| Authentication | None |
| License | Public data |
Layers¶
| Layer | Features | Geometry | Filters |
|---|---|---|---|
cnfp |
20,829 polygons (2026-09-23) | Polygon | uf, bioma, categoria, bbox |
concessoes |
8 polygons | Polygon | uf, bbox |
ifn_conglomerados |
68 points in DF (2026-10-02; national total not verified) | Point | uf, bioma, bbox |
Access via ArcGIS REST¶
| Parameter | Value |
|---|---|
| Base URL | https://mapas.florestal.gov.br/server/rest/services |
| CNFP Service | Hosted/CNFP_v19_03_retificado_17072025/FeatureServer/9 |
| Concessoes Service | Hosted/unidades_concessoes_florestais/FeatureServer/0 |
| IFN Service | DadosAbertos-IFN/dataset_ifn_tb_pontos_lote/FeatureServer/0 |
| Pagination | Keyset on CNFP and concessions (fid > last, orderByFields=fid), 2,000 features per page; IFN by co_pontos_lote and its auxiliary layer by co_lote |
| Throttle | 2s delay after 5 pages |
Usage Example¶
import asyncio
from agrobr import sfb
async def main():
# CNFP — Cadastro Nacional de Florestas Publicas
df = await sfb.cnfp(uf="AM")
df = await sfb.cnfp(bioma="Amazonia", categoria="FLONA")
# CNFP with geometry
gdf = await sfb.cnfp_geo(uf="PA")
# Forest concessions
df = await sfb.concessoes()
gdf = await sfb.concessoes_geo()
# IFN — National Forest Inventory (conglomerates)
df = await sfb.ifn_conglomerados(uf="MG")
df = await sfb.ifn_conglomerados(bioma="Cerrado")
# IFN with geometry
gdf = await sfb.ifn_conglomerados_geo(uf="SP")
# Filter by bbox
df = await sfb.cnfp(bbox=(-60, -10, -55, -5))
# With metadata
df, meta = await sfb.cnfp(uf="AM", return_meta=True)
# Polars
df = await sfb.cnfp(as_polars=True)
asyncio.run(main())
Columns by Layer¶
cnfp¶
| Column | Type | Description |
|---|---|---|
| fid | int | Record ID |
| nome | str | Public forest name |
| uf | str | State (abbreviation) |
| bioma | str | Biome |
| categoria | str | Forest category |
| tipo | str | Type |
| governo | str | Government level |
| classe | str | Class |
| area_ha | float | Area in hectares |
| ano_criacao | Int64 | Creation year taken from the published date (see Specifics) |
| ano_criacao_texto | str | Text published in anocriacao, as it came from the source (null when the source publishes it empty; a feature without the anocriacao field raises ParseError) |
| municipio | str | Municipality |
concessoes¶
| Column | Type | Description |
|---|---|---|
| fid | int | Record ID |
| nome | str | Unit name |
| uf | str | State (abbreviation) |
| bioma | str | Biome |
| area_ha | float | Area in hectares |
| ano_criacao | Int64 | Creation year (the service publishes the year as an integer) |
| grupo | str | Group |
| categoria | str | Category |
ifn_conglomerados¶
| Column | Type | Description |
|---|---|---|
| id | int | Record ID |
| codigo_lote | int | Lot code |
| lote | nullable str | Published name from the auxiliary layer, joined on co_lote |
| conglomerado | str | Conglomerate |
| uf | str | State (abbreviation) |
| municipio | str | Municipality |
| bioma | str | Biome |
| ciclo | nullable str | Source text from nu_ciclo_execucao |
Specifics¶
- IFN, schema 1.1: retains the seven previous columns and adds nullable text
ciclo.lotecomes fromDadosAbertos-IFN/dataset_ifn_tb_lote/FeatureServer/23, queried without geometry for referenced codes only, in groups of at most 100. The many-to-one join preserves point order and row count. An unmatched code, duplicate code in the auxiliary layer or missing field raisesParseError; an auxiliary request failure does not return a partial table. A code or lot name published as null remains null and is recorded inMetaInfo.validation_warnings. - IFN provenance:
source_details.resourceslists data pages for points and lots, each withrole, query URL,sha256andbytes. Count responses are excluded.raw_content_hashis the SHA-256 of this list serialized as UTF-8 JSON with sorted keys, no spaces and Unicode characters preserved (sort_keys=True,separators=(",", ":"),ensure_ascii=False);raw_content_sizemeasures this manifest.source_details.hash_kindisresource_manifest_sha256, andsource_details.resource_bytessums the original bodies. An empty selection has the list[]and does not query the auxiliary layer. - Reconstructing the IFN digest:
source_details.manifest_encoding="canonical_json_utf8"andmanifest_fields=["resources"]identify the serialization and its source.manifest_root="resources"indicates that the serialized content is the list insource_details.resourcesitself, without wrapping it in an object. UTF-8 encoding preserves Unicode, sorts keys and uses compact separators, as specified above. -
IFN biome filter: uses
UPPER(no_bioma); returned text retains the published case, such asCerradoin DF. The geo variant requests EPSG:4326; the points' native CRS is EPSG:4674. Health checks the DF point count without certifying the join; reconciliation checks IDs, attributes and lot names against an independent reading. -
CNFP service name: includes the rectification date in the path (
CNFP_v19_03_retificado_17072025) - Keyset pagination: on CNFP and concessions, pages follow increasing
fid(fid > lastwithorderByFields=fid). If the pages add up to fewer features than the official count, the query raisesSourceUnavailableErrorstating how many are missing, instead of returning a partial result. An HTML response (maintenance or a WAF block, even with status 200) also becomesSourceUnavailableError - CNFP creation year: the service's
anocriacaofield is text with the full date (DD/MM/YYYY,DD-MM-YYYY; rarelyYYYY-MM-DD,YYYY/MM/DDor the year alone). agrobr publishes the year when the text has a single year. It is null when the field is blank or-, and when the date is compound with different years (overlapping units, e.g.22/06/2011 / 10-01-2002on a "PA / APA"). In that last case aUserWarningandMetaInfo.validation_warningsreport the count and up to three examples of the published text; thesfb_ano_criacao_ambiguolog is also retained. In the 2026-09-23 layer: 15,068 of 20,829 records with a year, 4,718 blank or-and 1,043 compound with different years. Theano_criacao_textocolumn carries the published text on every row, compound ones included, and the CNFPMetaInfo.schema_versionis1.1 - Required fields: every field requested from the service (
outFields) must be present in every feature of every page in the tabular functions, and in every page in the_geovariants. The service sends all of them, nulls included, so a missing field is a layout change and raisesParseErrornaming the field, instead of returning one column fewer - Tabular without geometry:
cnfp(),concessoes()andifn_conglomerados()requestreturnGeometry=false(the first page of the national CNFP drops from 378 MB to 0.5 MB); geometry only comes with the_geofunctions - Units and CRS: area in hectares as published (
area_haon CNFP,hectareson concessions), not recomputed from the geometry. Geometry is requested in EPSG:4326 (outSR=4326) and reprojected by the server (CNFP is stored in 3857 and concessions in 4674) - Invalid geometry: geometry is returned as the server publishes it, without repair; when there is an invalid non-null geometry,
cnfp_geo,concessoes_geoandifn_conglomerados_geowarn (UserWarningandmeta.validation_warnings: "SFB cnfp: N de M geometrias inválidas como publicadas pela fonte; use make_valid antes de operações espaciais.") and put the count inmeta.source_details(geometrias_invalidas,geometrias). Without invalid geometries, nothing changes - Parameters: an unknown argument raises
TypeErrorbefore any request; invaliduf,biomaandcategoriaraiseInvalidParameterError; an invalidbboxraisesValueError - Composite filters: CNFP and IFN accept a bioma filter in addition to uf and bbox
Identifiers, codes and years use nullable Int64; areas use float64. Text uses the native pandas dtype (str on pandas 3, object on pandas 2), including empty results.
Limitations¶
- IFN uses the active point and lot layers following this migration. The DF capture from October 2, 2026 contains 68 points in lot
DF-01. Historical goldens from the former service contain only unavailability errors: historical ID or population correspondence has not been established. - Points and lots are current publications queried separately; the join does not promise a transactional snapshot across both layers.
- Data reflects the current state of the SFB ArcGIS Server
- Forest concessions have few records (~8 polygons)
- 2s throttle after 5 pages to avoid overloading the server
Raw collection¶
agrobr.bruto.coletar("sfb", "cnfp", ...) stores the original pages of the CNFP layer (Hosted/CNFP_v19_03_retificado_17072025/FeatureServer/9) as Esri JSON, in the native CRS (wkid 102100, latestWkid 3857, recorded as EPSG:3857), with every attribute and the geometry; cnfp_geo stays in EPSG:4326. Always national: state and bbox are refused. The edition in the manifest is 20250717, the rectification date in the service name; the layer's last edit comes in the responses' etag. Coverage is checked by returnCountOnly before and after the pages and by the official fid list (returnIdsOnly). Pages are ranges of that list, requested with orderByFields=fid, and each must bring exactly the range's fid values, in ascending order.
On 2026-10-04 the layer had 20,829 features; the largest had 5.52 MB, and 100-feature pages reached 37.7 MB. With the defaults (tamanho_pagina=100, 8 MiB max_bytes_pagina), the collection stops early, on the 4th page, with a ResourceLimitError that states the page, the fid range and the limit. No page size fits the default limits: 3 or more features per page exceed 8 MiB, and 2 or fewer exceed max_paginas. For the whole country:
from agrobr import bruto
coleta = await bruto.coletar(
"sfb",
"cnfp",
destino="coleta",
tamanho_pagina=20,
limites=bruto.LimitesBrutos(max_bytes_pagina=24 * 1024**2),
)
The 2026-10-04 collection closed ok with 1,042 pages (980 MB), the largest 19.3 MB, in 37.5 minutes. See the raw collection API and the manifest contract.