sp_reset_feature_ids: Function to reset spatial object's feature IDs.

View source: R/sp_reset_feature_ids.R

sp_reset_feature_idsR Documentation

Function to reset spatial object's feature IDs.

Description

sp_reset_feature_ids will reset the feature IDs in a spatial object to sequential integers (beginning at 1), but these will be stored as a characters. If the spatial object has a data slot, the row names of the data frame will also be reset.

Usage

sp_reset_feature_ids(sp)

Arguments

sp

A spatial object. sp can also be a list containing many spatial objects.

Value

Spatial object.

Author(s)

Stuart K. Grange

Examples

## Not run: 

# Load data
sp_zones <- sp_read("zones.json")

# Filter
sp_zones <- subset(sp_zones, country == "DE")

# Reset feature ids
sp_zones <- sp_reset_feature_ids(sp_zones)


## End(Not run)


skgrange/gissr documentation built on June 20, 2024, 12:02 a.m.