File: api.rst

package info (click to toggle)
python-momepy 0.8.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 51,428 kB
  • sloc: python: 11,098; makefile: 35; sh: 11
file content (212 lines) | stat: -rw-r--r-- 4,152 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.. _api_ref:

.. automodule:: momepy

.. currentmodule:: momepy

momepy API reference
======================

The current version of momepy includes two implementations of most of the functionality
due to the ongoing migration period moving from the legacy class-based API to a new
function-based API. This page outlines the stable API. For the legacy functionality, see
:doc:`Legacy API  <legacy_api>`.

Managing morphological elements
-------------------------------
.. _elements:

Momepy allows creation of a small subset of bespoke morphological geometric features.

.. autosummary::
   :toctree: api/

   morphological_tessellation
   enclosed_tessellation
   enclosures
   generate_blocks

Additionally, it contains tools supporting these.

.. autosummary::
   :toctree: api/

   buffered_limit
   verify_tessellation

And tools linking various elements together.

.. autosummary::
   :toctree: api/

   get_nearest_street
   get_nearest_node
   get_network_ratio

Measuring dimension
-------------------

A set of functions to measure dimensions of geometric elements:

.. autosummary::
   :toctree: api/

   courtyard_area
   floor_area
   longest_axis_length
   perimeter_wall
   street_profile
   volume
   weighted_character

Measuring shape
---------------

A set of functions to measure shape of geometric elements:

.. autosummary::
   :toctree: api/

   centroid_corner_distance
   circular_compactness
   compactness_weighted_axis
   convexity
   corners
   courtyard_index
   elongation
   equivalent_rectangular_index
   facade_ratio
   form_factor
   fractal_dimension
   linearity
   rectangularity
   shape_index
   square_compactness
   squareness

Measuring spatial distribution
------------------------------

A set of functions to measure spatial distribution of geometric elements:

.. autosummary::
   :toctree: api/

   alignment
   building_adjacency
   cell_alignment
   mean_interbuilding_distance
   neighbor_distance
   neighbors
   orientation
   shared_walls
   street_alignment

Measuring intensity
-------------------

A set of functions to measure intensity characters:

.. autosummary::
   :toctree: api/

   courtyards

Note that additional intensity characters can be directly derived using :meth:`libpysal.graph.Graph.describe`
and functions :func:`describe_agg` and :func:`describe_reached_agg`.


Measuring diversity
-------------------

A set of functions to measure spatial diversity of elements and their values:

.. autosummary::
   :toctree: api/

   describe_agg
   describe_reached_agg
   gini
   percentile
   shannon
   simpson
   theil
   values_range
   mean_deviation

Note that additional diversity characters can be directly derived using :meth:`libpysal.graph.Graph.describe`.

Underlying components of :func:`shannon` and :func:`simpson` are also exposed for direct use:


.. autosummary::
   :toctree: api/

   shannon_diversity
   simpson_diversity

Measuring connectivity
----------------------

A set of functions for the analysis of connectivity and configuration of street networks:

.. autosummary::
   :toctree: api/

   betweenness_centrality
   cds_length
   closeness_centrality
   clustering
   cyclomatic
   edge_node_ratio
   gamma
   mean_node_degree
   mean_node_dist
   mean_nodes
   meshedness
   node_degree
   node_density
   proportion
   straightness_centrality
   subgraph
   COINS

With utilities allowing conversion between networkx objects and GeoPandas objects.

.. autosummary::
   :toctree: api/

   gdf_to_nx
   nx_to_gdf

Data preprocessing
------------------

Most of the algorithms have certain expectations about the quality of input data. The
`preprocessing` module helps adapting the input data and fixing common issues.

.. autosummary::
   :toctree: api/

   close_gaps
   extend_lines
   remove_false_nodes
   consolidate_intersections
   roundabout_simplification

Additionally, there are methods for data assessment.

.. autosummary::
   :toctree: api/

   CheckTessellationInput
   FaceArtifacts


Further analysis can be done directly using methods available in :class:`libpysal.graph.Graph`.

.. toctree::
   :maxdepth: 1
   :hidden:

   legacy_api