shapefile_measures {pliman}R Documentation

Extract geometric measures from a shapefile object

Description

shapefile_measures() calculates key geometric measures such as the number of points, area, perimeter, width, height, and centroid coordinates for a given shapefile (polygon) object.

Usage

shapefile_measures(shapefile)

Arguments

shapefile

An sf object representing the shapefile. It should contain polygonal geometries for which the measures will be calculated.

Details

This function processes a single or multi-polygon sf object and computes geometric properties. It calculates distances between points, extracts the centroid coordinates, and computes the area and perimeter of the polygons. The width and height are derived from sequential distances between points.

Value

A modified sf object with added columns for:

Examples

if (interactive() && requireNamespace("EBImage")) {
library(pliman)

path_shp <- paste0(image_pliman(), "/soy_shape.rds")
shp <- shapefile_input(path_shp)
shapefile_measures(shp)
}



[Package pliman version 3.0.0 Index]