glance {ursa} | R Documentation |
Command line utility for spatial view of raster or vector GIS file.
Description
glance
is a parser of command line arguments for non-public function .glance
, which creates multi-panel plots for each attribute of vector file or for each band of raster file.
Usage
glance(...)
# non-public
.glance(dsn, layer = ".*", grid = NULL, field = ".+", size = NA, expand = 1,
border = 27, lat0 = NA, lon0 = NA, resetProj = FALSE, resetGrid = FALSE,
style = "auto", feature = c("auto", "field", "geometry"), alpha = NA,
basemap.order = c("after", "before"), basemap.alpha = NA,
engine = c("native", "sp", "sf"), geocode = "", place="",
area = c("bounding", "point", "shape"), zoom = NA, gdal_rasterize = FALSE,
silent = FALSE, verbose = FALSE, ...)
Arguments
dsn |
Character or object of either |
layer |
Character or integer. If integer, then layer index. If character, then pattern (regular expressions) to recognize layer by name. Only one layer selection is allowed. If selected more then one layer, the error message contains indices and names of layers. Usually, datasets (e. g., "ESRI Shapefile") have only one layer. Default is |
grid |
Object of class |
field |
Character. Pattern for field (attribute, column,...) selection by name using regular expressions. Multiple selection is allowed. Default is |
size |
Integer of length 1 or 2 or character of length 1. Size of plotting panel in pixels. If character, then parsed to integer of length 1 or 2. Length 2 is used only for web cartography. If length 1, then |
expand |
Numeric. Multiplier for plotting panel zoom in relation to extent of plotting geometry. Default is |
border |
Integer. Value in pixels of fixed margins around plotting geometry. Default is |
lat0 |
Numeric. Parallel os zero distortion. If |
lon0 |
Numeric. Central meridian, which have vertical direction on the plot. If |
resetProj |
Logical. Value |
resetGrid |
Logical. If |
style |
Character. Either projection class or source of web-catrogrpaphy for basemap. Specified by a sentence of words separated by spaces.
Keywords |
feature |
Character. Appearance of visualization. If |
basemap.order |
Character. The order of basemap layer rendering in the case of web-cartography basemap.If |
basemap.alpha |
Character. The saturation of basemap in the case of web-cartography basemap. Default is |
alpha |
Character. The opacity of plotted object. Default is |
engine |
Character keyword. Forcing to vector files processing by functions from package sp ( |
geocode |
Character. Keyword for geocode service. Valid values are |
place |
Character. Type of geographical object (river, island) in the geocoding request. If |
area |
Character. Keyword of spatial class of geocoded object. |
zoom |
Positive integer or character. Zooming if web-cartography is applied for basemap. If integer, then value of zoom for tile services and staticmap. If character, then |
gdal_rasterize |
Logical. If |
silent |
Logical. Value |
verbose |
Logical. Logical. Value |
... |
|
Details
Command line usage implies set of arguments using pair: argument name
and argument value
. and values in the format "[name1=]value1 [name2]=value2
". No spaces around =
(equal symbol). Argument name
can be omitted, symbol =
is omitted too. If argument value
has spaces, then argument value should be surrounded by double quotes (fname="my test.shp"
). If argument value
is matched to R function, then such value should be surrounded by single quotes (layer='density'
).
Command line usage example: Rscript -e ursa::glance() 'final_more_than_032.sqlite' attr="select" resetProj=TRUE expand=1.5
For OS Windows, bat-file can be created for raster and vector file association:
Rscript -e ursa::glance() %*
Command line usage implies external software for PNG view session_pngviewer(TRUE)
.
Value
glance
returns integer: 0L
- successful, 10L
- call without arguments.
Note
Package sf is 'Suggested' for package ursa.
Author(s)
Nikita Platonov platonov@sevin.ru
Examples
session_grid(NULL)
f <- system.file("shape/nc.shp",package="sf")
glance(f,style="merc",field="(NAME|AREA|COUNT)")
cmd <- paste("Rscript --vanilla -e ursa::glance()",paste0("\"",f,"\"")
,"style=\"merc\"","field=\"(lon|lat)\"")
cat(" --------- Try in command line: -----------\n")
message(cmd)
cat(" ----------- end of quoting ---------------\n")
## windows: figure will be opened using *.png file association
try(system(cmd,wait=FALSE))
if (isSP <- require(sp)) {
a <- data.frame(lat=c(70.734,71.657),lon=c(178.577,-177.38),place="Wrangel Island")
coordinates(a) <- ~lon+lat
proj4string(a) <- "EPSG:4326"
}
## internet connection is required
if (isSP)
glance(a,style="google color maptype=terrain")
## internet connection is required
if (isSP)
glance(a,style="Positron",border=0)
## internet connection is required
if (isSP)
glance(a,style="mapnik color tile",border=0)
## internet connection is required
if (isSP)
glance("Svalbard",resetGrid=TRUE)