Registry / data / momepy

momepy

JSON →
library0.11.0pypypi✓ verified 84d ago

Urban Morphology Measuring Toolkit (momepy) is a Python library for measuring and analyzing urban morphology. Current version is 0.11.0, requiring Python >=3.11. Releases are roughly quarterly, with a focus on GIS integration via GeoPandas and libpysal.

pip install momepy
INSTALL
IMPORT
SIG · MOMEPY
M
momepy
datapythonv0.11.0
Install
18.4s avg
Import
5888ms
Disk
523MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 18.4s · import 5.888s · 521MB
523MB installed
● package 523MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

momepy
import momepy
import momepy as mp
While common, momepy does not export a top-level 'mp' alias; use 'momepy' directly or import submodules.
momepy.Continuity
from momepy import Continuity
from momepy.continuity import Continuity
As of v0.11.0, Continuity is a class directly in the top-level namespace; the submodule is not public.
momepy.morphological_tessellation
from momepy import morphological_tessellation
import momepy.morphological_tessellation
Functions are accessible via momepy.function_name, not as a submodule.
momepy.Streetscape
from momepy import Streetscape
import momepy.Streetscape
Streetscape is a class, imported directly from momepy.

This quickstart loads a sample dataset, generates a morphological tessellation (Voronoi-like cells from building footprints), and calculates the area of each cell.

import geopandas as gpd import momepy # Load sample buildings from momepy buildings = gpd.read_file(momepy.datasets.get_path('bubenec')) # Generate morphological tessellation tessellation = momepy.morphological_tessellation(buildings) # Compute area of tessellation cells tessellation['area'] = tessellation.geometry.area print(tessellation.head())
Debug
Known issues
breakingIn v0.8.0, the core measurement classes were replaced with functions that depend on libpysal.Graph. Old code using classes like `momepy.Area` or `momepy.Compactness` will break.
fix
Migrate to the new functional API. See migration guide: http://docs.momepy.org/en/latest/user_guide/migration.html
affects: <0.8.0
deprecatedDeprecation of preprocessing tooling (e.g., `remove_false_nodes`, `close_gaps`) in v0.11.0; these will be removed before 1.0.
fix
Use alternative approaches: for false nodes, consider using `libpysal.graph.remove_false_nodes`; for gap closing, handle with shapely directly.
affects: >=0.11.0
gotchamomepy functions often return a new GeoDataFrame with a new index; do not assume the original index is preserved. Always join or map back using the geometry or original ID column.
fix
If preserving original IDs, ensure your input data has a unique ID column (e.g., 'ID') and use that for merging after momepy operations.
affects: all
gotchamomepy requires input geodataframes to have a 'geometry' column with a valid CRS and that all geometries are in the same projection (usually projected CRS, not lonlat). Missing CRS or geographic CRS can cause errors or nonsensical results.
fix
Use `gdf.to_crs(epsg=3857)` (or appropriate local UTM) before passing to momepy functions.
affects: all
breakingPython 3.11 or higher is required as of v0.11.0; earlier versions (3.10, 3.9) are no longer supported.
fix
Upgrade Python to 3.11 or newer.
affects: >=0.11.0
deprecatedThe old `momepy.graph` and `momepy.network` modules are deprecated in favor of libpysal.Graph-based analysis introduced in v0.8.0.
fix
Use `libpysal.graph.Graph` and the new graph-related momepy functions like `momepy.node_degree`.
affects: <0.8.0
gotchaWhen using `momepy.Streetscape`, missing values in OSM queries are treated as 0 in averaging, which can bias results. Check v0.9.1 release note: 'Get mean of actual values (do not imply missing == 0)' was a bug that may reappear if old code is used.
fix
If using streetscape, ensure you are on latest version and verify handling of missing values.
affects: >=0.9.1
Errors
Common errors & fixes
AttributeError: module 'momepy' has no attribute 'Area'
The old class-based API was replaced with functions in v0.8.0.
fix
Use `momepy.area(tessellation)` instead of `momepy.Area(tessellation).`
TypeError: morphological_tessellation() got an unexpected keyword argument 'simplify'
The `simplify` keyword was added in v0.10.0. Older versions do not have it.
fix
Upgrade momepy to v0.10.0 or later: `pip install momepy>=0.10.0`
ValueError: CRS is not set. Please set a CRS on the GeoDataFrame.
momepy functions require a valid CRS; input had no CRS.
fix
Set CRS: `gdf.set_crs(epsg=4326, inplace=True)` before passing to momepy.
ImportError: cannot import name 'Continuity' from 'momepy'
Continuity was added in v0.11.0. Older versions do not have it.
fix
Upgrade to v0.11.0: `pip install -U momepy`. Then use `from momepy import Continuity`.
UserWarning: Geodataframe has no CRS. Assuming EPSG:3857.
CRS is missing and momepy defaults to Web Mercator; results may be incorrect if input is in a different CRS.
fix
Explicitly set CRS on input: `gdf = gdf.set_crs(epsg=4326).to_crs(epsg=3857)`.
Upgrade
Version history
0.11.0latest on PyPI · released Dec 23, 2025
Audit
Dependencies
libpysalrequiredCore dependency for spatial graph (Graph) and weights
geopandasrequiredGeometry and spatial data handling
networkxrequiredNetwork representation for street networks
numpyrequiredArray operations and numerical calculations
tqdmrequiredProgress bars for long-running operations
pandasrequiredDataFrame manipulation of results
shapelyrequiredGeometric operations on shapes
Agent activity
2 hits · last 30 days
node
2
Resources