{"id":23129,"library":"momepy","title":"momepy","description":"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.","status":"active","version":"0.11.0","language":"python","source_language":"en","source_url":"https://github.com/pysal/momepy","tags":["urban morphology","GIS","geospatial","measurement","street network"],"install":[{"cmd":"pip install momepy","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Core dependency for spatial graph (Graph) and weights","package":"libpysal","optional":false},{"reason":"Geometry and spatial data handling","package":"geopandas","optional":false},{"reason":"Network representation for street networks","package":"networkx","optional":false},{"reason":"Array operations and numerical calculations","package":"numpy","optional":false},{"reason":"Progress bars for long-running operations","package":"tqdm","optional":false},{"reason":"DataFrame manipulation of results","package":"pandas","optional":false},{"reason":"Geometric operations on shapes","package":"shapely","optional":false}],"imports":[{"note":"While common, momepy does not export a top-level 'mp' alias; use 'momepy' directly or import submodules.","wrong":"import momepy as mp","symbol":"momepy","correct":"import momepy"},{"note":"As of v0.11.0, Continuity is a class directly in the top-level namespace; the submodule is not public.","wrong":"from momepy.continuity import Continuity","symbol":"momepy.Continuity","correct":"from momepy import Continuity"},{"note":"Functions are accessible via momepy.function_name, not as a submodule.","wrong":"import momepy.morphological_tessellation","symbol":"momepy.morphological_tessellation","correct":"from momepy import morphological_tessellation"},{"note":"Streetscape is a class, imported directly from momepy.","wrong":"import momepy.Streetscape","symbol":"momepy.Streetscape","correct":"from momepy import Streetscape"}],"quickstart":{"code":"import geopandas as gpd\nimport momepy\n\n# Load sample buildings from momepy\nbuildings = gpd.read_file(momepy.datasets.get_path('bubenec'))\n\n# Generate morphological tessellation\ntessellation = momepy.morphological_tessellation(buildings)\n\n# Compute area of tessellation cells\ntessellation['area'] = tessellation.geometry.area\nprint(tessellation.head())","lang":"python","description":"This quickstart loads a sample dataset, generates a morphological tessellation (Voronoi-like cells from building footprints), and calculates the area of each cell."},"warnings":[{"fix":"Migrate to the new functional API. See migration guide: http://docs.momepy.org/en/latest/user_guide/migration.html","message":"In 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.","severity":"breaking","affected_versions":"<0.8.0"},{"fix":"Use alternative approaches: for false nodes, consider using `libpysal.graph.remove_false_nodes`; for gap closing, handle with shapely directly.","message":"Deprecation of preprocessing tooling (e.g., `remove_false_nodes`, `close_gaps`) in v0.11.0; these will be removed before 1.0.","severity":"deprecated","affected_versions":">=0.11.0"},{"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.","message":"momepy 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `gdf.to_crs(epsg=3857)` (or appropriate local UTM) before passing to momepy functions.","message":"momepy 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade Python to 3.11 or newer.","message":"Python 3.11 or higher is required as of v0.11.0; earlier versions (3.10, 3.9) are no longer supported.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Use `libpysal.graph.Graph` and the new graph-related momepy functions like `momepy.node_degree`.","message":"The old `momepy.graph` and `momepy.network` modules are deprecated in favor of libpysal.Graph-based analysis introduced in v0.8.0.","severity":"deprecated","affected_versions":"<0.8.0"},{"fix":"If using streetscape, ensure you are on latest version and verify handling of missing values.","message":"When 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.","severity":"gotcha","affected_versions":">=0.9.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `momepy.area(tessellation)` instead of `momepy.Area(tessellation).`","cause":"The old class-based API was replaced with functions in v0.8.0.","error":"AttributeError: module 'momepy' has no attribute 'Area'"},{"fix":"Upgrade momepy to v0.10.0 or later: `pip install momepy>=0.10.0`","cause":"The `simplify` keyword was added in v0.10.0. Older versions do not have it.","error":"TypeError: morphological_tessellation() got an unexpected keyword argument 'simplify'"},{"fix":"Set CRS: `gdf.set_crs(epsg=4326, inplace=True)` before passing to momepy.","cause":"momepy functions require a valid CRS; input had no CRS.","error":"ValueError: CRS is not set. Please set a CRS on the GeoDataFrame."},{"fix":"Upgrade to v0.11.0: `pip install -U momepy`. Then use `from momepy import Continuity`.","cause":"Continuity was added in v0.11.0. Older versions do not have it.","error":"ImportError: cannot import name 'Continuity' from 'momepy'"},{"fix":"Explicitly set CRS on input: `gdf = gdf.set_crs(epsg=4326).to_crs(epsg=3857)`.","cause":"CRS is missing and momepy defaults to Web Mercator; results may be incorrect if input is in a different CRS.","error":"UserWarning: Geodataframe has no CRS. Assuming EPSG:3857."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}