Azad Rasul


13- Chaining Processings

Azad Rasul's photo
Azad Rasul
·Jun 25, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

Download the data

Loading shapefiles of roads and some places of Erbil city in Iraq

roa = "D:/erbil_data/erbil_data/roads.shp"
pla = "D:/erbil_data/erbil_data/places.shp"

Choose only primary roads from the roads shapefile

expression = "fclass = 'primary'"

primary_roads ="native:extractbyexpression",
    {"INPUT":roa, "EXPRESSION":expression,"OUTPUT":"memory:"}

Create a buffer around primary roads

buffered_primary_roads ="native:buffer",

Add the layer of buffered_primary_roads


Find places along primary rods

places_along_primary_roads ="native:extractbylocation",
    {"INPUT": pla, "PREDICATE": [0], "INTERSECT":buffered_primary_roads, "OUTPUT": "memory:"}

Print the name of places along primary roads

for feature in places_along_primary_roads.getFeatures():

If you like the content, please SUBSCRIBE to my channel for the future content

Share this