IPHAN¶
O Instituto do Patrimônio Histórico e Artístico Nacional (IPHAN) mantem um GeoServer disponível no endereço:
In [ ]:
Copied!
import io
import geopandas as gpd
from owslib.wfs import WebFeatureService
import io
import geopandas as gpd
from owslib.wfs import WebFeatureService
In [ ]:
Copied!
wfs = WebFeatureService(
url='http://portal.iphan.gov.br/geoserver/ows',
version='2.0.0',
)
wfs = WebFeatureService(
url='http://portal.iphan.gov.br/geoserver/ows',
version='2.0.0',
)
In [ ]:
Copied!
list_layers = list(wfs.contents)
list_layers.sort()
print(f"Existem {len(list_layers)} camadas disponíveis no serviço WFS.")
# Display the first 10 layers
list_layers[0:10]
list_layers = list(wfs.contents)
list_layers.sort()
print(f"Existem {len(list_layers)} camadas disponíveis no serviço WFS.")
# Display the first 10 layers
list_layers[0:10]
É possível observar alguns "agrupamentos" de dados. O layer BDIA:geol_linha_fratura pertence ao "grupo" BDIA, por exemplo.
- CNA: Centro Nacional de Arqueologia
- DBGEO: Utilizada para armazenar dados de negócio da Coordenação Nacional de Licenciamento Ambiental - CNL
- FCA: Fichas de Caracterização de Atividade
- DEPAN: Departamento de Patrimônio Material e Fiscalização
- SICG: Sistema Integrado de Conhecimento e Gestão
- Nimuendaju: Mapa Etno-histórico de Curt Nimuendajú
Encontrei um post no LinkedIn que explica a IDE - Infraestrutura de Dados Espaciais - IPHAN.
In [ ]:
Copied!
set([layer.split(':')[0] for layer in list_layers])
set([layer.split(':')[0] for layer in list_layers])
Uma vez que conhecemos os "grupos", podemos visualizar os layers de um determinado grupo.
In [ ]:
Copied!
list_layers = [layer for layer in list_layers if layer.startswith('Nimuendaju')]
print(f"Existem {len(list_layers)} camadas disponíveis no serviço WFS.")
# Display the first 10 layers
list_layers[0:10]
list_layers = [layer for layer in list_layers if layer.startswith('Nimuendaju')]
print(f"Existem {len(list_layers)} camadas disponíveis no serviço WFS.")
# Display the first 10 layers
list_layers[0:10]
In [ ]:
Copied!
# Obter os dados no formato GeoJSON (ou outro formato suportado)
response = wfs.getfeature(
typename='SICG:sitios_pol',
# bbox=(173700, 440400, 178700, 441400),
# srsname='EPSG:28992'
# srsname='EPSG:4326',
srsname='EPSG:4674',
outputFormat='application/json',
)
response
# Obter os dados no formato GeoJSON (ou outro formato suportado)
response = wfs.getfeature(
typename='SICG:sitios_pol',
# bbox=(173700, 440400, 178700, 441400),
# srsname='EPSG:28992'
# srsname='EPSG:4326',
srsname='EPSG:4674',
outputFormat='application/json',
)
response
In [ ]:
Copied!
gdf = gpd.read_file(filename=io.BytesIO(response.read()))
gdf.info()
gdf.head(2)
gdf = gpd.read_file(filename=io.BytesIO(response.read()))
gdf.info()
gdf.head(2)
In [ ]:
Copied!
gdf.crs
gdf.crs
In [ ]:
Copied!
gdf.explore(column='ds_classificacao', tiles='Esri.WorldImagery')
gdf.explore(column='ds_classificacao', tiles='Esri.WorldImagery')
In [ ]:
Copied!