vector_vrt | R Documentation |
Just a simple text generator to generate the VRT for a vector layer, First layer is chosen if not otherwise specified.
vector_vrt(x, layer = 1L, projection = NULL, sql = NULL, a_srs = NULL)
x |
data source name |
layer |
layer index (1-based) or name |
projection |
crs of the output |
sql |
SQL for ExecuteSQL to define the layer |
a_srs |
set the source crs |
Using 'sql' overrides the 'layer', and using 'projection' results in the geometries being transformed. No check is made of the layer source projection.
Use 'a_srs' to ensure the source has a source crs (that might be the only thing you use this for, even if not reprojecting).
It's expected that if you use this with a source without a source projection, you'll get "Failed to import source SRS", so use argument "a_srs" to set it if needed (or many other GDAL other facilities that do this).
single element character vector
file <- "list_locality_postcode_meander_valley.tab"
## A MapInfo TAB file with polygons
mvfile <- system.file(file.path("extdata/tab", file), package="vapour")
vector_vrt(mvfile, sql = "SELECT * FROM list_locality_postcode_meander_valley LIMIT 5 OFFSET 4")
## read this with vapour_read_geometry() and it will be projected to VicGrid
vector_vrt(mvfile, projection = "EPSG:3111")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.