Python script to automatically download LiDAR data from GeoSampa, based on an area of interest (AOI) specified from a shape file (polygon).
- Python 3.x
- Python packages:
- geopandas
- requests
You can install the script in two ways: by cloning the repository or by directly downloading the necessary files.
-
Clone the repository:
git clone https://github.com/yourusername/PyGeoSampa_LiDar.git cd PyGeoSampa_LiDar -
Install the required packages:
pip install geopandas requests
-
Download the necessary files:
PyGeoSampa_LiDar.pySIRGAS_SHP_quadriculamdt.zip
-
Place the files in the same directory.
-
Install the required packages:
pip install geopandas requests
Run the script with the full path to the shapefile of the area of interest (AOI):
python PyGeoSampa_LiDar.py <path_to_shapefile>python PyGeoSampa_LiDar.py .\limites.shp- The script loads the AOI shapefile and temporarily unzips the grid shapefile from GeoSampa (
SIRGAS_SHP_quadriculamdt.zip). - Converts the shapefiles to the same coordinate reference system (CRS).
- Checks if the AOI is a polygon. If it is not, the script issues an error and exits.
- Checks if the AOI is within the grid boundaries. If it is outside, it issues a warning and exits the script.
- Finds the grid cells that intersect the AOI.
- Prompts the user to select the data type (DSM or DTM) and the data year (2017 or 2020) by typing numbers (1 or 2).
- Constructs URLs to download the corresponding data files.
- Informs the user that the download process may take a while, then downloads and extracts the data files to a specified directory.
- If the user interrupts the process (Ctrl+C), the script displays a custom message "Process interrupted by user."
Abimael Cereda Junior - https://about.me/ceredajunior Geografia das Coisas - https://geografiadascoisas.com.br
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.