tunned-geobr 0.2.3__tar.gz → 0.2.5__tar.gz

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.
Files changed (173) hide show
  1. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/PKG-INFO +1 -1
  2. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/pyproject.toml +1 -1
  3. tunned_geobr-0.2.5/tunned_geobr/__init__.py +128 -0
  4. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/list_geobr.py +72 -1
  5. tunned_geobr-0.2.5/tunned_geobr/read_ama_anemometric_towers.py +119 -0
  6. tunned_geobr-0.2.5/tunned_geobr/read_areas_under_contract.py +129 -0
  7. tunned_geobr-0.2.5/tunned_geobr/read_biodiesel_plants.py +128 -0
  8. tunned_geobr-0.2.5/tunned_geobr/read_biomethane_plants.py +128 -0
  9. tunned_geobr-0.2.5/tunned_geobr/read_compression_stations.py +128 -0
  10. tunned_geobr-0.2.5/tunned_geobr/read_drainage_ducts.py +128 -0
  11. tunned_geobr-0.2.5/tunned_geobr/read_etanol_plants.py +128 -0
  12. tunned_geobr-0.2.5/tunned_geobr/read_existent_biomass_ute.py +128 -0
  13. tunned_geobr-0.2.5/tunned_geobr/read_existent_cgh.py +168 -0
  14. tunned_geobr-0.2.5/tunned_geobr/read_existent_eolic.py +165 -0
  15. tunned_geobr-0.2.5/tunned_geobr/read_existent_fossile_ute.py +128 -0
  16. tunned_geobr-0.2.5/tunned_geobr/read_existent_nuclear_ute.py +128 -0
  17. tunned_geobr-0.2.5/tunned_geobr/read_existent_pch.py +168 -0
  18. tunned_geobr-0.2.5/tunned_geobr/read_existent_solar.py +165 -0
  19. tunned_geobr-0.2.5/tunned_geobr/read_existent_substations.py +128 -0
  20. tunned_geobr-0.2.5/tunned_geobr/read_existent_transmission_lines.py +128 -0
  21. tunned_geobr-0.2.5/tunned_geobr/read_existent_uhe.py +168 -0
  22. tunned_geobr-0.2.5/tunned_geobr/read_exploration_production_environment.py +119 -0
  23. tunned_geobr-0.2.5/tunned_geobr/read_federal_union_areas.py +129 -0
  24. tunned_geobr-0.2.5/tunned_geobr/read_fuel_bases.py +128 -0
  25. tunned_geobr-0.2.5/tunned_geobr/read_gas_distribution_pipelines.py +128 -0
  26. tunned_geobr-0.2.5/tunned_geobr/read_gas_transport_pipelines.py +128 -0
  27. tunned_geobr-0.2.5/tunned_geobr/read_glp_bases.py +128 -0
  28. tunned_geobr-0.2.5/tunned_geobr/read_gnl_terminals.py +128 -0
  29. tunned_geobr-0.2.5/tunned_geobr/read_hydroelectric_feasibility_studies.py +119 -0
  30. tunned_geobr-0.2.5/tunned_geobr/read_hydroelectric_inventory_aai_studies.py +119 -0
  31. tunned_geobr-0.2.5/tunned_geobr/read_isolated_systems.py +128 -0
  32. tunned_geobr-0.2.5/tunned_geobr/read_natural_gas_delivery_points.py +128 -0
  33. tunned_geobr-0.2.5/tunned_geobr/read_natural_gas_processing_hub.py +128 -0
  34. tunned_geobr-0.2.5/tunned_geobr/read_og_basement.py +119 -0
  35. tunned_geobr-0.2.5/tunned_geobr/read_og_effective_geographic_basin.py +129 -0
  36. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_direct_evidence.py +119 -0
  37. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_exploratory_activity.py +119 -0
  38. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_exploratory_intensity.py +129 -0
  39. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_need_for_knowledge.py +119 -0
  40. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_prospectiveness.py +119 -0
  41. tunned_geobr-0.2.5/tunned_geobr/read_og_ipa_supply_infrastructure.py +119 -0
  42. tunned_geobr-0.2.5/tunned_geobr/read_og_legal_pre_salt_polygon.py +119 -0
  43. tunned_geobr-0.2.5/tunned_geobr/read_og_predominant_fluid_type.py +129 -0
  44. tunned_geobr-0.2.5/tunned_geobr/read_og_probabilistic_effective_basin.py +129 -0
  45. tunned_geobr-0.2.5/tunned_geobr/read_og_total_ipa.py +129 -0
  46. tunned_geobr-0.2.5/tunned_geobr/read_og_unconventional_resources.py +129 -0
  47. tunned_geobr-0.2.5/tunned_geobr/read_oil_and_derivatives_terminal.py +128 -0
  48. tunned_geobr-0.2.5/tunned_geobr/read_pan_strategic_areas 2.py +71 -0
  49. tunned_geobr-0.2.5/tunned_geobr/read_pio_ducts.py +128 -0
  50. tunned_geobr-0.2.5/tunned_geobr/read_pio_terminals.py +128 -0
  51. tunned_geobr-0.2.5/tunned_geobr/read_planned_biomass_ute.py +166 -0
  52. tunned_geobr-0.2.5/tunned_geobr/read_planned_cgh.py +166 -0
  53. tunned_geobr-0.2.5/tunned_geobr/read_planned_eolic.py +165 -0
  54. tunned_geobr-0.2.5/tunned_geobr/read_planned_fossile_ute.py +166 -0
  55. tunned_geobr-0.2.5/tunned_geobr/read_planned_nuclear_ute.py +165 -0
  56. tunned_geobr-0.2.5/tunned_geobr/read_planned_pch.py +166 -0
  57. tunned_geobr-0.2.5/tunned_geobr/read_planned_solar.py +165 -0
  58. tunned_geobr-0.2.5/tunned_geobr/read_planned_substations.py +164 -0
  59. tunned_geobr-0.2.5/tunned_geobr/read_planned_transmission_lines.py +165 -0
  60. tunned_geobr-0.2.5/tunned_geobr/read_planned_uhe.py +166 -0
  61. tunned_geobr-0.2.5/tunned_geobr/read_processing_facilities.py +128 -0
  62. tunned_geobr-0.2.5/tunned_geobr/read_sedimentary_basins.py +119 -0
  63. tunned_geobr-0.2.5/tunned_geobr/read_subsystem_interconnected.py +163 -0
  64. tunned_geobr-0.2.3/tunned_geobr/__init__.py +0 -70
  65. tunned_geobr-0.2.3/tunned_geobr/constants.py +0 -13
  66. tunned_geobr-0.2.3/tunned_geobr/read_quilombola_areas.py +0 -85
  67. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/LICENSE.txt +0 -0
  68. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/README.md +0 -0
  69. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/__init__.py +0 -0
  70. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/read_state.py +0 -0
  71. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_list_geobr.py +0 -0
  72. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_lookup_muni.py +0 -0
  73. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_amazon.py +0 -0
  74. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_biomes.py +0 -0
  75. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_census_tract.py +0 -0
  76. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_comparable_areas.py +0 -0
  77. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_conservation_units.py +0 -0
  78. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_country.py +0 -0
  79. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_disaster_risk_area.py +0 -0
  80. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_health_facilities.py +0 -0
  81. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_health_region.py +0 -0
  82. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_immediate_region.py +0 -0
  83. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_indigenous_land.py +0 -0
  84. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_intermediate_region.py +0 -0
  85. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_meso_region.py +0 -0
  86. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_metro_area.py +0 -0
  87. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_micro_region.py +0 -0
  88. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_municipal_seat.py +0 -0
  89. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_municipality.py +0 -0
  90. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_neighborhood.py +0 -0
  91. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_pop_arrangements.py +0 -0
  92. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_region.py +0 -0
  93. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_schools.py +0 -0
  94. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_semiarid.py +0 -0
  95. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_state.py +0 -0
  96. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_statistical_grid.py +0 -0
  97. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_urban_area.py +0 -0
  98. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_urban_concentrations.py +0 -0
  99. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_read_weighting_area.py +0 -0
  100. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tests/test_utils.py +0 -0
  101. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/data/grid_state_correspondence_table.csv +0 -0
  102. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/lookup_muni.py +0 -0
  103. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_amazon.py +0 -0
  104. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_amazon_ibas.py +0 -0
  105. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_amazon.py +0 -0
  106. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_caatinga.py +0 -0
  107. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_cerrado_pantanal.py +0 -0
  108. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_mata_atlantica.py +0 -0
  109. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_pampa.py +0 -0
  110. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_apcb_zcm.py +0 -0
  111. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_archaeological_sites.py +0 -0
  112. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_atlantic_forest_ibas.py +0 -0
  113. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_atlantic_forest_law_limits.py +0 -0
  114. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_baze_sites.py +0 -0
  115. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_biomes.py +0 -0
  116. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_biosphere_reserves.py +0 -0
  117. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_cave_potential.py +0 -0
  118. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_census_tract.py +0 -0
  119. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_census_tract_2022.py +0 -0
  120. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_climate_aggressiveness.py +0 -0
  121. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_comparable_areas.py +0 -0
  122. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_conservation_units.py +0 -0
  123. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_country.py +0 -0
  124. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_disaster_risk_area.py +0 -0
  125. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_ebas.py +0 -0
  126. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_federal_highways.py +0 -0
  127. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_fossil_occurrences.py +0 -0
  128. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_geographic_regions.py +0 -0
  129. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_geology.py +0 -0
  130. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_geomorphology.py +0 -0
  131. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_health_facilities.py +0 -0
  132. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_health_region.py +0 -0
  133. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_heliports.py +0 -0
  134. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_immediate_region.py +0 -0
  135. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_indigenous_land.py +0 -0
  136. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_intermediate_region.py +0 -0
  137. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_meso_region.py +0 -0
  138. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_metro_area.py +0 -0
  139. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_micro_region.py +0 -0
  140. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_mining_processes.py +0 -0
  141. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_municipal_seat.py +0 -0
  142. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_municipality.py +0 -0
  143. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_municipality_direct.py +0 -0
  144. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_natural_caves.py +0 -0
  145. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_neighborhood.py +0 -0
  146. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_neighborhoods_2022.py +0 -0
  147. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_pan_strategic_areas.py +0 -0
  148. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_pedology.py +0 -0
  149. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_pop_arrangements.py +0 -0
  150. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_ports.py +0 -0
  151. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_private_aerodromes.py +0 -0
  152. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_public_aerodromes.py +0 -0
  153. /tunned_geobr-0.2.3/tunned_geobr/read_quilombola_areas_temp.py → /tunned_geobr-0.2.5/tunned_geobr/read_quilombola_areas.py +0 -0
  154. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_railways.py +0 -0
  155. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_region.py +0 -0
  156. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_rppn.py +0 -0
  157. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_schools.py +0 -0
  158. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_semiarid.py +0 -0
  159. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_settlements.py +0 -0
  160. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_sigef_properties.py +0 -0
  161. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_snci_properties.py +0 -0
  162. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_state.py +0 -0
  163. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_state_direct.py +0 -0
  164. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_state_highways.py +0 -0
  165. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_statistical_grid.py +0 -0
  166. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_transmission_lines_ons.py +0 -0
  167. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_urban_area.py +0 -0
  168. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_urban_concentrations.py +0 -0
  169. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_vegetation.py +0 -0
  170. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_water_bodies_ana.py +0 -0
  171. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_waterways.py +0 -0
  172. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/read_weighting_area.py +0 -0
  173. {tunned_geobr-0.2.3 → tunned_geobr-0.2.5}/tunned_geobr/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tunned-geobr
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: Fork personalizado do geobr com funcionalidades extras como download de dados da ANM
5
5
  Author: Anderson Stolfi
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tunned-geobr"
3
- version = "0.2.3"
3
+ version = "0.2.5"
4
4
  description = "Fork personalizado do geobr com funcionalidades extras como download de dados da ANM"
5
5
  readme = "README.md"
6
6
  requires-python = "<4.0,>=3.9"
@@ -0,0 +1,128 @@
1
+ from .read_state_direct import read_state
2
+ from .read_amazon import read_amazon
3
+ from .read_biomes import read_biomes
4
+ from .read_country import read_country
5
+ from .read_municipal_seat import read_municipal_seat
6
+ from .read_region import read_region
7
+ from .read_semiarid import read_semiarid
8
+ from .read_disaster_risk_area import read_disaster_risk_area
9
+ from .read_metro_area import read_metro_area
10
+ from .read_conservation_units import read_conservation_units
11
+ from .read_urban_area import read_urban_area
12
+ from .read_health_facilities import read_health_facilities
13
+ from .read_indigenous_land import read_indigenous_land
14
+ from .read_immediate_region import read_immediate_region
15
+ from .list_geobr import list_geobr
16
+ from .read_census_tract import read_census_tract
17
+ from .read_meso_region import read_meso_region
18
+ from .read_micro_region import read_micro_region
19
+ from .read_municipality_direct import read_municipality
20
+ from .read_weighting_area import read_weighting_area
21
+ from .read_neighborhood import read_neighborhood
22
+ from .read_health_region import read_health_region
23
+ from .read_pop_arrangements import read_pop_arrangements
24
+ from .lookup_muni import lookup_muni
25
+ from .read_intermediate_region import read_intermediate_region
26
+ from .read_urban_concentrations import read_urban_concentrations
27
+ from .read_schools import read_schools
28
+ from .read_comparable_areas import read_comparable_areas
29
+ from .read_biomes import read_biomes
30
+ from .read_statistical_grid import read_statistical_grid
31
+ from .read_mining_processes import read_mining_processes
32
+ from .read_geology import read_geology
33
+ from .read_geomorphology import read_geomorphology
34
+ from .read_pedology import read_pedology
35
+ from .read_climate_aggressiveness import read_climate_aggressiveness
36
+ from .read_amazon_ibas import read_amazon_ibas
37
+ from .read_atlantic_forest_ibas import read_atlantic_forest_ibas
38
+ from .read_settlements import read_settlements
39
+ from .read_apcb_amazon import read_apcb_amazon
40
+ from .read_apcb_caatinga import read_apcb_caatinga
41
+ from .read_apcb_cerrado_pantanal import read_apcb_cerrado_pantanal
42
+ from .read_apcb_mata_atlantica import read_apcb_mata_atlantica
43
+ from .read_apcb_pampa import read_apcb_pampa
44
+ from .read_apcb_zcm import read_apcb_zcm
45
+ from .read_natural_caves import read_natural_caves
46
+ from .read_ports import read_ports
47
+ from .read_public_aerodromes import read_public_aerodromes
48
+ from .read_private_aerodromes import read_private_aerodromes
49
+ from .read_state_highways import read_state_highways
50
+ from .read_federal_highways import read_federal_highways
51
+ from .read_railways import read_railways
52
+ from .read_waterways import read_waterways
53
+ from .read_heliports import read_heliports
54
+ from .read_snci_properties import read_snci_properties
55
+ from .read_sigef_properties import read_sigef_properties
56
+ from .read_atlantic_forest_law_limits import read_atlantic_forest_law_limits
57
+ from .read_fossil_occurrences import read_fossil_occurrences
58
+ from .read_cave_potential import read_cave_potential
59
+ from .read_rppn import read_rppn
60
+ from .read_archaeological_sites import read_archaeological_sites
61
+ from .read_ebas import read_ebas
62
+ from .read_vegetation import read_vegetation
63
+ from .read_transmission_lines_ons import read_transmission_lines_ons
64
+ from .read_water_bodies_ana import read_water_bodies_ana
65
+ from .read_pan_strategic_areas import read_pan_strategic_areas
66
+ from .read_geographic_regions import read_geographic_regions
67
+ from .read_biosphere_reserves import read_biosphere_reserves
68
+ from .read_census_tract_2022 import read_census_tract_2022
69
+ from .read_neighborhoods_2022 import read_neighborhoods_2022
70
+ from .read_baze_sites import read_baze_sites
71
+ from .read_existent_eolic import read_existent_eolic
72
+ from .read_planned_eolic import read_planned_eolic
73
+ from .read_existent_solar import read_existent_solar
74
+ from .read_planned_solar import read_planned_solar
75
+ from .read_existent_uhe import read_existent_uhe
76
+ from .read_existent_pch import read_existent_pch
77
+ from .read_existent_cgh import read_existent_cgh
78
+ from .read_planned_uhe import read_planned_uhe
79
+ from .read_planned_pch import read_planned_pch
80
+ from .read_planned_cgh import read_planned_cgh
81
+ from .read_existent_biomass_ute import read_existent_biomass_ute
82
+ from .read_existent_fossile_ute import read_existent_fossile_ute
83
+ from .read_existent_nuclear_ute import read_existent_nuclear_ute
84
+ from .read_planned_biomass_ute import read_planned_biomass_ute
85
+ from .read_planned_fossile_ute import read_planned_fossile_ute
86
+ from .read_planned_nuclear_ute import read_planned_nuclear_ute
87
+ from .read_existent_substations import read_existent_substations
88
+ from .read_existent_transmission_lines import read_existent_transmission_lines
89
+ from .read_planned_substations import read_planned_substations
90
+ from .read_planned_transmission_lines import read_planned_transmission_lines
91
+ from .read_subsystem_interconnected import read_subsystem_interconnected
92
+ from .read_isolated_systems import read_isolated_systems
93
+ from .read_etanol_plants import read_etanol_plants
94
+ from .read_biodiesel_plants import read_biodiesel_plants
95
+ from .read_gas_transport_pipelines import read_gas_transport_pipelines
96
+ from .read_gas_distribution_pipelines import read_gas_distribution_pipelines
97
+ from .read_areas_under_contract import read_areas_under_contract
98
+ from .read_federal_union_areas import read_federal_union_areas
99
+ from .read_og_effective_geographic_basin import read_og_effective_geographic_basin
100
+ from .read_og_probabilistic_effective_basin import read_og_probabilistic_effective_basin
101
+ from .read_og_predominant_fluid_type import read_og_predominant_fluid_type
102
+ from .read_og_unconventional_resources import read_og_unconventional_resources
103
+ from .read_og_total_ipa import read_og_total_ipa
104
+ from .read_og_ipa_exploratory_intensity import read_og_ipa_exploratory_intensity
105
+ from .read_og_ipa_exploratory_activity import read_og_ipa_exploratory_activity
106
+ from .read_og_ipa_prospectiveness import read_og_ipa_prospectiveness
107
+ from .read_og_ipa_direct_evidence import read_og_ipa_direct_evidence
108
+ from .read_og_ipa_need_for_knowledge import read_og_ipa_need_for_knowledge
109
+ from .read_og_ipa_supply_infrastructure import read_og_ipa_supply_infrastructure
110
+ from .read_og_legal_pre_salt_polygon import read_og_legal_pre_salt_polygon
111
+ from .read_exploration_production_environment import read_exploration_production_environment
112
+ from .read_sedimentary_basins import read_sedimentary_basins
113
+ from .read_og_basement import read_og_basement
114
+ from .read_hydroelectric_feasibility_studies import read_hydroelectric_feasibility_studies
115
+ from .read_hydroelectric_inventory_aai_studies import read_hydroelectric_inventory_aai_studies
116
+ from .read_ama_anemometric_towers import read_ama_anemometric_towers
117
+ from .read_biomethane_plants import read_biomethane_plants
118
+ from .read_fuel_bases import read_fuel_bases
119
+ from .read_glp_bases import read_glp_bases
120
+ from .read_processing_facilities import read_processing_facilities
121
+ from .read_oil_and_derivatives_terminal import read_oil_and_derivatives_terminal
122
+ from .read_pio_terminals import read_pio_terminals
123
+ from .read_pio_ducts import read_pio_ducts
124
+ from .read_gnl_terminals import read_gnl_terminals
125
+ from .read_natural_gas_processing_hub import read_natural_gas_processing_hub
126
+ from .read_compression_stations import read_compression_stations
127
+ from .read_natural_gas_delivery_points import read_natural_gas_delivery_points
128
+ from .read_quilombola_areas import read_quilombola_areas
@@ -101,7 +101,78 @@ def list_geobr():
101
101
  # Land tenure and property datasets
102
102
  {"Function": "read_snci_properties", "Geography": "SNCI Properties", "Years": "All", "Source": "INCRA"},
103
103
  {"Function": "read_sigef_properties", "Geography": "SIGEF Properties", "Years": "All", "Source": "INCRA"},
104
- {"Function": "read_quilombola_areas", "Geography": "Quilombola Areas", "Years": "All", "Source": "INCRA"}
104
+ {"Function": "read_quilombola_areas", "Geography": "Quilombola Areas", "Years": "All", "Source": "INCRA"},
105
+
106
+ # Energy infrastructure datasets - Solar
107
+ {"Function": "read_existent_solar", "Geography": "Existing Solar Power Plants", "Years": "All", "Source": "EPE"},
108
+ {"Function": "read_planned_solar", "Geography": "Planned Solar Power Plants", "Years": "All", "Source": "EPE"},
109
+
110
+ # Energy infrastructure datasets - Wind
111
+ {"Function": "read_existent_eolic", "Geography": "Existing Wind Power Plants", "Years": "All", "Source": "EPE"},
112
+ {"Function": "read_planned_eolic", "Geography": "Planned Wind Power Plants", "Years": "All", "Source": "EPE"},
113
+
114
+ # Energy infrastructure datasets - Hydroelectric
115
+ {"Function": "read_existent_uhe", "Geography": "Existing Large Hydroelectric Plants", "Years": "All", "Source": "EPE"},
116
+ {"Function": "read_existent_pch", "Geography": "Existing Small Hydroelectric Plants", "Years": "All", "Source": "EPE"},
117
+ {"Function": "read_existent_cgh", "Geography": "Existing Mini Hydroelectric Plants", "Years": "All", "Source": "EPE"},
118
+ {"Function": "read_planned_uhe", "Geography": "Planned Large Hydroelectric Plants", "Years": "All", "Source": "EPE"},
119
+ {"Function": "read_planned_pch", "Geography": "Planned Small Hydroelectric Plants", "Years": "All", "Source": "EPE"},
120
+ {"Function": "read_planned_cgh", "Geography": "Planned Mini Hydroelectric Plants", "Years": "All", "Source": "EPE"},
121
+
122
+ # Energy infrastructure datasets - Thermoelectric
123
+ {"Function": "read_existent_biomass_ute", "Geography": "Existing Biomass Thermoelectric Plants", "Years": "All", "Source": "EPE"},
124
+ {"Function": "read_existent_fossile_ute", "Geography": "Existing Fossil Thermoelectric Plants", "Years": "All", "Source": "EPE"},
125
+ {"Function": "read_existent_nuclear_ute", "Geography": "Existing Nuclear Thermoelectric Plants", "Years": "All", "Source": "EPE"},
126
+ {"Function": "read_planned_biomass_ute", "Geography": "Planned Biomass Thermoelectric Plants", "Years": "All", "Source": "EPE"},
127
+ {"Function": "read_planned_fossile_ute", "Geography": "Planned Fossil Thermoelectric Plants", "Years": "All", "Source": "EPE"},
128
+ {"Function": "read_planned_nuclear_ute", "Geography": "Planned Nuclear Thermoelectric Plants", "Years": "All", "Source": "EPE"},
129
+
130
+ # Energy infrastructure datasets - Transmission
131
+ {"Function": "read_existent_substations", "Geography": "Existing Electrical Substations", "Years": "All", "Source": "EPE"},
132
+ {"Function": "read_existent_transmission_lines", "Geography": "Existing Transmission Lines", "Years": "All", "Source": "EPE"},
133
+ {"Function": "read_planned_substations", "Geography": "Planned Electrical Substations", "Years": "All", "Source": "EPE"},
134
+ {"Function": "read_planned_transmission_lines", "Geography": "Planned Transmission Lines", "Years": "All", "Source": "EPE"},
135
+ {"Function": "read_subsystem_interconnected", "Geography": "National Interconnected System Subsystems", "Years": "All", "Source": "EPE"},
136
+ {"Function": "read_isolated_systems", "Geography": "Isolated Electrical Systems", "Years": "All", "Source": "EPE"},
137
+
138
+ # Energy infrastructure datasets - Biofuel Plants
139
+ {"Function": "read_etanol_plants", "Geography": "Ethanol Production Plants", "Years": "All", "Source": "EPE"},
140
+ {"Function": "read_biodiesel_plants", "Geography": "Biodiesel Production Plants", "Years": "All", "Source": "EPE"},
141
+ {"Function": "read_biomethane_plants", "Geography": "Biomethane Production Plants", "Years": "All", "Source": "EPE"},
142
+
143
+ # Energy infrastructure datasets - Oil and Gas Infrastructure
144
+ {"Function": "read_fuel_bases", "Geography": "Fuel Bases", "Years": "All", "Source": "EPE"},
145
+ {"Function": "read_glp_bases", "Geography": "GLP (LPG) Bases", "Years": "All", "Source": "EPE"},
146
+ {"Function": "read_processing_facilities", "Geography": "Oil and Gas Processing Facilities", "Years": "All", "Source": "EPE"},
147
+ {"Function": "read_oil_and_derivatives_terminal", "Geography": "Oil and Derivatives Terminals", "Years": "All", "Source": "EPE"},
148
+ {"Function": "read_pio_terminals", "Geography": "PIO Terminals", "Years": "All", "Source": "EPE"},
149
+ {"Function": "read_pio_ducts", "Geography": "PIO Ducts", "Years": "All", "Source": "EPE"},
150
+ {"Function": "read_gnl_terminals", "Geography": "GNL (LNG) Terminals", "Years": "All", "Source": "EPE"},
151
+ {"Function": "read_natural_gas_processing_hub", "Geography": "Natural Gas Processing Hubs", "Years": "All", "Source": "EPE"},
152
+ {"Function": "read_compression_stations", "Geography": "Natural Gas Compression Stations", "Years": "All", "Source": "EPE"},
153
+ {"Function": "read_natural_gas_delivery_points", "Geography": "Natural Gas Delivery Points", "Years": "All", "Source": "EPE"},
154
+ {"Function": "read_gas_transport_pipelines", "Geography": "Gas Transport Pipelines", "Years": "All", "Source": "EPE"},
155
+ {"Function": "read_gas_distribution_pipelines", "Geography": "Gas Distribution Pipelines", "Years": "All", "Source": "EPE"},
156
+ {"Function": "read_areas_under_contract", "Geography": "Oil and Gas Areas Under Contract", "Years": "All", "Source": "EPE"},
157
+ {"Function": "read_federal_union_areas", "Geography": "Federal Union Areas for Oil and Gas", "Years": "All", "Source": "EPE"},
158
+ {"Function": "read_og_effective_geographic_basin", "Geography": "Oil and Gas Effective Geographic Basins", "Years": "All", "Source": "EPE"},
159
+ {"Function": "read_og_probabilistic_effective_basin", "Geography": "Oil and Gas Probabilistic Effective Basins", "Years": "All", "Source": "EPE"},
160
+ {"Function": "read_og_predominant_fluid_type", "Geography": "Oil and Gas Predominant Fluid Type Areas", "Years": "All", "Source": "EPE"},
161
+ {"Function": "read_og_unconventional_resources", "Geography": "Oil and Gas Unconventional Resources", "Years": "All", "Source": "EPE"},
162
+ {"Function": "read_og_total_ipa", "Geography": "Oil and Gas Total IPA", "Years": "All", "Source": "EPE"},
163
+ {"Function": "read_og_ipa_exploratory_intensity", "Geography": "Oil and Gas IPA Exploratory Intensity", "Years": "All", "Source": "EPE"},
164
+ {"Function": "read_og_ipa_exploratory_activity", "Geography": "Oil and Gas IPA Exploratory Activity", "Years": "All", "Source": "EPE"},
165
+ {"Function": "read_og_ipa_prospectiveness", "Geography": "Oil and Gas IPA Prospectiveness", "Years": "All", "Source": "EPE"},
166
+ {"Function": "read_og_ipa_direct_evidence", "Geography": "Oil and Gas IPA Direct Evidence of Hydrocarbons", "Years": "All", "Source": "EPE"},
167
+ {"Function": "read_og_ipa_need_for_knowledge", "Geography": "Oil and Gas IPA Need for Knowledge", "Years": "All", "Source": "EPE"},
168
+ {"Function": "read_og_ipa_supply_infrastructure", "Geography": "Oil and Gas IPA Supply Infrastructure", "Years": "All", "Source": "EPE"},
169
+ {"Function": "read_og_legal_pre_salt_polygon", "Geography": "Oil and Gas Legal Pre-Salt Polygon", "Years": "All", "Source": "EPE"},
170
+ {"Function": "read_exploration_production_environment", "Geography": "Exploration and Production Environment", "Years": "All", "Source": "EPE"},
171
+ {"Function": "read_sedimentary_basins", "Geography": "Sedimentary Basins", "Years": "All", "Source": "EPE"},
172
+ {"Function": "read_og_basement", "Geography": "Oil and Gas Basement", "Years": "All", "Source": "EPE"},
173
+ {"Function": "read_hydroelectric_feasibility_studies", "Geography": "Hydroelectric Feasibility Studies", "Years": "All", "Source": "EPE"},
174
+ {"Function": "read_hydroelectric_inventory_aai_studies", "Geography": "Hydroelectric Inventory and AAI Studies", "Years": "All", "Source": "EPE"},
175
+ {"Function": "read_ama_anemometric_towers", "Geography": "AMA Anemometric Towers", "Years": "All", "Source": "EPE"}
105
176
  ]
106
177
 
107
178
  # Create DataFrame
@@ -0,0 +1,119 @@
1
+ import geopandas as gpd
2
+ import requests
3
+ import zipfile
4
+ import tempfile
5
+ import os
6
+ import warnings
7
+ import shutil
8
+
9
+
10
+ def read_ama_anemometric_towers(simplified=True, verbose=False):
11
+ """Download data for AMA Anemometric Towers in Brazil.
12
+
13
+ This function downloads, processes, and returns data for AMA Anemometric Towers
14
+ in Brazil as a geopandas GeoDataFrame.
15
+
16
+ Parameters
17
+ ----------
18
+ simplified : bool, optional
19
+ If True, returns a simplified version of the dataset with only essential columns.
20
+ If False, returns the complete dataset with all columns.
21
+ Default is True.
22
+ verbose : bool, optional
23
+ If True, prints detailed information about the data download and processing.
24
+ Default is False.
25
+
26
+ Returns
27
+ -------
28
+ geopandas.GeoDataFrame
29
+ A GeoDataFrame containing AMA Anemometric Towers data.
30
+
31
+ Examples
32
+ --------
33
+ >>> # Download AMA Anemometric Towers data
34
+ >>> df = read_ama_anemometric_towers()
35
+ >>> df.head()
36
+ """
37
+
38
+ url = "https://gisepeprd2.epe.gov.br/arcgis/rest/services/Download_Dados_Webmap_EPE/GPServer/Extract%20Data%20Task/execute?f=json&env%3AoutSR=102100&Layers_to_Clip=%5B%22Torres%20Anemom%C3%A9tricas%20do%20AMA%22%5D&Area_of_Interest=%7B%22geometryType%22%3A%22esriGeometryPolygon%22%2C%22features%22%3A%5B%7B%22geometry%22%3A%7B%22rings%22%3A%5B%5B%5B-9237395.881983705%2C-4650539.310904562%5D%2C%5B-9237395.881983705%2C1219824.4613954136%5D%2C%5B-2349502.3891517334%2C1219824.4613954136%5D%2C%5B-2349502.3891517334%2C-4650539.310904562%5D%2C%5B-9237395.881983705%2C-4650539.310904562%5D%5D%5D%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D%7D%5D%2C%22sr%22%3A%7B%22wkid%22%3A102100%7D%7D&Feature_Format=Shapefile%20-%20SHP%20-%20.shp&Raster_Format=Tagged%20Image%20File%20Format%20-%20TIFF%20-%20.tif"
39
+
40
+ if verbose:
41
+ print("Downloading data...")
42
+
43
+ try:
44
+ response = requests.get(url)
45
+ response.raise_for_status()
46
+ response_json = response.json()
47
+
48
+ if "value" not in response_json or not response_json["value"]:
49
+ raise ValueError("No data found in the response")
50
+
51
+ download_url = response_json["value"]["itemUrl"]
52
+
53
+ if verbose:
54
+ print(f"Download URL: {download_url}")
55
+ print("Downloading zip file...")
56
+
57
+ zip_response = requests.get(download_url)
58
+ zip_response.raise_for_status()
59
+
60
+ # Create a temporary directory to extract the files
61
+ with tempfile.TemporaryDirectory() as temp_dir:
62
+ zip_path = os.path.join(temp_dir, "data.zip")
63
+
64
+ # Save the zip file
65
+ with open(zip_path, "wb") as f:
66
+ f.write(zip_response.content)
67
+
68
+ if verbose:
69
+ print(f"Zip file saved to {zip_path}")
70
+ print("Extracting files...")
71
+
72
+ # Extract the zip file
73
+ with zipfile.ZipFile(zip_path, "r") as zip_ref:
74
+ zip_ref.extractall(temp_dir)
75
+
76
+ # Find the shapefile
77
+ shp_files = [f for f in os.listdir(temp_dir) if f.endswith(".shp")]
78
+
79
+ if not shp_files:
80
+ raise FileNotFoundError("No shapefile found in the downloaded zip file")
81
+
82
+ shp_path = os.path.join(temp_dir, shp_files[0])
83
+
84
+ if verbose:
85
+ print(f"Reading shapefile from {shp_path}")
86
+
87
+ # Read the shapefile
88
+ gdf = gpd.read_file(shp_path)
89
+
90
+ # Convert to SIRGAS 2000 (EPSG:4674)
91
+ gdf = gdf.to_crs(epsg=4674)
92
+
93
+ if simplified:
94
+ # Select only essential columns
95
+ if verbose:
96
+ print("Simplifying the dataset...")
97
+
98
+ # Identify the essential columns
99
+ essential_cols = ["geometry"]
100
+
101
+ # Add any other essential columns that exist in the dataset
102
+ for col in ["NOME", "MUNICIPIO", "UF", "ALTURA", "SITUACAO"]:
103
+ if col in gdf.columns:
104
+ essential_cols.append(col)
105
+
106
+ # Select only the essential columns
107
+ gdf = gdf[essential_cols]
108
+
109
+ return gdf
110
+
111
+ except requests.exceptions.RequestException as e:
112
+ warnings.warn(f"Error downloading data: {e}")
113
+ return None
114
+ except (ValueError, FileNotFoundError, zipfile.BadZipFile) as e:
115
+ warnings.warn(f"Error processing data: {e}")
116
+ return None
117
+ except Exception as e:
118
+ warnings.warn(f"Unexpected error: {e}")
119
+ return None
@@ -0,0 +1,129 @@
1
+ import geopandas as gpd
2
+ import requests
3
+ import shutil
4
+ import zipfile
5
+ import tempfile
6
+ import warnings
7
+ import os
8
+ from shapely.geometry.point import Point
9
+
10
+
11
+ def read_areas_under_contract(simplified=False, verbose=False):
12
+ """Download data of oil and gas areas under contract in Brazil.
13
+
14
+ This function downloads and returns data of oil and gas areas under contract
15
+ (Áreas sob Contrato) in Brazil as a GeoPandas GeoDataFrame. The data comes
16
+ from EPE (Energy Research Company).
17
+
18
+ Parameters
19
+ ----------
20
+ simplified : bool, optional
21
+ If True, returns a simplified version of the dataset with only the most
22
+ important columns. If False, returns the complete dataset. Default is False.
23
+ verbose : bool, optional
24
+ If True, displays detailed messages about the download and processing
25
+ steps. Default is False.
26
+
27
+ Returns
28
+ -------
29
+ gpd.GeoDataFrame
30
+ A GeoDataFrame containing data on oil and gas areas under contract in Brazil.
31
+
32
+ Raises
33
+ ------
34
+ Exception
35
+ If the download or processing of the data fails.
36
+
37
+ Example
38
+ -------
39
+ >>> from tunned_geobr import read_areas_under_contract
40
+ >>>
41
+ >>> # Read the data
42
+ >>> contract_areas = read_areas_under_contract()
43
+ >>>
44
+ >>> # Plot the data
45
+ >>> contract_areas.plot()
46
+ """
47
+
48
+ if verbose:
49
+ print("Downloading data of oil and gas areas under contract in Brazil")
50
+
51
+ # Define the URL for the API request
52
+ url = "https://gisepeprd2.epe.gov.br/arcgis/rest/services/Download_Dados_Webmap_EPE/GPServer/Extract%20Data%20Task/execute?f=json&env%3AoutSR=102100&Layers_to_Clip=%5B%22%C3%81reas%20sob%20Contrato%22%5D&Area_of_Interest=%7B%22geometryType%22%3A%22esriGeometryPolygon%22%2C%22features%22%3A%5B%7B%22geometry%22%3A%7B%22rings%22%3A%5B%5B%5B-9237395.881983705%2C-4650539.310904562%5D%2C%5B-9237395.881983705%2C1219824.4613954136%5D%2C%5B-2349502.3891517334%2C1219824.4613954136%5D%2C%5B-2349502.3891517334%2C-4650539.310904562%5D%2C%5B-9237395.881983705%2C-4650539.310904562%5D%5D%5D%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D%7D%5D%2C%22sr%22%3A%7B%22wkid%22%3A102100%7D%7D&Feature_Format=Shapefile%20-%20SHP%20-%20.shp&Raster_Format=Tagged%20Image%20File%20Format%20-%20TIFF%20-%20.tif"
53
+
54
+ try:
55
+ # Make the API request
56
+ response = requests.get(url)
57
+ response.raise_for_status()
58
+
59
+ # Parse the JSON response
60
+ data = response.json()
61
+
62
+ # Extract the URL for the zip file
63
+ if 'results' in data and len(data['results']) > 0 and 'value' in data['results'][0]:
64
+ download_url = data['results'][0]['value']['url']
65
+ else:
66
+ raise Exception("Failed to extract download URL from API response")
67
+
68
+ # Create a temporary directory to store the downloaded files
69
+ with tempfile.TemporaryDirectory() as temp_dir:
70
+ # Download the zip file
71
+ zip_path = os.path.join(temp_dir, "areas_under_contract.zip")
72
+ if verbose:
73
+ print("Downloading zip file")
74
+
75
+ response = requests.get(download_url, stream=True)
76
+ response.raise_for_status()
77
+
78
+ with open(zip_path, 'wb') as f:
79
+ response.raw.decode_content = True
80
+ shutil.copyfileobj(response.raw, f)
81
+
82
+ # Extract the zip file
83
+ if verbose:
84
+ print("Extracting files")
85
+
86
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
87
+ zip_ref.extractall(temp_dir)
88
+
89
+ # Find the shapefile in the extracted files
90
+ shp_files = [f for f in os.listdir(temp_dir) if f.endswith('.shp')]
91
+
92
+ if not shp_files:
93
+ raise Exception("No shapefile found in the downloaded zip file")
94
+
95
+ # Read the shapefile
96
+ if verbose:
97
+ print("Reading shapefile")
98
+
99
+ shp_path = os.path.join(temp_dir, shp_files[0])
100
+ gdf = gpd.read_file(shp_path)
101
+
102
+ # Convert to SIRGAS 2000 (EPSG:4674)
103
+ if verbose:
104
+ print("Converting to SIRGAS 2000 (EPSG:4674)")
105
+
106
+ gdf = gdf.to_crs(epsg=4674)
107
+
108
+ # Simplify the dataset if requested
109
+ if simplified:
110
+ if verbose:
111
+ print("Simplifying the dataset")
112
+
113
+ # Select only the most important columns
114
+ # Adjust these columns based on the actual data structure
115
+ cols_to_keep = ['NOME', 'OPERADOR', 'BACIA', 'CONTRATO', 'FASE', 'UF', 'geometry']
116
+ cols_available = [col for col in cols_to_keep if col in gdf.columns]
117
+
118
+ if not cols_available:
119
+ warnings.warn("None of the specified columns for simplification are available. Returning the full dataset.")
120
+ else:
121
+ gdf = gdf[cols_available]
122
+
123
+ if verbose:
124
+ print("Finished processing oil and gas areas under contract data")
125
+
126
+ return gdf
127
+
128
+ except Exception as e:
129
+ raise Exception(f"Failed to download or process oil and gas areas under contract data: {str(e)}")
@@ -0,0 +1,128 @@
1
+ import geopandas as gpd
2
+ import requests
3
+ import shutil
4
+ import zipfile
5
+ import tempfile
6
+ import warnings
7
+ import os
8
+ from shapely.geometry.point import Point
9
+
10
+
11
+ def read_biodiesel_plants(simplified=False, verbose=False):
12
+ """Download data of biodiesel production plants in Brazil.
13
+
14
+ This function downloads and returns data of biodiesel production plants
15
+ in Brazil as a GeoPandas GeoDataFrame. The data comes from EPE (Energy Research Company).
16
+
17
+ Parameters
18
+ ----------
19
+ simplified : bool, optional
20
+ If True, returns a simplified version of the dataset with only the most
21
+ important columns. If False, returns the complete dataset. Default is False.
22
+ verbose : bool, optional
23
+ If True, displays detailed messages about the download and processing
24
+ steps. Default is False.
25
+
26
+ Returns
27
+ -------
28
+ gpd.GeoDataFrame
29
+ A GeoDataFrame containing data on biodiesel production plants in Brazil.
30
+
31
+ Raises
32
+ ------
33
+ Exception
34
+ If the download or processing of the data fails.
35
+
36
+ Example
37
+ -------
38
+ >>> from tunned_geobr import read_biodiesel_plants
39
+ >>>
40
+ >>> # Read the data
41
+ >>> biodiesel_plants = read_biodiesel_plants()
42
+ >>>
43
+ >>> # Plot the data
44
+ >>> biodiesel_plants.plot()
45
+ """
46
+
47
+ if verbose:
48
+ print("Downloading data of biodiesel production plants in Brazil")
49
+
50
+ # Define the URL for the API request
51
+ url = "https://gisepeprd2.epe.gov.br/arcgis/rest/services/Download_Dados_Webmap_EPE/GPServer/Extract%20Data%20Task/execute?f=json&env%3AoutSR=102100&Layers_to_Clip=%5B%22Plantas%20de%20biodiesel%22%5D&Area_of_Interest=%7B%22geometryType%22%3A%22esriGeometryPolygon%22%2C%22features%22%3A%5B%7B%22geometry%22%3A%7B%22rings%22%3A%5B%5B%5B-8655251.47456396%2C-4787514.465591563%5D%2C%5B-8655251.47456396%2C1229608.401015912%5D%2C%5B-3508899.2341809804%2C1229608.401015912%5D%2C%5B-3508899.2341809804%2C-4787514.465591563%5D%2C%5B-8655251.47456396%2C-4787514.465591563%5D%5D%5D%2C%22spatialReference%22%3A%7B%22wkid%22%3A102100%7D%7D%7D%5D%2C%22sr%22%3A%7B%22wkid%22%3A102100%7D%7D&Feature_Format=Shapefile%20-%20SHP%20-%20.shp&Raster_Format=Tagged%20Image%20File%20Format%20-%20TIFF%20-%20.tif"
52
+
53
+ try:
54
+ # Make the API request
55
+ response = requests.get(url)
56
+ response.raise_for_status()
57
+
58
+ # Parse the JSON response
59
+ data = response.json()
60
+
61
+ # Extract the URL for the zip file
62
+ if 'results' in data and len(data['results']) > 0 and 'value' in data['results'][0]:
63
+ download_url = data['results'][0]['value']['url']
64
+ else:
65
+ raise Exception("Failed to extract download URL from API response")
66
+
67
+ # Create a temporary directory to store the downloaded files
68
+ with tempfile.TemporaryDirectory() as temp_dir:
69
+ # Download the zip file
70
+ zip_path = os.path.join(temp_dir, "biodiesel_plants.zip")
71
+ if verbose:
72
+ print("Downloading zip file")
73
+
74
+ response = requests.get(download_url, stream=True)
75
+ response.raise_for_status()
76
+
77
+ with open(zip_path, 'wb') as f:
78
+ response.raw.decode_content = True
79
+ shutil.copyfileobj(response.raw, f)
80
+
81
+ # Extract the zip file
82
+ if verbose:
83
+ print("Extracting files")
84
+
85
+ with zipfile.ZipFile(zip_path, 'r') as zip_ref:
86
+ zip_ref.extractall(temp_dir)
87
+
88
+ # Find the shapefile in the extracted files
89
+ shp_files = [f for f in os.listdir(temp_dir) if f.endswith('.shp')]
90
+
91
+ if not shp_files:
92
+ raise Exception("No shapefile found in the downloaded zip file")
93
+
94
+ # Read the shapefile
95
+ if verbose:
96
+ print("Reading shapefile")
97
+
98
+ shp_path = os.path.join(temp_dir, shp_files[0])
99
+ gdf = gpd.read_file(shp_path)
100
+
101
+ # Convert to SIRGAS 2000 (EPSG:4674)
102
+ if verbose:
103
+ print("Converting to SIRGAS 2000 (EPSG:4674)")
104
+
105
+ gdf = gdf.to_crs(epsg=4674)
106
+
107
+ # Simplify the dataset if requested
108
+ if simplified:
109
+ if verbose:
110
+ print("Simplifying the dataset")
111
+
112
+ # Select only the most important columns
113
+ # Adjust these columns based on the actual data structure
114
+ cols_to_keep = ['NOME', 'CAPACIDADE', 'PROPRIETAR', 'UF', 'MUNICIPIO', 'geometry']
115
+ cols_available = [col for col in cols_to_keep if col in gdf.columns]
116
+
117
+ if not cols_available:
118
+ warnings.warn("None of the specified columns for simplification are available. Returning the full dataset.")
119
+ else:
120
+ gdf = gdf[cols_available]
121
+
122
+ if verbose:
123
+ print("Finished processing biodiesel production plants data")
124
+
125
+ return gdf
126
+
127
+ except Exception as e:
128
+ raise Exception(f"Failed to download or process biodiesel production plants data: {str(e)}")