14
14
from tqdm .auto import tqdm
15
15
16
16
from .shape import _circle_radius
17
+ from .utils import deprecated , removed
17
18
18
19
GPD_GE_10 = Version (gpd .__version__ ) >= Version ("1.0dev" )
19
20
34
35
]
35
36
36
37
38
+ @removed ("`.area` attribute of a GeoDataFrame" )
37
39
class Area :
38
40
"""
39
41
Calculates the area of each object in a given GeoDataFrame. It can be used for any
@@ -63,11 +65,11 @@ class Area:
63
65
"""
64
66
65
67
def __init__ (self , gdf ):
66
- # TODO: deprecate and point people to .area
67
68
self .gdf = gdf
68
69
self .series = self .gdf .geometry .area
69
70
70
71
72
+ @removed ("`.length` attribute of a GeoDataFrame" )
71
73
class Perimeter :
72
74
"""
73
75
Calculates perimeter of each object in a given GeoDataFrame. It can be used for any
@@ -96,11 +98,11 @@ class Perimeter:
96
98
"""
97
99
98
100
def __init__ (self , gdf ):
99
- # TODO: deprecate and point people to .length
100
101
self .gdf = gdf
101
102
self .series = self .gdf .geometry .length
102
103
103
104
105
+ @deprecated ("volume" )
104
106
class Volume :
105
107
"""
106
108
Calculates the volume of each object in a
@@ -145,7 +147,6 @@ class Volume:
145
147
"""
146
148
147
149
def __init__ (self , gdf , heights , areas = None ):
148
- # TODO: deprecate in favor of volume
149
150
self .gdf = gdf
150
151
151
152
gdf = gdf .copy ()
@@ -170,6 +171,7 @@ def __init__(self, gdf, heights, areas=None):
170
171
) from err
171
172
172
173
174
+ @deprecated ("floor_area" )
173
175
class FloorArea :
174
176
"""
175
177
Calculates floor area of each object based on height and area. The number of
@@ -218,7 +220,6 @@ class FloorArea:
218
220
"""
219
221
220
222
def __init__ (self , gdf , heights , areas = None ):
221
- # TODO: deprecate in favor of floor_area
222
223
self .gdf = gdf
223
224
224
225
gdf = gdf .copy ()
@@ -243,6 +244,7 @@ def __init__(self, gdf, heights, areas=None):
243
244
) from err
244
245
245
246
247
+ @deprecated ("courtyard_area" )
246
248
class CourtyardArea :
247
249
"""
248
250
Calculates area of holes within geometry - area of courtyards.
@@ -292,6 +294,7 @@ def __init__(self, gdf, areas=None):
292
294
self .series = pd .Series (exts - gdf [areas ], index = gdf .index )
293
295
294
296
297
+ @deprecated ("longest_axis_length" )
295
298
class LongestAxisLength :
296
299
"""
297
300
Calculates the length of the longest axis of object. Axis is defined as a
@@ -321,12 +324,12 @@ class LongestAxisLength:
321
324
"""
322
325
323
326
def __init__ (self , gdf ):
324
- # TODO: deprecate in favor of longest_axis_length
325
327
self .gdf = gdf
326
328
hulls = gdf .geometry .convex_hull .exterior
327
329
self .series = hulls .apply (lambda g : _circle_radius (list (g .coords ))) * 2
328
330
329
331
332
+ @deprecated ("describe" )
330
333
class AverageCharacter :
331
334
"""
332
335
Calculates the average of a character within a set
@@ -407,7 +410,6 @@ def __init__(
407
410
mode = "all" ,
408
411
verbose = True ,
409
412
):
410
- # TODO: deprecate in favor of momepy.describe
411
413
self .gdf = gdf
412
414
self .sw = spatial_weights
413
415
self .id = gdf [unique_id ]
@@ -862,6 +864,7 @@ def __init__(self, gdf, spatial_weights, unique_id, verbose=True):
862
864
self .series = pd .Series (results_list , index = gdf .index )
863
865
864
866
867
+ @deprecated ("perimeter_wall" )
865
868
class PerimeterWall :
866
869
"""
867
870
Calculate the perimeter wall length of the joined structure.
@@ -901,7 +904,6 @@ class PerimeterWall:
901
904
"""
902
905
903
906
def __init__ (self , gdf , spatial_weights = None , verbose = True ):
904
- # TODO: deprecate in favor of perimeter_wall
905
907
self .gdf = gdf
906
908
907
909
if spatial_weights is None :
0 commit comments