This project generates an elevation map of the state of Minas Gerais, Brazil, using Python. The script utilizes libraries such as geopandas, rasterio, and matplotlib to load and visualize geospatial data.
- Load geospatial data for Minas Gerais
- Generate an elevation map using raster data
- Visualize the elevation map with matplotlib
- Python 3.x
- Install the dependencies listed in
requirements.txt:pip install -r requirements.txt
- Clone this repository:
git clone https://github.com/yourusername/minas-gerais-elevation-map.git cd minas-gerais-elevation-map - Install the required dependencies:
pip install -r requirements.txt
To generate the elevation map, you will need to download Digital Elevation Model (DEM) data. You can obtain these data from the following sources:
-
USGS Earth Explorer: A comprehensive platform for accessing various types of satellite imagery and geospatial data. Register for an account, define your Area of Interest (AOI), and download DEM files from the "SRTM 1 Arc-Second Global" dataset for high-resolution elevation data.
-
NASA Earthdata: Provides access to a wide range of Earth science data, including elevation data from the Shuttle Radar Topography Mission (SRTM).
- Ensure you have the required geospatial data files in the appropriate directories.
- Run the script to generate the elevation map:
python generate_elevation_map.py
- The script will generate and display an elevation map of Minas Gerais.
import geopandas as gpd
import rasterio
import matplotlib.pyplot as plt
# Load the geospatial data
shapefile = gpd.read_file('path/to/shapefile.shp')
raster = rasterio.open('path/to/raster.tif')
# Generate and visualize the elevation map
fig, ax = plt.subplots()
shapefile.plot(ax=ax, facecolor='none', edgecolor='black')
ax.imshow(raster.read(1), cmap='terrain', extent=raster.bounds)
plt.title('Elevation Map of Minas Gerais')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.show()Here is a screenshot of the generated elevation map:
This project was created to provide a visual representation of the elevation data for the state of Minas Gerais, Brazil. The main objective was to use Python and various geospatial libraries to process and visualize DEM data. The project involves several key steps:
- Data Acquisition: Obtaining the necessary geospatial data (DEM and shapefiles) from reliable sources such as USGS Earth Explorer and NASA Earthdata.
- Data Processing: Using
geopandasto load the shapefile of Minas Gerais andrasterioto read the DEM data. - Visualization: Creating an elevation map using
matplotlibto plot the data and provide a visual representation of the terrain.
This project showcases the application of geospatial data processing and visualization techniques in Python, highlighting the capabilities of libraries such as geopandas, rasterio, and matplotlib.
- Fork the repository
- Create your feature branch (
git checkout -b feature/fooBar) - Commit your changes (
git commit -am 'Add some fooBar') - Push to the branch (
git push origin feature/fooBar) - Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GeoPandas
- Rasterio
- Matplotlib
- USGS Earth Explorer for providing the DEM data
- NASA Earthdata for additional geospatial data
