esda.shape.moment_of_inertia_global¶
-
esda.shape.moment_of_inertia_global(collection, normalize=
False, ref_pt=None)[source]¶ Compute moment of inertia (second moment of area) for an entire collection of geometries combined.
- Parameters:¶
- collection : GeoSeries, GeoDataFrame, numpy.ndarray, list¶
Input collection of polygons or multipolygons.
- normalize : bool, optional¶
If True, returns moment normalized by reference circle of same area. Default is False.
- ref_pt : GeoSeries, Shapely Point, or array-like of shape (2,), optional¶
If provided, shifts moment to be with respect to this point. The default behavior (default:
None) is to calculate the moment about the centroid of the entire collection. Point may be passed as array-like of coordinates or a point geometry (which can include a GeoSeries of length 1). To return moment about the origin, explicitly set to (0, 0).
- Returns:¶
Moment of inertia for the entire collection.
- Return type:¶
Notes
This is a convenience function to calculate the second moment of area for an entire collection, which will usually be faster than running a geospatial dissolve on the geometries and then running moment_of_inertia on the result.
This will not calculate a mass moment of inertia. To calculate the mass moment of inertia for an entire collection, weighted by the masses of the geometries in the collection, assign all geometries to the same region:
moment_of_inertia_regions( collection, regions=numpy.repeat(1, len(collection)), weights=<weights vector> )The normalize and ref_pt parameters may be used as usual.