View source: R/vapour_input_geometry.R
vapour_layer_info | R Documentation |
Read GDAL layer information for a vector data source.
vapour_layer_info(
dsource,
layer = 0L,
sql = "",
extent = NA,
count = TRUE,
...
)
dsource |
data source name (path to file, connection string, URL) |
layer |
integer of layer to work with, defaults to the first (0) or the name of the layer |
sql |
if not empty this is executed against the data source (layer will be ignored) |
extent |
apply an arbitrary extent, only when 'sql' used (must be 'ex = c(xmin, xmax, ymin, ymax)' but sp bbox, sf bbox, and raster extent also accepted) |
count |
logical to control if count calculated and returned, TRUE by default (set to FALSE to avoid the extra calculation and missing value is the result) |
... |
unused, reserved for future use |
Set extent
and/or count
to FALSE
to avoid calculating them if not needed, it might take some time.
The layer information elements are
the data source name
the short name of the driver used
the name of the layer queried
the name/s of all available layers (see vapour_layer_names)
a named vector of field types (see vapour_report_fields)
the number of features in this data source (can be turned off to avoid the extra work count
)
the extent of all features xmin, xmax, ymin, ymax (can be turned off to avoid the extra work extent
)
a list of character strings, see next
$projection
is a list of various formats of the projection metadata.
Use $projection$Wkt
as most authoritative, but we don't enter into the discussion or limit what
might be done with this (that's up to you). Currently we see
c("Proj4", "MICoordSys", "PrettyWkt", "Wkt", "EPSG", "XML")
as names of this $projection
element.
To get the geometry type/s of a layer see vapour_read_type()
.
list with a list of character vectors of projection metadata, see details
vapour_geom_name vapour_layer_names vapour_report_fields vapour_read_fields vapour_driver vapour_read_names
file <- "list_locality_postcode_meander_valley.tab"
## A MapInfo TAB file with polygons
mvfile <- system.file(file.path("extdata/tab", file), package="vapour")
info <- vapour_layer_info(mvfile)
names(info$projection)
## info depends on the query/spatial-filter
vapour_layer_info(mvfile, extent = c(412000, 420000, 5352612.8, 5425154.3),
sql = "SELECT * FROM list_locality_postcode_meander_valley")$count
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.