Interface {mgpStreamingSDK}R Documentation

Interface

Description

Interface

Interface

Details

Interface class for interacting with WMS, WFS, and WMTS Streaming classes. This class provides a unified interface to access the WMS, WFS, and WMTS Streaming classes.

The 'search' function performs a search for features within the specified bounding box and/or with a specified filter.

Public fields

mgp_sdk

(Optional) An instance of the MGP_SDK Python library. If NULL, a new instance will be created. Default is NULL.

py_interface

(Optional) An instance of the Interface class from the MGP_SDK Python library. If NULL, a new instance will be created. Default is NULL.

env_name

= (Optional) The name of the environment where the MGP_SDK Python library is installed. Default is "R-MGP-SDK".

Methods

Public methods


Method new()

Initializes the 'Interface' object. Sets up the environment for using the MGP_SDK Python library.

Usage
Interface$new(mgp_sdk = NULL, py_interface = NULL, env_name = "R-MGP-SDK")
Arguments
mgp_sdk

(Optional) An instance of the MGP_SDK Python library. If NULL, a new instance will be created. Default is NULL.

py_interface

(Optional) An instance of the Interface class from the MGP_SDK Python library. If NULL, a new instance will be created. Default is NULL.

env_name

(Optional) The name of the environment where the MGP_SDK Python library is installed. Default is "R-MGP-SDK".


Method search()

Perform a search for features within the specified bounding box and/or with a specified filter.

Usage
Interface$search(
  bbox = NULL,
  filter = NULL,
  shapefile = FALSE,
  csv = FALSE,
  ...
)
Arguments
bbox

A string indicating the bounding box of the area of interest (miny,minx,maxy,maxx).

filter

A string containing a CQL filter used to refine the data of the search. Default is NULL.

shapefile

A logical indicating whether to return a shapefile. Default is FALSE.

csv

A logical indicating whether to return a CSV file. Default is FALSE.

...

Additional arguments to pass to the 'search' method.

Returns

If 'shapefile' is TRUE, the function returns a shapefile of all features and associated metadata. If 'csv' is TRUE, the function returns a CSV file. If neither is specified, the function returns a list of features.


Method download_image()

Download an image from a WMS or WMTS service

This function allows you to download an image from a Web Map Service (WMS) or a

Web Map Tile Service (WMTS). You can specify the bounding box, image dimensions, image

format, and other parameters to customize the downloaded image.

Usage
Interface$download_image(
  bbox = NULL,
  srsname = "EPSG:4326",
  height = NULL,
  width = NULL,
  img_format = "jpeg",
  identifier = NULL,
  zoom_level = NULL,
  download = TRUE,
  outputpath = NULL,
  display = FALSE
)
Arguments
bbox

A vector of four numeric values specifying the bounding box of the image.

srsname

A string specifying the spatial reference system (SRS) of the bounding box. Default is "EPSG:4326".

height

The height of the image in pixels.

width

The width of the image in pixels.

img_format

A string specifying the image format. Must be one of "jpeg", "png", or "geotiff".

identifier

A string specifying the identifier of the image.

zoom_level

An integer specifying the zoom level of the WMTS image.

download

A logical value indicating whether to download the image (TRUE) or return the raw image data (FALSE).

outputpath

A string specifying the directory where the downloaded image should be saved.

display

A logical value indicating whether to display the downloaded image (TRUE) or not (FALSE).

gridoffsets

A vector of two numeric values specifying the grid offsets of the image.

...

Additional parameters to be passed to the WMS or WMTS service.

Returns

If 'download' is TRUE, the function returns the filename of the downloaded image. If 'download' is FALSE, the function returns the raw image data as a binary vector.


Method get_full_res_image()

This function is a wrapper for a Python function that retrieves full resolution images.

The function downloads an image with the specified feature ID and additional parameters.

Usage
Interface$get_full_res_image(
  featureid,
  thread_number = 100,
  bbox = NULL,
  mosaic = FALSE,
  srsname = "EPSG:4326",
  outputdirectory = getwd(),
  image_format = "jpeg",
  filename = "Maxar_Download"
)
Arguments
featureid

A character string representing the unique ID of the feature for which the image is required.

thread_number

An integer indicating the number of threads to use for the download process. Default is 100.

bbox

A character string representing the bounding box coordinates in the format 'xmin, ymin, xmax, ymax'. If NULL, the bounding box will be determined based on the feature ID. Default is NULL.

mosaic

A logical value indicating whether to mosaic the images or not. If TRUE, images covering the defined area will be combined into a single image. Default is FALSE.

srsname

A character string representing the spatial reference system to be used for the image. Default is 'EPSG:4326'.

outputdirectory

A character string representing the directory where the image should be saved. If NULL, the image will be saved in the current working directory. Default is NULL.

image_format

A character string representing the format of the image file to be downloaded. Default is 'jpeg'.

filename

A character string representing the name of the file to be saved. Default is "Maxar_Download".

Returns

The function returns the result of the Python function call. The nature of this result depends on the Python function implementation.


Method clone()

The objects of this class are cloneable with this method.

Usage
Interface$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


[Package mgpStreamingSDK version 0.2.0 Index]