Summarise Layers and Geometry Types in a Spatial Data Source
Source:R/ngr_spk_layer_info.R
ngr_spk_layer_info.RdExtracts and summarises information about layers within a spatial vector data source. Attempts to determine the geometry type of each layer by querying a sample feature.
Arguments
- path
character A single string. Path to the vector spatial data source (e.g., a GeoPackage or shapefile).
Value
data.frame A data frame of available layers and their geometry types.
If a layer contains no geometry, or an error occurs during reading, the geomtype will be NA.
Details
Uses sf::st_layers() to list available layers in the data source.
For each layer, attempts to read a single feature using an SQL query and determines the geometry type using sf::st_geometry_type().
Layers with no geometry or errors in reading are safely assigned NA.
The driver column is removed from the output as it may contain invalid entries for further data frame operations.