@@ -530,9 +530,11 @@ def geometry_area_perimeter(
530
530
531
531
.. note:: lats should be in the range [-90 deg, 90 deg].
532
532
533
- .. warning:: The area returned is signed with counter-clockwise traversal being
534
- treated as positive. You can use `shapely.ops.orient` to modify the
535
- orientation.
533
+ .. warning:: The area returned is signed with counter-clockwise (CCW) traversal
534
+ being treated as positive. For polygons, holes should use the
535
+ opposite traversal to the exterior (if the exterior is CCW, the
536
+ holes/interiors should be CW). You can use `shapely.ops.orient` to
537
+ modify the orientation.
536
538
537
539
If it is a Polygon, it will return the area and exterior perimeter.
538
540
It will subtract the area of the interior holes.
@@ -548,13 +550,13 @@ def geometry_area_perimeter(
548
550
>>> poly_area, poly_perimeter = geod.geometry_area_perimeter(
549
551
... Polygon(
550
552
... LineString([
551
- ... Point(1, 1), Point(1, 10 ), Point(10, 10), Point(10, 1 )
553
+ ... Point(1, 1), Point(10, 1 ), Point(10, 10), Point(1, 10 )
552
554
... ]),
553
555
... holes=[LineString([Point(1, 2), Point(3, 4), Point(5, 2)])],
554
556
... )
555
557
... )
556
558
>>> f"{poly_area:.3f} {poly_perimeter:.3f}"
557
- '- 944373881400.339 3979008.036'
559
+ '944373881400.339 3979008.036'
558
560
559
561
560
562
Parameters
@@ -583,7 +585,7 @@ def geometry_area_perimeter(
583
585
# subtract area of holes
584
586
for hole in geometry .interiors :
585
587
area , _ = self .geometry_area_perimeter (hole , radians = radians )
586
- total_area - = area
588
+ total_area + = area
587
589
return total_area , total_perimeter
588
590
# multi geometries
589
591
elif hasattr (geometry , "geoms" ):
0 commit comments