Legacy API reference#

Warning

The functionality listed below is part of the legacy API and has been deprecated. Each class emits FutureWarning with a deprecation note. If you’d like to silence all of these warnigns, set an environment variable ALLOW_LEGACY_MOMEPY to "True":

import os

os.environ["ALLOW_LEGACY_MOMEPY"] = "True"

elements#

Blocks(tessellation, edges, buildings, ...)

Generate blocks based on buildings, tessellation, and street network.

get_network_id(left, right, network_id[, ...])

Snap each element (preferably building) to the closest street network segment and save its ID.

get_node_id(objects, nodes, edges, node_id)

Snap each building to the closest street network node on the closest network edge.

Tessellation(gdf, unique_id[, limit, ...])

Generates tessellation.

dimension#

Area(gdf)

Calculates the area of each object in a given GeoDataFrame.

AverageCharacter(gdf, values, ...[, rng, ...])

Calculates the average of a character within a set neighbourhood defined in spatial_weights.

CourtyardArea(gdf[, areas])

Calculates area of holes within geometry - area of courtyards.

CoveredArea(gdf, spatial_weights, unique_id)

Calculates the area covered by neighbours, which is total area covered by neighbours defined in spatial_weights and the element itself.

FloorArea(gdf, heights[, areas])

Calculates floor area of each object based on height and area.

LongestAxisLength(gdf)

Calculates the length of the longest axis of object.

Perimeter(gdf)

Calculates perimeter of each object in a given GeoDataFrame.

PerimeterWall(gdf[, spatial_weights, verbose])

Calculate the perimeter wall length of the joined structure.

SegmentsLength(gdf[, spatial_weights, mean, ...])

Calculate the cummulative and/or mean length of segments.

StreetProfile(left, right[, heights, ...])

Calculates the street profile characters.

Volume(gdf, heights[, areas])

Calculates the volume of each object in a given GeoDataFrame based on its height and area.

WeightedCharacter(gdf, values, ...[, areas, ...])

Calculates the weighted character.

shape#

CentroidCorners(gdf[, verbose])

Calculates the mean distance centroid - corners and standard deviation.

CircularCompactness(gdf[, areas])

Calculates the compactness index of each object in a given GeoDataFrame.

CompactnessWeightedAxis(gdf[, areas, ...])

Calculates the compactness-weighted axis of each object in a given GeoDataFrame.

Convexity(gdf[, areas])

Calculates the Convexity index of each object in a given GeoDataFrame.

Corners(gdf[, verbose])

Calculates the number of corners of each object in a given GeoDataFrame.

CourtyardIndex(gdf, courtyard_areas[, areas])

Calculates the courtyard index of each object in a given GeoDataFrame.

Elongation(gdf)

Calculates the elongation of each object seen as elongation of its minimum bounding rectangle.

EquivalentRectangularIndex(gdf[, areas, ...])

Calculates the equivalent rectangular index of each object in a given GeoDataFrame.

FormFactor(gdf, volumes[, areas, heights])

Calculates the form factor of each object in a given GeoDataFrame.

FractalDimension(gdf[, areas, perimeters])

Calculates fractal dimension of each object in given GeoDataFrame.

Linearity(gdf)

Calculates the linearity of each LineString object in a given GeoDataFrame.

Rectangularity(gdf[, areas])

Calculates the rectangularity of each object in a given GeoDataFrame.

ShapeIndex(gdf, longest_axis[, areas])

Calculates the shape index of each object in a given GeoDataFrame.

SquareCompactness(gdf[, areas, perimeters])

Calculates the compactness index of each object in a given GeoDataFrame.

Squareness(gdf[, verbose])

Calculates the squareness of each object in a given GeoDataFrame.

VolumeFacadeRatio(gdf, heights[, volumes, ...])

Calculates the volume/facade ratio of each object in a given GeoDataFrame.

spatial distribution#

Alignment(gdf, spatial_weights, unique_id, ...)

Calculate the mean deviation of solar orientation of objects on adjacent cells from an object.

BuildingAdjacency(gdf, ...[, ...])

Calculate the level of building adjacency.

CellAlignment(left, right, ...)

Calculate the difference between cell orientation and the orientation of object.

MeanInterbuildingDistance(gdf, ...[, order, ...])

Calculate the mean interbuilding distance.

NeighborDistance(gdf, spatial_weights, unique_id)

Calculate the mean distance to adjacent buildings (based on spatial_weights).

NeighboringStreetOrientationDeviation(gdf)

Calculate the mean deviation of solar orientation of adjacent streets.

Neighbors(gdf, spatial_weights, unique_id[, ...])

Calculate the number of neighbours captured by spatial_weights.

Orientation(gdf[, verbose])

Calculate the orientation of object.

SharedWalls(gdf)

Calculate the length of shared walls of adjacent elements (typically buildings).

SharedWallsRatio(gdf[, perimeters])

Calculate shared walls ratio of adjacent elements (typically buildings).

StreetAlignment(left, right, orientations[, ...])

Calculate the difference between street orientation and orientation of another object in degrees.

intensity#

AreaRatio(left, right, left_areas, right_areas)

Calculate covered area ratio or floor area ratio of objects.

BlocksCount(gdf, block_id, spatial_weights, ...)

Calculates the weighted number of blocks.

Count(left, right, left_id, right_id[, weighted])

Calculate the number of elements within an aggregated structure.

Courtyards(gdf[, spatial_weights, verbose])

Calculate the number of courtyards within the joined structure.

Density(gdf, values, spatial_weights, unique_id)

Calculate the gross density.

NodeDensity(left, right, spatial_weights[, ...])

Calculate the density of nodes neighbours on street network defined in spatial_weights.

Reached(left, right, left_id, right_id[, ...])

Calculates the number of objects reached within neighbours on a street network.

diversity#

Gini(gdf, values, spatial_weights, unique_id)

Calculates the Gini index of values within neighbours defined in spatial_weights.

Percentiles(gdf, values, spatial_weights, ...)

Calculates the percentiles of values within neighbours defined in spatial_weights.

Range(gdf, values, spatial_weights, unique_id)

Calculates the range of values within neighbours defined in spatial_weights.

Shannon(gdf, values, spatial_weights, unique_id)

Calculates the Shannon index of values within neighbours defined in spatial_weights.

Simpson(gdf, values, spatial_weights, unique_id)

Calculates the Simpson's diversity index of values within neighbours defined in spatial_weights.

Theil(gdf, values, spatial_weights, unique_id)

Calculates the Theil measure of inequality of values within neighbours defined in spatial_weights.

Unique(gdf, values, spatial_weights, unique_id)

Calculates the number of unique values within neighbours defined in spatial_weights.

spatial weights#

DistanceBand(gdf, threshold[, centroid, ids])

On demand distance-based spatial weights-like class.

sw_high(k[, gdf, weights, ids, contiguity, ...])

Generate spatial weights based on Queen or Rook contiguity of order k.

preprocessing#

preprocess(buildings[, size, compactness, ...])

Preprocesses building geometry to eliminate additional structures being single features.

utilities#

limit_range(vals, rng)

Extract values within selected range.

unique_id(objects)

Add an attribute with a unique ID to each row of a GeoDataFrame.