tunned-geobr 0.2.8__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tunned_geobr/__init__.py +3 -0
- tunned_geobr/list_geobr.py +6 -1
- tunned_geobr/read_amazon.py +1 -1
- tunned_geobr/read_gnl_terminals.py +5 -4
- tunned_geobr/read_ibama_embargoes.py +85 -0
- tunned_geobr/read_icmbio_embargoes.py +83 -0
- tunned_geobr/read_icmbio_infractions.py +83 -0
- tunned_geobr/read_natural_gas_delivery_points.py +6 -5
- tunned_geobr/read_natural_gas_processing_hub.py +6 -5
- tunned_geobr/read_pio_ducts.py +5 -4
- {tunned_geobr-0.2.8.dist-info → tunned_geobr-1.0.0.dist-info}/METADATA +1 -1
- {tunned_geobr-0.2.8.dist-info → tunned_geobr-1.0.0.dist-info}/RECORD +15 -12
- {tunned_geobr-0.2.8.dist-info → tunned_geobr-1.0.0.dist-info}/WHEEL +0 -0
- {tunned_geobr-0.2.8.dist-info → tunned_geobr-1.0.0.dist-info}/entry_points.txt +0 -0
- {tunned_geobr-0.2.8.dist-info → tunned_geobr-1.0.0.dist-info}/licenses/LICENSE.txt +0 -0
tunned_geobr/__init__.py
CHANGED
@@ -125,3 +125,6 @@ from .read_natural_gas_processing_hub import read_natural_gas_processing_hub
|
|
125
125
|
from .read_compression_stations import read_compression_stations
|
126
126
|
from .read_natural_gas_delivery_points import read_natural_gas_delivery_points
|
127
127
|
from .read_quilombola_areas import read_quilombola_areas
|
128
|
+
from .read_icmbio_embargoes import read_icmbio_embargoes
|
129
|
+
from .read_icmbio_infractions import read_icmbio_infractions
|
130
|
+
from .read_ibama_embargoes import read_ibama_embargoes
|
tunned_geobr/list_geobr.py
CHANGED
@@ -168,7 +168,12 @@ def list_geobr():
|
|
168
168
|
{"Function": "read_og_basement", "Geography": "Oil and Gas Basement", "Years": "All", "Source": "EPE"},
|
169
169
|
{"Function": "read_hydroelectric_feasibility_studies", "Geography": "Hydroelectric Feasibility Studies", "Years": "All", "Source": "EPE"},
|
170
170
|
{"Function": "read_hydroelectric_inventory_aai_studies", "Geography": "Hydroelectric Inventory and AAI Studies", "Years": "All", "Source": "EPE"},
|
171
|
-
{"Function": "read_ama_anemometric_towers", "Geography": "AMA Anemometric Towers", "Years": "All", "Source": "EPE"}
|
171
|
+
{"Function": "read_ama_anemometric_towers", "Geography": "AMA Anemometric Towers", "Years": "All", "Source": "EPE"},
|
172
|
+
|
173
|
+
# Environmental Enforcement Data
|
174
|
+
{"Function": "read_icmbio_embargoes", "Geography": "ICMBio Embargoed Areas", "Years": "All", "Source": "ICMBio"},
|
175
|
+
{"Function": "read_icmbio_infractions", "Geography": "ICMBio Infraction Notices", "Years": "All", "Source": "ICMBio"},
|
176
|
+
{"Function": "read_ibama_embargoes", "Geography": "IBAMA Embargoed Areas", "Years": "All", "Source": "IBAMA"}
|
172
177
|
]
|
173
178
|
|
174
179
|
# Create DataFrame
|
tunned_geobr/read_amazon.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from geobr.utils import select_metadata, download_gpkg
|
2
2
|
|
3
3
|
|
4
|
-
def read_amazon(year=2012, simplified=
|
4
|
+
def read_amazon(year=2012, simplified=False, verbose=False):
|
5
5
|
""" Download official data of Brazil's Legal Amazon as an sf object.
|
6
6
|
|
7
7
|
This data set covers the whole of Brazil's Legal Amazon as defined in the federal law n. 12.651/2012). The original
|
@@ -85,8 +85,9 @@ def read_gnl_terminals(simplified=False, verbose=False):
|
|
85
85
|
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
86
86
|
zip_ref.extractall(temp_dir)
|
87
87
|
|
88
|
+
zip_dir = os.path.join(temp_dir,'zipfolder')
|
88
89
|
# Find the shapefile in the extracted files
|
89
|
-
shp_files = [f for f in os.listdir(
|
90
|
+
shp_files = [f for f in os.listdir(zip_dir) if f.endswith('.shp')]
|
90
91
|
|
91
92
|
if not shp_files:
|
92
93
|
raise Exception("No shapefile found in the downloaded zip file")
|
@@ -95,7 +96,7 @@ def read_gnl_terminals(simplified=False, verbose=False):
|
|
95
96
|
if verbose:
|
96
97
|
print("Reading shapefile")
|
97
98
|
|
98
|
-
shp_path = os.path.join(
|
99
|
+
shp_path = os.path.join(zip_dir, shp_files[0])
|
99
100
|
gdf = gpd.read_file(shp_path)
|
100
101
|
|
101
102
|
# Convert to SIRGAS 2000 (EPSG:4674)
|
@@ -111,7 +112,7 @@ def read_gnl_terminals(simplified=False, verbose=False):
|
|
111
112
|
|
112
113
|
# Select only the most important columns
|
113
114
|
# Adjust these columns based on the actual data structure
|
114
|
-
cols_to_keep = ['NOME', 'EMPRESA', '
|
115
|
+
cols_to_keep = ['NOME', 'EMPRESA', 'TIPO', 'CAPACIDADE', 'UF', 'MUNICIPIO', 'geometry']
|
115
116
|
cols_available = [col for col in cols_to_keep if col in gdf.columns]
|
116
117
|
|
117
118
|
if not cols_available:
|
@@ -120,7 +121,7 @@ def read_gnl_terminals(simplified=False, verbose=False):
|
|
120
121
|
gdf = gdf[cols_available]
|
121
122
|
|
122
123
|
if verbose:
|
123
|
-
print("Finished processing
|
124
|
+
print("Finished processing oil and derivatives terminals data")
|
124
125
|
|
125
126
|
return gdf
|
126
127
|
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import geopandas as gpd
|
2
|
+
import requests
|
3
|
+
from io import BytesIO
|
4
|
+
|
5
|
+
def read_ibama_embargoes(simplified=False, verbose=False):
|
6
|
+
"""Download IBAMA Embargoes data.
|
7
|
+
|
8
|
+
This function downloads and processes embargoes data from the Brazilian Institute
|
9
|
+
of Environment and Renewable Natural Resources (IBAMA) through their WFS service.
|
10
|
+
Original source: IBAMA SISCOM
|
11
|
+
|
12
|
+
Parameters
|
13
|
+
----------
|
14
|
+
simplified : boolean, by default False
|
15
|
+
If True, returns a simplified version of the dataset with fewer columns
|
16
|
+
verbose : boolean, by default False
|
17
|
+
If True, prints detailed information about the download process
|
18
|
+
|
19
|
+
Returns
|
20
|
+
-------
|
21
|
+
gpd.GeoDataFrame
|
22
|
+
Geodataframe with IBAMA Embargoes data
|
23
|
+
|
24
|
+
Example
|
25
|
+
-------
|
26
|
+
>>> from tunned_geobr import read_ibama_embargoes
|
27
|
+
|
28
|
+
# Read IBAMA Embargoes data
|
29
|
+
>>> embargoes = read_ibama_embargoes()
|
30
|
+
"""
|
31
|
+
|
32
|
+
url = "https://siscom.ibama.gov.br/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=publica:vw_brasil_adm_embargo_a&outputFormat=application/json"
|
33
|
+
|
34
|
+
if verbose:
|
35
|
+
print("Downloading IBAMA Embargoes data...")
|
36
|
+
|
37
|
+
try:
|
38
|
+
# Download the JSON data
|
39
|
+
response = requests.get(url)
|
40
|
+
if response.status_code != 200:
|
41
|
+
raise Exception(f"Failed to download data from IBAMA WFS service. Status code: {response.status_code}")
|
42
|
+
|
43
|
+
if verbose:
|
44
|
+
print("Data downloaded successfully. Processing...")
|
45
|
+
|
46
|
+
# Read the GeoJSON directly from the response content
|
47
|
+
gdf = gpd.read_file(BytesIO(response.content))
|
48
|
+
|
49
|
+
# Convert to SIRGAS 2000 (EPSG:4674) if needed
|
50
|
+
if gdf.crs is None or gdf.crs.to_epsg() != 4674:
|
51
|
+
if verbose:
|
52
|
+
print(f"Converting CRS from {gdf.crs} to SIRGAS 2000 (EPSG:4674)")
|
53
|
+
gdf = gdf.to_crs(4674)
|
54
|
+
|
55
|
+
if simplified:
|
56
|
+
# Keep only the most relevant columns
|
57
|
+
# Adjust these based on the actual columns in the dataset
|
58
|
+
columns_to_keep = [
|
59
|
+
'geometry',
|
60
|
+
'nm_municipio', # Municipality name
|
61
|
+
'sg_uf', # State abbreviation
|
62
|
+
'nm_pessoa', # Person/entity name
|
63
|
+
'nr_cpfcnpj', # CPF/CNPJ number
|
64
|
+
'dt_embargo', # Embargo date
|
65
|
+
'nr_processo', # Process number
|
66
|
+
'nr_termo', # Term number
|
67
|
+
'ar_embargada', # Embargoed area
|
68
|
+
'tp_infracao', # Infraction type
|
69
|
+
'ds_infracao' # Infraction description
|
70
|
+
]
|
71
|
+
|
72
|
+
# Filter columns that actually exist in the dataset
|
73
|
+
existing_columns = ['geometry'] + [col for col in columns_to_keep[1:] if col in gdf.columns]
|
74
|
+
gdf = gdf[existing_columns]
|
75
|
+
|
76
|
+
if verbose:
|
77
|
+
print(f"Simplified dataset with {len(existing_columns)} columns")
|
78
|
+
|
79
|
+
except Exception as e:
|
80
|
+
raise Exception(f"Error downloading IBAMA Embargoes data: {str(e)}")
|
81
|
+
|
82
|
+
if verbose:
|
83
|
+
print(f"Download completed. Returning GeoDataFrame with {len(gdf)} records")
|
84
|
+
|
85
|
+
return gdf
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import geopandas as gpd
|
2
|
+
import requests
|
3
|
+
from io import BytesIO
|
4
|
+
|
5
|
+
def read_icmbio_embargoes(simplified=False, verbose=False):
|
6
|
+
"""Download ICMBio Embargoes data.
|
7
|
+
|
8
|
+
This function downloads and processes embargoes data from the Brazilian Institute
|
9
|
+
of Environment and Renewable Natural Resources (ICMBio) through the National Spatial
|
10
|
+
Data Infrastructure (INDE) WFS service.
|
11
|
+
Original source: ICMBio via INDE
|
12
|
+
|
13
|
+
Parameters
|
14
|
+
----------
|
15
|
+
simplified : boolean, by default False
|
16
|
+
If True, returns a simplified version of the dataset with fewer columns
|
17
|
+
verbose : boolean, by default False
|
18
|
+
If True, prints detailed information about the download process
|
19
|
+
|
20
|
+
Returns
|
21
|
+
-------
|
22
|
+
gpd.GeoDataFrame
|
23
|
+
Geodataframe with ICMBio Embargoes data
|
24
|
+
|
25
|
+
Example
|
26
|
+
-------
|
27
|
+
>>> from tunned_geobr import read_icmbio_embargoes
|
28
|
+
|
29
|
+
# Read ICMBio Embargoes data
|
30
|
+
>>> embargoes = read_icmbio_embargoes()
|
31
|
+
"""
|
32
|
+
|
33
|
+
url = "https://geoservicos.inde.gov.br/geoserver/ICMBio/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=embargos_icmbio&outputFormat=application/json"
|
34
|
+
|
35
|
+
if verbose:
|
36
|
+
print("Downloading ICMBio Embargoes data...")
|
37
|
+
|
38
|
+
try:
|
39
|
+
# Download the JSON data
|
40
|
+
response = requests.get(url)
|
41
|
+
if response.status_code != 200:
|
42
|
+
raise Exception(f"Failed to download data from ICMBio WFS service. Status code: {response.status_code}")
|
43
|
+
|
44
|
+
if verbose:
|
45
|
+
print("Data downloaded successfully. Processing...")
|
46
|
+
|
47
|
+
# Read the GeoJSON directly from the response content
|
48
|
+
gdf = gpd.read_file(BytesIO(response.content))
|
49
|
+
|
50
|
+
# Convert to SIRGAS 2000 (EPSG:4674) if needed
|
51
|
+
if gdf.crs is None or gdf.crs.to_epsg() != 4674:
|
52
|
+
if verbose:
|
53
|
+
print(f"Converting CRS from {gdf.crs} to SIRGAS 2000 (EPSG:4674)")
|
54
|
+
gdf = gdf.to_crs(4674)
|
55
|
+
|
56
|
+
if simplified:
|
57
|
+
# Keep only the most relevant columns
|
58
|
+
# Adjust these based on the actual columns in the dataset
|
59
|
+
columns_to_keep = [
|
60
|
+
'geometry',
|
61
|
+
'NOME_AREA', # Area name
|
62
|
+
'MUNICIPIO', # Municipality
|
63
|
+
'UF', # State
|
64
|
+
'AREA_HA', # Area in hectares
|
65
|
+
'TIPO_INFRA', # Infraction type
|
66
|
+
'DATA_EMBARG', # Embargo date
|
67
|
+
'TERMO_EMBG' # Embargo term
|
68
|
+
]
|
69
|
+
|
70
|
+
# Filter columns that actually exist in the dataset
|
71
|
+
existing_columns = ['geometry'] + [col for col in columns_to_keep[1:] if col in gdf.columns]
|
72
|
+
gdf = gdf[existing_columns]
|
73
|
+
|
74
|
+
if verbose:
|
75
|
+
print(f"Simplified dataset with {len(existing_columns)} columns")
|
76
|
+
|
77
|
+
except Exception as e:
|
78
|
+
raise Exception(f"Error downloading ICMBio Embargoes data: {str(e)}")
|
79
|
+
|
80
|
+
if verbose:
|
81
|
+
print(f"Download completed. Returning GeoDataFrame with {len(gdf)} records")
|
82
|
+
|
83
|
+
return gdf
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import geopandas as gpd
|
2
|
+
import requests
|
3
|
+
from io import BytesIO
|
4
|
+
|
5
|
+
def read_icmbio_infractions(simplified=False, verbose=False):
|
6
|
+
"""Download ICMBio Infraction Notices data.
|
7
|
+
|
8
|
+
This function downloads and processes infraction notices data from the Brazilian Institute
|
9
|
+
of Environment and Renewable Natural Resources (ICMBio) through the National Spatial
|
10
|
+
Data Infrastructure (INDE) WFS service.
|
11
|
+
Original source: ICMBio via INDE
|
12
|
+
|
13
|
+
Parameters
|
14
|
+
----------
|
15
|
+
simplified : boolean, by default False
|
16
|
+
If True, returns a simplified version of the dataset with fewer columns
|
17
|
+
verbose : boolean, by default False
|
18
|
+
If True, prints detailed information about the download process
|
19
|
+
|
20
|
+
Returns
|
21
|
+
-------
|
22
|
+
gpd.GeoDataFrame
|
23
|
+
Geodataframe with ICMBio Infraction Notices data
|
24
|
+
|
25
|
+
Example
|
26
|
+
-------
|
27
|
+
>>> from tunned_geobr import read_icmbio_infractions
|
28
|
+
|
29
|
+
# Read ICMBio Infraction Notices data
|
30
|
+
>>> infractions = read_icmbio_infractions()
|
31
|
+
"""
|
32
|
+
|
33
|
+
url = "https://geoservicos.inde.gov.br/geoserver/ICMBio/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=autos_infracao_icmbio&outputFormat=application/json"
|
34
|
+
|
35
|
+
if verbose:
|
36
|
+
print("Downloading ICMBio Infraction Notices data...")
|
37
|
+
|
38
|
+
try:
|
39
|
+
# Download the JSON data
|
40
|
+
response = requests.get(url)
|
41
|
+
if response.status_code != 200:
|
42
|
+
raise Exception(f"Failed to download data from ICMBio WFS service. Status code: {response.status_code}")
|
43
|
+
|
44
|
+
if verbose:
|
45
|
+
print("Data downloaded successfully. Processing...")
|
46
|
+
|
47
|
+
# Read the GeoJSON directly from the response content
|
48
|
+
gdf = gpd.read_file(BytesIO(response.content))
|
49
|
+
|
50
|
+
# Convert to SIRGAS 2000 (EPSG:4674) if needed
|
51
|
+
if gdf.crs is None or gdf.crs.to_epsg() != 4674:
|
52
|
+
if verbose:
|
53
|
+
print(f"Converting CRS from {gdf.crs} to SIRGAS 2000 (EPSG:4674)")
|
54
|
+
gdf = gdf.to_crs(4674)
|
55
|
+
|
56
|
+
if simplified:
|
57
|
+
# Keep only the most relevant columns
|
58
|
+
# Adjust these based on the actual columns in the dataset
|
59
|
+
columns_to_keep = [
|
60
|
+
'geometry',
|
61
|
+
'MUNICIPIO', # Municipality
|
62
|
+
'UF', # State
|
63
|
+
'DATA_AUTO', # Infraction date
|
64
|
+
'TIPO_INFRA', # Infraction type
|
65
|
+
'AREA_PROTE', # Protected area
|
66
|
+
'VALOR_AUTO', # Fine value
|
67
|
+
'NUM_AUTO' # Infraction number
|
68
|
+
]
|
69
|
+
|
70
|
+
# Filter columns that actually exist in the dataset
|
71
|
+
existing_columns = ['geometry'] + [col for col in columns_to_keep[1:] if col in gdf.columns]
|
72
|
+
gdf = gdf[existing_columns]
|
73
|
+
|
74
|
+
if verbose:
|
75
|
+
print(f"Simplified dataset with {len(existing_columns)} columns")
|
76
|
+
|
77
|
+
except Exception as e:
|
78
|
+
raise Exception(f"Error downloading ICMBio Infraction Notices data: {str(e)}")
|
79
|
+
|
80
|
+
if verbose:
|
81
|
+
print(f"Download completed. Returning GeoDataFrame with {len(gdf)} records")
|
82
|
+
|
83
|
+
return gdf
|
@@ -67,7 +67,7 @@ def read_natural_gas_delivery_points(simplified=False, verbose=False):
|
|
67
67
|
# Create a temporary directory to store the downloaded files
|
68
68
|
with tempfile.TemporaryDirectory() as temp_dir:
|
69
69
|
# Download the zip file
|
70
|
-
zip_path = os.path.join(temp_dir, "
|
70
|
+
zip_path = os.path.join(temp_dir, "delivery_points.zip")
|
71
71
|
if verbose:
|
72
72
|
print("Downloading zip file")
|
73
73
|
|
@@ -85,8 +85,9 @@ def read_natural_gas_delivery_points(simplified=False, verbose=False):
|
|
85
85
|
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
86
86
|
zip_ref.extractall(temp_dir)
|
87
87
|
|
88
|
+
zip_dir = os.path.join(temp_dir,'zipfolder')
|
88
89
|
# Find the shapefile in the extracted files
|
89
|
-
shp_files = [f for f in os.listdir(
|
90
|
+
shp_files = [f for f in os.listdir(zip_dir) if f.endswith('.shp')]
|
90
91
|
|
91
92
|
if not shp_files:
|
92
93
|
raise Exception("No shapefile found in the downloaded zip file")
|
@@ -95,7 +96,7 @@ def read_natural_gas_delivery_points(simplified=False, verbose=False):
|
|
95
96
|
if verbose:
|
96
97
|
print("Reading shapefile")
|
97
98
|
|
98
|
-
shp_path = os.path.join(
|
99
|
+
shp_path = os.path.join(zip_dir, shp_files[0])
|
99
100
|
gdf = gpd.read_file(shp_path)
|
100
101
|
|
101
102
|
# Convert to SIRGAS 2000 (EPSG:4674)
|
@@ -111,7 +112,7 @@ def read_natural_gas_delivery_points(simplified=False, verbose=False):
|
|
111
112
|
|
112
113
|
# Select only the most important columns
|
113
114
|
# Adjust these columns based on the actual data structure
|
114
|
-
cols_to_keep = ['NOME', 'TIPO', 'UF', 'MUNICIPIO', 'geometry']
|
115
|
+
cols_to_keep = ['NOME', 'EMPRESA', 'TIPO', 'CAPACIDADE', 'UF', 'MUNICIPIO', 'geometry']
|
115
116
|
cols_available = [col for col in cols_to_keep if col in gdf.columns]
|
116
117
|
|
117
118
|
if not cols_available:
|
@@ -120,7 +121,7 @@ def read_natural_gas_delivery_points(simplified=False, verbose=False):
|
|
120
121
|
gdf = gdf[cols_available]
|
121
122
|
|
122
123
|
if verbose:
|
123
|
-
print("Finished processing
|
124
|
+
print("Finished processing oil and derivatives terminals data")
|
124
125
|
|
125
126
|
return gdf
|
126
127
|
|
@@ -67,7 +67,7 @@ def read_natural_gas_processing_hub(simplified=False, verbose=False):
|
|
67
67
|
# Create a temporary directory to store the downloaded files
|
68
68
|
with tempfile.TemporaryDirectory() as temp_dir:
|
69
69
|
# Download the zip file
|
70
|
-
zip_path = os.path.join(temp_dir, "
|
70
|
+
zip_path = os.path.join(temp_dir, "processing_hubs.zip")
|
71
71
|
if verbose:
|
72
72
|
print("Downloading zip file")
|
73
73
|
|
@@ -85,8 +85,9 @@ def read_natural_gas_processing_hub(simplified=False, verbose=False):
|
|
85
85
|
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
86
86
|
zip_ref.extractall(temp_dir)
|
87
87
|
|
88
|
+
zip_dir = os.path.join(temp_dir,'zipfolder')
|
88
89
|
# Find the shapefile in the extracted files
|
89
|
-
shp_files = [f for f in os.listdir(
|
90
|
+
shp_files = [f for f in os.listdir(zip_dir) if f.endswith('.shp')]
|
90
91
|
|
91
92
|
if not shp_files:
|
92
93
|
raise Exception("No shapefile found in the downloaded zip file")
|
@@ -95,7 +96,7 @@ def read_natural_gas_processing_hub(simplified=False, verbose=False):
|
|
95
96
|
if verbose:
|
96
97
|
print("Reading shapefile")
|
97
98
|
|
98
|
-
shp_path = os.path.join(
|
99
|
+
shp_path = os.path.join(zip_dir, shp_files[0])
|
99
100
|
gdf = gpd.read_file(shp_path)
|
100
101
|
|
101
102
|
# Convert to SIRGAS 2000 (EPSG:4674)
|
@@ -111,7 +112,7 @@ def read_natural_gas_processing_hub(simplified=False, verbose=False):
|
|
111
112
|
|
112
113
|
# Select only the most important columns
|
113
114
|
# Adjust these columns based on the actual data structure
|
114
|
-
cols_to_keep = ['NOME', 'EMPRESA', 'CAPACIDADE', 'UF', 'MUNICIPIO', 'geometry']
|
115
|
+
cols_to_keep = ['NOME', 'EMPRESA', 'TIPO', 'CAPACIDADE', 'UF', 'MUNICIPIO', 'geometry']
|
115
116
|
cols_available = [col for col in cols_to_keep if col in gdf.columns]
|
116
117
|
|
117
118
|
if not cols_available:
|
@@ -120,7 +121,7 @@ def read_natural_gas_processing_hub(simplified=False, verbose=False):
|
|
120
121
|
gdf = gdf[cols_available]
|
121
122
|
|
122
123
|
if verbose:
|
123
|
-
print("Finished processing
|
124
|
+
print("Finished processing oil and derivatives terminals data")
|
124
125
|
|
125
126
|
return gdf
|
126
127
|
|
tunned_geobr/read_pio_ducts.py
CHANGED
@@ -85,8 +85,9 @@ def read_pio_ducts(simplified=False, verbose=False):
|
|
85
85
|
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
86
86
|
zip_ref.extractall(temp_dir)
|
87
87
|
|
88
|
+
zip_dir = os.path.join(temp_dir,'zipfolder')
|
88
89
|
# Find the shapefile in the extracted files
|
89
|
-
shp_files = [f for f in os.listdir(
|
90
|
+
shp_files = [f for f in os.listdir(zip_dir) if f.endswith('.shp')]
|
90
91
|
|
91
92
|
if not shp_files:
|
92
93
|
raise Exception("No shapefile found in the downloaded zip file")
|
@@ -95,7 +96,7 @@ def read_pio_ducts(simplified=False, verbose=False):
|
|
95
96
|
if verbose:
|
96
97
|
print("Reading shapefile")
|
97
98
|
|
98
|
-
shp_path = os.path.join(
|
99
|
+
shp_path = os.path.join(zip_dir, shp_files[0])
|
99
100
|
gdf = gpd.read_file(shp_path)
|
100
101
|
|
101
102
|
# Convert to SIRGAS 2000 (EPSG:4674)
|
@@ -111,7 +112,7 @@ def read_pio_ducts(simplified=False, verbose=False):
|
|
111
112
|
|
112
113
|
# Select only the most important columns
|
113
114
|
# Adjust these columns based on the actual data structure
|
114
|
-
cols_to_keep = ['NOME', 'EMPRESA', '
|
115
|
+
cols_to_keep = ['NOME', 'EMPRESA', 'TIPO', 'CAPACIDADE', 'UF', 'MUNICIPIO', 'geometry']
|
115
116
|
cols_available = [col for col in cols_to_keep if col in gdf.columns]
|
116
117
|
|
117
118
|
if not cols_available:
|
@@ -120,7 +121,7 @@ def read_pio_ducts(simplified=False, verbose=False):
|
|
120
121
|
gdf = gdf[cols_available]
|
121
122
|
|
122
123
|
if verbose:
|
123
|
-
print("Finished processing
|
124
|
+
print("Finished processing oil and derivatives terminals data")
|
124
125
|
|
125
126
|
return gdf
|
126
127
|
|
@@ -1,13 +1,13 @@
|
|
1
|
-
tunned_geobr-0.
|
2
|
-
tunned_geobr-0.
|
3
|
-
tunned_geobr-0.
|
4
|
-
tunned_geobr-0.
|
5
|
-
tunned_geobr/__init__.py,sha256=
|
1
|
+
tunned_geobr-1.0.0.dist-info/METADATA,sha256=4vI9Jp2a5SZS9G4UG-9bOrPPwbxrUx-OLvueEql-c9s,5018
|
2
|
+
tunned_geobr-1.0.0.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
tunned_geobr-1.0.0.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
|
+
tunned_geobr-1.0.0.dist-info/licenses/LICENSE.txt,sha256=mECZRcbde3HssOKe1Co4zgqBLGVN0OWpTsEy3LIbcRA,75
|
5
|
+
tunned_geobr/__init__.py,sha256=RP_fInq17ZOJxZOIVtkWeYDBUIr2lR4QbbHbvMqr5K4,7454
|
6
6
|
tunned_geobr/data/grid_state_correspondence_table.csv,sha256=FpkBuX_-lRXQ1yBrQODxQgG9oha9Fd8A8zGKfdsDAmk,2660
|
7
|
-
tunned_geobr/list_geobr.py,sha256=
|
7
|
+
tunned_geobr/list_geobr.py,sha256=6rsdtSZUvFrS-n5KXLOSQ34P1AK_yMFAj_MVZRvvZmQ,17278
|
8
8
|
tunned_geobr/lookup_muni.py,sha256=ny1zU4i6OagvL4Mrc6XQWPgn2RrJa_mXlKXh81oVYsM,3462
|
9
9
|
tunned_geobr/read_ama_anemometric_towers.py,sha256=M3qKBTBYdqHzTuWtRrBiLA88Ymt6g0cf7sakJd5mTRo,4686
|
10
|
-
tunned_geobr/read_amazon.py,sha256=
|
10
|
+
tunned_geobr/read_amazon.py,sha256=HiwKnYebWe3nDMDRUqHpKJIO76bA4ERm4iJlCPhagQg,1286
|
11
11
|
tunned_geobr/read_amazon_ibas.py,sha256=RtOo5wPfc26S2HYJCLylNCPM5cHBOLGTP4uKEtGC3Bw,3500
|
12
12
|
tunned_geobr/read_apcb_amazon.py,sha256=IQZc_hyDcwYtRkQmdJMuQuZVcCGeuF9S5p3xeOghUgo,2834
|
13
13
|
tunned_geobr/read_apcb_caatinga.py,sha256=n1oQttcKkUyuU835VfbR709yGEydm8lnorp_uBlV-Ws,2846
|
@@ -56,12 +56,15 @@ tunned_geobr/read_geographic_regions.py,sha256=11ZDKhfYrUUbmcROMipdJHglHLgXm6sZX
|
|
56
56
|
tunned_geobr/read_geology.py,sha256=dzMUN1RYD4VcGOkle8iJtNZGiPQJ8x9kEdDirKgS-9Y,2766
|
57
57
|
tunned_geobr/read_geomorphology.py,sha256=7TFy9CYLUL0lFBTKT_lZeUL7r5c9mWp64VpXUwKTLHY,2843
|
58
58
|
tunned_geobr/read_glp_bases.py,sha256=4-cgL0NU9bkKMTddMfaTedjzV5OnzEVr4iWglACU7x4,5190
|
59
|
-
tunned_geobr/read_gnl_terminals.py,sha256=
|
59
|
+
tunned_geobr/read_gnl_terminals.py,sha256=7pPyTPv8RRN-gvujbwwm-gw5j8N69MMbrIB91Lps2sA,5259
|
60
60
|
tunned_geobr/read_health_facilities.py,sha256=NEU2BGEBmIPbT0Z02EOKLtfC9-_AmNrIHaD-83kmh5Q,2012
|
61
61
|
tunned_geobr/read_health_region.py,sha256=zGkoQZ_mf-snBEy00RUd3GF_pJu6PIoqvcbS_i_tQgU,1843
|
62
62
|
tunned_geobr/read_heliports.py,sha256=liLQ5J7UgHcxcsx7xpkh_4oxxh4rNz7hprTwnWSViw4,2791
|
63
63
|
tunned_geobr/read_hydroelectric_feasibility_studies.py,sha256=tyCD-VyYW1paJLoN8woO_sR4aFC8NIIRj_As0jrQSLE,4770
|
64
64
|
tunned_geobr/read_hydroelectric_inventory_aai_studies.py,sha256=GWnSzsnMJSDjSpXFHyQbYL3d8xTwqh9ilxxi2r61idE,4814
|
65
|
+
tunned_geobr/read_ibama_embargoes.py,sha256=hzbWiifgoCgq7TP4X3H4TWFFkLnE5Y9969KUd3aJsek,3251
|
66
|
+
tunned_geobr/read_icmbio_embargoes.py,sha256=Xn3oxt4yK8wE6sAKWsU91EyU2h0yLysIbtQk2VUuJ5A,3107
|
67
|
+
tunned_geobr/read_icmbio_infractions.py,sha256=Heolqhuxc3sUby4RhxJZ88djIBWRcXkFbubhXgkpYos,3182
|
65
68
|
tunned_geobr/read_immediate_region.py,sha256=K-i5UBdxB1ZQw2R8fGMp1GqX5sXJwUkjVHqC84QtJtc,2555
|
66
69
|
tunned_geobr/read_indigenous_land.py,sha256=ZyHcJ93cDNjUcc5CyBKiWHjlrt9owDv993IFKUlEPZ4,1460
|
67
70
|
tunned_geobr/read_intermediate_region.py,sha256=PipeQFGVpZf6a_J7OrttPOnE7o6E5IJHJXLKvzYjoEY,2186
|
@@ -74,8 +77,8 @@ tunned_geobr/read_municipal_seat.py,sha256=9Vi-q1jzY8n086O-nNY1sVkVzV_NZbdzE5juo
|
|
74
77
|
tunned_geobr/read_municipality.py,sha256=dZM1BVi3U9ZvasLADV-ciKVr9R4o92dRowpEVdVkvYw,5651
|
75
78
|
tunned_geobr/read_municipality_direct.py,sha256=VrZR_5__DsV5IbbX-sr56WT-P4M_tVdnmJp-QgdkmFg,5658
|
76
79
|
tunned_geobr/read_natural_caves.py,sha256=-XjoRxhT_yYy0fZu87S6RRUZ-cyaWPqWqOrd9Y8ERKo,3073
|
77
|
-
tunned_geobr/read_natural_gas_delivery_points.py,sha256=
|
78
|
-
tunned_geobr/read_natural_gas_processing_hub.py,sha256=
|
80
|
+
tunned_geobr/read_natural_gas_delivery_points.py,sha256=nJJmqbJJ5Xx2P2wVL9yXdGLuPI0O8pCCL9zDkHQtZOs,5387
|
81
|
+
tunned_geobr/read_natural_gas_processing_hub.py,sha256=qI5o-4TmPfi3h0gYNWjeMR5GsRAq-fsXoB62llqt9RA,5367
|
79
82
|
tunned_geobr/read_neighborhood.py,sha256=2QWMz-TVkTJmbVQ_aKNyh2NNJ6KIJqnrPL1CrB9Oqdw,1085
|
80
83
|
tunned_geobr/read_neighborhoods_2022.py,sha256=EX1-5CM3tNe05HE1F5r3YtZ-66X_NC67u_DzrmzKvTc,3952
|
81
84
|
tunned_geobr/read_og_basement.py,sha256=nwUOn-BMYC3mvvP9uTBLYly00drIw6CwU5lHJeOdi-Y,4617
|
@@ -95,7 +98,7 @@ tunned_geobr/read_oil_and_derivatives_terminal.py,sha256=-BzLd9WpWWgH1pUaz9y16rg
|
|
95
98
|
tunned_geobr/read_pan_strategic_areas 2.py,sha256=alORMUQbnW_ER3_uOzqTbUaSyr-Y3Mg_bsoykxiGDMA,2654
|
96
99
|
tunned_geobr/read_pan_strategic_areas.py,sha256=EP-Qtx_q4lE3lsNNIUaoQc5j-9aKBkxY2BizTwWY3ZY,3375
|
97
100
|
tunned_geobr/read_pedology.py,sha256=xk_yOxIOVTHip4kj2y1xgO4fHKn8e1dv2cNOayXCtKk,2783
|
98
|
-
tunned_geobr/read_pio_ducts.py,sha256=
|
101
|
+
tunned_geobr/read_pio_ducts.py,sha256=L_lDeDU4VrSnUISoQ7afe5biseja0R6xQFMkZMTQJIc,5214
|
99
102
|
tunned_geobr/read_pio_terminals.py,sha256=uslr1Zy2bNaxAHbsieMkyWND8zLvJpWOkdey3-4i1Xc,5246
|
100
103
|
tunned_geobr/read_planned_biomass_ute.py,sha256=AEPmAuhBZyicYA_nATsMhhHEmJ6xnUNQZtRXkE67cLk,7557
|
101
104
|
tunned_geobr/read_planned_cgh.py,sha256=Tms3Ed9tYnXKqua7fHAd8PTxhm7MUv88Mq_ZU9ny5go,7458
|
@@ -135,4 +138,4 @@ tunned_geobr/read_water_bodies_ana.py,sha256=Z-dpTPVgRHVndTeSFxx8uXn7ufMg2jm0Dlz
|
|
135
138
|
tunned_geobr/read_waterways.py,sha256=mEdoVogYWr5EYZ8bE3xMCVWyLrHYU7xTL2lUE0XbDAM,2951
|
136
139
|
tunned_geobr/read_weighting_area.py,sha256=m2X5Ua3jRqLlkqCQbIzR2jmo58pzqkyR3UYcGtgy20E,2325
|
137
140
|
tunned_geobr/utils.py,sha256=WT9PSGWvcERjj3yhfTvyWSE5ZiEjO4tYK5xIj5jJCg8,8170
|
138
|
-
tunned_geobr-0.
|
141
|
+
tunned_geobr-1.0.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|