Basic workflow introduction¶
GLAES is a framework for conducting land eligibility analyses, for instance determining areas that are deemed 'eligible' for some purpose (such as placing a wind turbine) within a region.
This example presents a basic workflow for determing the land eligibility for photovoltaic (PV) modules in the Aachen administration region considering that:
- PV modules should not cover
agricultural areas(because people need to eat) - PV modules should not be within 1000 meters of a
settlement area(because they are too shiny) - PV modules should not be within 200 meters of a
major road way(because they may get dirty)
Input:¶
- Shape file of the Aachen Region ("aachenShapefile.shp")
- Land use data Corine Land Cover dataset (CLC dataset) that describes land usages by various purposes like agriculture, forestry, ... (you can find a list of the integer values and their assigned primary use here)
- Shapefile which describes the path of all roadways in the study area (aachenRoads.shp). Each feature in the roadways vector also has attribute named
typedistinguishing the class of the that specific route (for example: motorway, primary, secondary, tertiary, residential, service, etc., all attrubites listed in aachenRoads.dbf)
Workflow Overview:¶
- Set Up the
ExclusionCalculatorfor the Study Area - Exclude all
agriculture areasfrom intitally available area - Exclude 1 km around
settlement areason top of the agriculture exclusions. - Exclude area around
roadwayson top of the previous exclusions.
# Import GLAES
import matplotlib.pyplot as plt
import glaes as gl
1. Set Up the ExclusionCalculator for the Study Area¶
A spatial reference system (srs) defines how geographic locations are represented, ensuring that spatial data aligns correctly on a map. Using a specific SRS helps maintain consistency across datasets, allowing them to align and interact reliably. Here the EPSG:3035 spatial reference system is used, since it describes relational distances in meters over the entire study area.
An inherent resolution (pixelRes) of 100 x 100 meters is chosen as this is small enough to capture small details, but not so large as to require too many resources.
# Choose a region to operate on (Here, a predefined region for Aachen, Germany is used)
regionPath = gl._test_data_["aachenShapefile.shp"]
# Initialize ExclusionCalculator object
ec = gl.ExclusionCalculator(regionPath, srs=3035, pixelRes=100)
Visualize current availability of eligible PV areas in the Aachen area with .draw().
Since the ExclusionCalculator was just initialized without any substractions, all areas are currently available.
# Visualize avilability
fig, axs = plt.subplots(1, 1, figsize=(10, 10))
ec.draw(ax=axs)
fig.show()
2. Exclude agricultural areas¶
Integer values 12-22 found in the CLC dataset indicate that the associated pixel is primarily used for agricultural purposes. Excluded areas are now shown in blue.
# Set a path to a local copy of the CLC raster dataset (Here, a small sample is provided around Aachen)
clcRasterPath = gl._test_data_["clc-aachen_clipped.tif"]
# Apply exclusion
ec.excludeRasterType(clcRasterPath, value=(12, 22)) # value range 12-22
# Visualize
ec.draw()
Memory usage during calc: 242.75390625 MB
<Axes: >
3. Exclude settlements¶
1 km around settlement areas are now excluded on top of the agricultural exclusions.
- Integer values
1and2found in the CLC dataset indicate that the associated pixel is primarily composed ofurban fabric. - A
bufferis the additional distance around something (in this case settlement areas) that needs to be excluded as well. It is given in meters (buffer=1000).
# Apply exclusion
ec.excludeRasterType(clcRasterPath, value=(1, 2), buffer=1000)
# Visualize
ec.draw()
Memory usage during calc: 247.86328125 MB
<Axes: >
4. Exclude roadways¶
- 200 meters from all major roadways are finally excluded on top of the previous exclusions (
buffer=200). - Only major road ways are desired, not the smaller and less common roads.
- This is interpreted as roadways which are designated as
motorway,primary, ortrunk. An SQL-like where-statement is used to select only these features.
- This is interpreted as roadways which are designated as
# Set a path to a local copy of the OSM roads dataset (Here, a small sample is provided around Aachen)
roadwaysPath = gl._test_data_["aachenRoads.shp"]
# Apply Exclusion
whereStatement = "type='motorway' OR type='primary' OR type='trunk'"
ec.excludeVectorType(roadwaysPath, where=whereStatement, buffer=200)
# Visualize
ec.draw()
Memory usage during calc: 267.96484375 MB
<Axes: >
Save the resulting available lands to a raster (.tif) file¶
Save ExclusionCalculator instance to make it accessible for later work (cf. 02_extended_methods section 3)
ec.save("tmp/aachens_best_pv_spots.tif", overwrite=True)
'tmp/aachens_best_pv_spots.tif'