Geosampler

Terramonitor Geosampler calculates the zonal statistics (mean, maximum, minimum etc.) from a raster file containing geographical information, around coordinate points defined in the input file with a given radius in meters. Produces a csv file in the output directory with zonal statistics added to the points. The method is based on the QGIS Zonal Statistics Plugin, see https://docs.qgis.org/2.18/en/docs/user_manual/plugins/plugins_zonal_statistics.html for detailed information.

Requirements

Ubuntu operating system + Python3

Root privileges are required to install the QGIS package (installation is performed automatically by running the geosampler.py script).

Usage

python3 geosampler.py [points filename in input directory] [geotiff filename in geotiff directory] [radius in meters]

Example: python3 geosampler.py sample_input.csv corine_2012.tif 200

The input csv file should contain the columns “id”,”lon” and “lat” and the semicolon “;” should be used as the separator in the csv file. The “id” column represents the unique identifier of the coordinate point. The “lon” and “lat” columns represent the longitude and latitude of the point in EPSG:4326 coordinate reference system.

Files

FilenameDescription
geosampler.pyMain Python script file 
input/sample_input.csvA sample input file of coordinate points and ids 
geotiff/corine_yyyy.tifCorine land cover files

Similar Posts