tunned-geobr 1.0.3__tar.gz → 1.0.4__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.
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/PKG-INFO +1 -1
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/pyproject.toml +1 -1
- tunned_geobr-1.0.4/tunned_geobr/read_sigef_properties.py +115 -0
- tunned_geobr-1.0.3/tunned_geobr/read_sigef_properties.py +0 -81
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/LICENSE.txt +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/README.md +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/__init__.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/read_state.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_list_geobr.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_lookup_muni.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_amazon.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_biomes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_census_tract.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_comparable_areas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_conservation_units.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_country.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_disaster_risk_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_health_facilities.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_health_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_immediate_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_indigenous_land.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_intermediate_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_meso_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_metro_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_micro_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_municipal_seat.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_municipality.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_neighborhood.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_pop_arrangements.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_schools.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_semiarid.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_state.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_statistical_grid.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_urban_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_urban_concentrations.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_read_weighting_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tests/test_utils.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/__init__.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/data/grid_state_correspondence_table.csv +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/list_geobr.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/lookup_muni.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_ama_anemometric_towers.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_amazon.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_amazon_ibas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_amazon.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_caatinga.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_cerrado_pantanal.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_mata_atlantica.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_pampa.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_apcb_zcm.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_archaeological_sites.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_areas_under_contract.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_atlantic_forest_ibas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_atlantic_forest_law_limits.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_baze_sites.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_biodiesel_plants.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_biomes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_biomethane_plants.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_biosphere_reserves.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_cave_potential.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_census_tract.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_climate_aggressiveness.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_comparable_areas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_compression_stations.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_conservation_units.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_country.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_disaster_risk_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_drainage_ducts.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_ebas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_etanol_plants.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_biomass_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_cgh.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_eolic.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_fossile_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_nuclear_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_pch.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_solar.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_substations.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_transmission_lines.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_existent_uhe.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_exploration_production_environment.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_federal_highways.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_federal_union_areas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_fossil_occurrences.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_fuel_bases.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_gas_distribution_pipelines.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_gas_transport_pipelines.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_geographic_regions.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_geology.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_geomorphology.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_glp_bases.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_gnl_terminals.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_health_facilities.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_health_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_heliports.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_hydroelectric_feasibility_studies.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_hydroelectric_inventory_aai_studies.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_ibama_embargoes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_icmbio_embargoes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_icmbio_infractions.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_immediate_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_indigenous_land.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_intermediate_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_isolated_systems.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_meso_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_metro_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_micro_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_mining_processes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_municipal_seat.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_municipality.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_municipality_direct.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_natural_caves.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_natural_gas_delivery_points.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_natural_gas_processing_hub.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_neighborhood.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_basement.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_effective_geographic_basin.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_direct_evidence.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_exploratory_activity.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_exploratory_intensity.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_need_for_knowledge.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_prospectiveness.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_ipa_supply_infrastructure.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_legal_pre_salt_polygon.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_predominant_fluid_type.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_probabilistic_effective_basin.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_total_ipa.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_unconventional_resources.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_oil_and_derivatives_terminal.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pan_strategic_areas 2.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pan_strategic_areas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pedology.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pio_ducts.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pio_terminals.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_biomass_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_cgh.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_eolic.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_fossile_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_nuclear_ute.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_pch.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_solar.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_substations.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_transmission_lines.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_planned_uhe.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_pop_arrangements.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_ports.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_private_aerodromes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_processing_facilities.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_public_aerodromes.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_quilombola_areas.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_railways.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_region.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_rppn.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_schools.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_sedimentary_basins.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_semiarid.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_settlements.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_snci_properties.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_state.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_state_direct.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_state_highways.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_statistical_grid.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_subsystem_interconnected.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_transmission_lines_ons.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_urban_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_urban_concentrations.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_vegetation.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_water_bodies_ana.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_waterways.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_weighting_area.py +0 -0
- {tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/utils.py +0 -0
@@ -0,0 +1,115 @@
|
|
1
|
+
import geopandas as gpd
|
2
|
+
import tempfile
|
3
|
+
import os
|
4
|
+
import requests
|
5
|
+
from zipfile import ZipFile
|
6
|
+
from io import BytesIO
|
7
|
+
from requests.adapters import HTTPAdapter
|
8
|
+
from urllib3.util.retry import Retry
|
9
|
+
import time # Import time for potential delays between retries
|
10
|
+
|
11
|
+
def read_sigef_properties(simplified=False):
|
12
|
+
"""Download SIGEF Properties data from INCRA.
|
13
|
+
|
14
|
+
This function downloads and processes rural property data from INCRA's
|
15
|
+
SIGEF (Sistema de Gestão Fundiária). The dataset contains information
|
16
|
+
about rural properties registered in the SIGEF system across Brazil.
|
17
|
+
|
18
|
+
Original source: INCRA (Instituto Nacional de Colonização e Reforma Agrária)
|
19
|
+
|
20
|
+
Parameters
|
21
|
+
----------
|
22
|
+
simplified : bool, default False
|
23
|
+
If True, returns a simplified version of the dataset with selected columns.
|
24
|
+
|
25
|
+
Returns
|
26
|
+
-------
|
27
|
+
gpd.GeoDataFrame
|
28
|
+
GeoDataFrame with SIGEF properties data.
|
29
|
+
|
30
|
+
Example
|
31
|
+
-------
|
32
|
+
>>> from tunned_geobr import read_sigef_properties
|
33
|
+
|
34
|
+
# Read SIGEF properties data
|
35
|
+
>>> properties = read_sigef_properties()
|
36
|
+
"""
|
37
|
+
|
38
|
+
url = "https://certificacao.incra.gov.br/csv_shp/zip/Sigef%20Brasil.zip"
|
39
|
+
|
40
|
+
# Configure retries
|
41
|
+
retries = Retry(
|
42
|
+
total=5, # Total number of retries to allow
|
43
|
+
backoff_factor=1, # A backoff factor to apply between attempts (e.g., 1, 2, 4, 8 seconds)
|
44
|
+
status_forcelist=[500, 502, 503, 504], # HTTP status codes to retry on
|
45
|
+
allowed_methods={"GET"}, # Only retry GET requests
|
46
|
+
raise_on_status=False # Don't raise an exception on failed status codes immediately
|
47
|
+
)
|
48
|
+
|
49
|
+
# Create a session and mount the adapter with retries
|
50
|
+
session = requests.Session()
|
51
|
+
session.mount('https://', HTTPAdapter(max_retries=retries))
|
52
|
+
|
53
|
+
try:
|
54
|
+
# Download the zip file in chunks
|
55
|
+
# Disable SSL verification due to INCRA's certificate issues
|
56
|
+
import urllib3
|
57
|
+
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
58
|
+
|
59
|
+
# Use stream=True to download content in chunks with the session
|
60
|
+
response = session.get(url, stream=True, verify=False, timeout=300) # Added a timeout for the request
|
61
|
+
response.raise_for_status() # Raise an exception for HTTP errors (4xx or 5xx)
|
62
|
+
|
63
|
+
# Create a temporary directory
|
64
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
65
|
+
zip_file_path = os.path.join(temp_dir, "Sigef Brasil.zip")
|
66
|
+
# Write the content to the file
|
67
|
+
with open(zip_file_path, 'wb') as fd:
|
68
|
+
for chunk in response.iter_content(chunk_size=8192):
|
69
|
+
fd.write(chunk)
|
70
|
+
|
71
|
+
# Extract the zip file
|
72
|
+
with ZipFile(zip_file_path) as zip_ref:
|
73
|
+
zip_ref.extractall(temp_dir)
|
74
|
+
|
75
|
+
# Find the shapefile
|
76
|
+
shp_files = [f for f in os.listdir(temp_dir) if f.endswith('.shp')]
|
77
|
+
if not shp_files:
|
78
|
+
raise Exception("No shapefile found in the downloaded data")
|
79
|
+
|
80
|
+
# Read the shapefile
|
81
|
+
gdf = gpd.read_file(os.path.join(temp_dir, shp_files[0]))
|
82
|
+
gdf = gdf.to_crs(4674) # Convert to SIRGAS 2000
|
83
|
+
|
84
|
+
if simplified:
|
85
|
+
# Keep only the most relevant columns
|
86
|
+
columns_to_keep = [
|
87
|
+
'geometry',
|
88
|
+
'parcela', # Property ID
|
89
|
+
'municipio', # Municipality
|
90
|
+
'uf', # State
|
91
|
+
'area_ha', # Area in hectares
|
92
|
+
'status', # Certification status
|
93
|
+
'data_cert', # Certification date
|
94
|
+
'cod_imovel', # Property code
|
95
|
+
'nome_imov' # Property name
|
96
|
+
]
|
97
|
+
|
98
|
+
# Filter columns that actually exist in the dataset
|
99
|
+
existing_columns = ['geometry'] + [col for col in columns_to_keep[1:] if col in gdf.columns]
|
100
|
+
gdf = gdf[existing_columns]
|
101
|
+
|
102
|
+
except requests.exceptions.Timeout:
|
103
|
+
raise Exception(f"Download timed out after {300} seconds. The file might be too large or the connection too slow.")
|
104
|
+
except requests.exceptions.ConnectionError as e:
|
105
|
+
raise Exception(f"A connection error occurred during download: {str(e)}. This might be due to network issues or server availability.")
|
106
|
+
except requests.exceptions.RequestException as e:
|
107
|
+
raise Exception(f"An unexpected request error occurred: {str(e)}")
|
108
|
+
except Exception as e:
|
109
|
+
raise Exception(f"Error processing certified properties data: {str(e)}")
|
110
|
+
|
111
|
+
finally:
|
112
|
+
session.close() # Ensure the session is closed
|
113
|
+
|
114
|
+
return gdf
|
115
|
+
|
@@ -1,81 +0,0 @@
|
|
1
|
-
import geopandas as gpd
|
2
|
-
import tempfile
|
3
|
-
import os
|
4
|
-
import requests
|
5
|
-
from zipfile import ZipFile
|
6
|
-
from io import BytesIO
|
7
|
-
|
8
|
-
def read_sigef_properties(simplified=False):
|
9
|
-
"""Download Certified Properties data from INCRA's SNCI.
|
10
|
-
|
11
|
-
This function downloads and processes certified properties data from INCRA's
|
12
|
-
National Property Certification System (Sistema Nacional de Certificação de Imóveis - SNCI).
|
13
|
-
The data includes information about certified rural properties across Brazil.
|
14
|
-
Original source: INCRA (Instituto Nacional de Colonização e Reforma Agrária)
|
15
|
-
|
16
|
-
Parameters
|
17
|
-
----------
|
18
|
-
simplified : boolean, by default False
|
19
|
-
If True, returns a simplified version of the dataset with fewer columns
|
20
|
-
|
21
|
-
Returns
|
22
|
-
-------
|
23
|
-
gpd.GeoDataFrame
|
24
|
-
Geodataframe with certified properties data
|
25
|
-
|
26
|
-
Example
|
27
|
-
-------
|
28
|
-
>>> from tunned_geobr import read_snci_properties
|
29
|
-
|
30
|
-
# Read certified properties data
|
31
|
-
>>> properties = read_snci_properties()
|
32
|
-
"""
|
33
|
-
|
34
|
-
url = "https://certificacao.incra.gov.br/csv_shp/zip/Sigef%20Brasil.zip"
|
35
|
-
try:
|
36
|
-
# Download the zip file
|
37
|
-
# Disable SSL verification due to INCRA's certificate issues
|
38
|
-
import urllib3
|
39
|
-
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
40
|
-
|
41
|
-
response = requests.get(url, verify=False)
|
42
|
-
if response.status_code != 200:
|
43
|
-
raise Exception("Failed to download data from INCRA")
|
44
|
-
|
45
|
-
# Create a temporary directory
|
46
|
-
with tempfile.TemporaryDirectory() as temp_dir:
|
47
|
-
# Extract the zip file
|
48
|
-
with ZipFile(BytesIO(response.content)) as zip_ref:
|
49
|
-
zip_ref.extractall(temp_dir)
|
50
|
-
|
51
|
-
# Find the shapefile
|
52
|
-
shp_files = [f for f in os.listdir(temp_dir) if f.endswith('.shp')]
|
53
|
-
if not shp_files:
|
54
|
-
raise Exception("No shapefile found in the downloaded data")
|
55
|
-
|
56
|
-
# Read the shapefile
|
57
|
-
gdf = gpd.read_file(os.path.join(temp_dir, shp_files[0]))
|
58
|
-
gdf = gdf.to_crs(4674) # Convert to SIRGAS 2000
|
59
|
-
|
60
|
-
if simplified:
|
61
|
-
# Keep only the most relevant columns
|
62
|
-
columns_to_keep = [
|
63
|
-
'geometry',
|
64
|
-
'parcela', # Property ID
|
65
|
-
'municipio', # Municipality
|
66
|
-
'uf', # State
|
67
|
-
'area_ha', # Area in hectares
|
68
|
-
'status', # Certification status
|
69
|
-
'data_cert', # Certification date
|
70
|
-
'cod_imovel', # Property code
|
71
|
-
'nome_imov' # Property name
|
72
|
-
]
|
73
|
-
|
74
|
-
# Filter columns that actually exist in the dataset
|
75
|
-
existing_columns = ['geometry'] + [col for col in columns_to_keep[1:] if col in gdf.columns]
|
76
|
-
gdf = gdf[existing_columns]
|
77
|
-
|
78
|
-
except Exception as e:
|
79
|
-
raise Exception(f"Error downloading certified properties data: {str(e)}")
|
80
|
-
|
81
|
-
return gdf
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/data/grid_state_correspondence_table.csv
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_exploration_production_environment.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_hydroelectric_feasibility_studies.py
RENAMED
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_hydroelectric_inventory_aai_studies.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_effective_geographic_basin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{tunned_geobr-1.0.3 → tunned_geobr-1.0.4}/tunned_geobr/read_og_probabilistic_effective_basin.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|