Creating Geometries

Simple Geometries:

StSpatialCommand(functionToApply, layer, outputLayername)
  • functionsToApply (type) – Choose between Kernel, BBox, Centroid, Convex Hull
  • layer (QgsVectorLayer) – input layer
  • outputLayername (string) – output layer name
  • The Kernel is the sub-area within which all other points in a geometry are visible
  • Centroid is the center-most point of a geometry
  • The Bounding Box is the smallest square within which the originial geometry can fit
  • The Convex Hull is the smallest convex geometry that encompasses the entire original geometry

Complex Geometries :

STConnectedSpacesAndPatios(inputLayer, buffDist).execute()
  • inputLayer (qgsVectorLayer) – A vector layer of polygons
  • buffDist (float) – The distance of the buffer

connectedSpaces: a Convex Hull of the input Layer minus the built exterior ring


builtExtRing: A vector layer containing the negative buffer of the unions of the positive buffers of the input layer


patios: a vector layer containing the open space left over from the built exterior ring which is not contained in the connected spaces.

Original buildings layer.

The Convex Hull (grey), the exterior buildings rings (black), and the patios (white).

STSkeletonizeTheVoid(buildingsLayer, samplingDist).execute()
  • buildingsLayer (qgsVectorLayer) – The input layer containing polygonal geometries
  • samplingDist (float) – The distance between samping points for the Voronoi polygons

The skeleton


The layer of nodes used for the calibration of the Voronoï process


A Voronoï polygons layer


Use the built exterior ring returned by STConnectedSpacesAndPatios() as input layer to remove empty spaces between buildings and create a single uninterupted graph.

The skeletonization will occure at every open space, including areas surrounded by buildings are therefore not pertaining to any mobility graph.

Using the exterior ring of buildings creates a interconnected web.

Zooming into an interection, we can notice the effect of the sampling distance :

samplingDist == 10.0

Buildings in black, voronoi polygons in purple, nodes in green

samplingDist == 1.0

Buildings in black, voronoi polygons in purple, nodes in red