- Methods:
- getRaster(raster_uuid)
- getRastersByIds(options)
- getRasterByName(name, user_id)
- getRasters(options)
- getRasterInfo(raster_uuid)
- getRasterPoint(raster_uuid, latitude, longitude)
- getRasterSettings(raster_uuid)
- setRasterSettings(raster_uuid, options )
- getRasterStatistics(raster_uuid)
- getRasterTilejson(raster_uuid)
- updateRaster(raster_uuid, options )
- deleteRaster(raster_uuid)
- seedCacheRaster(raster_uuid, options)
- getCacheSizeRaster(raster_uuid)
- clearCacheRaster(raster_uuid)
Methods:
getRaster(raster_uuid)
Returns the desired existing raster layer. This function is an asynchronous function.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Raster layer: Returns itself to allow for method chaining.
Example:
const rasterLayer = await Server.getRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
getRastersByIds(options)
Returns the desired existing raster layers. This function is an asynchronous function.
Parameters:
options (Object)
Name | Description |
---|---|
options.ids
Number | Array
|
Ids of raster layers. If you want a single raster layer, insert id as a string. |
options.user_id
Number?
|
If the admin wants to fetch raster layers of a certain user, this parameter determines which user is the target user. |
Returns:
Array: Returns an array of raster layers.
Example:
const rasterLayers = await Server.getRastersByIds({ 'ids': [25,125], 'user_id' :0 });
getRasterByName(name, user_id)
Returns the desired existing raster layer. This function is an asynchronous function.
Parameters:
name is the available raster layer name.
user_id is the id of the user that raster layer belongs to.
Returns:
Raster layer: Returns itself to allow for method chaining.
Example:
const rasterLayer = await Server.getRasterByName('city',2);
getRasters(options)
Returns the desired existing raster layers. This function is an asynchronous function.
Parameters:
options (Object)
Name | Description |
---|---|
options.f
String
defult: ‘json’
|
Output format. Choices are: ‘json’ | ‘html’ |
options.q
String?
|
Query filter based on OGC CQL standard. e.g. “field1 LIKE ‘%GIS%’ AND created_at > ‘2021-01-01′” |
options.search
String?
|
Search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value. NOTE: if q param is defined this param will be ignored. |
options.search_fields
String?
|
Comma separated list of fields for searching |
options.order_by
String?
|
Comma seperated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D NOTE: “A” denotes ascending order and “D” denotes descending order. |
options.skip
Number?
Default: 0
|
Number of skipped vector layer views. |
options.limit
Number?
Default:10
|
Maximum number for result vector layer views.. |
options.user_id
Number?
|
If the admin wants to fetch vector layer views of a certain user, this parameter determines which user is the target user. |
options.shared
Bolean
default: false
|
If true, returns only the vector layer views that are shared. |
options.page
Number?
Default:1
|
The minimum number of pages is 1. |
options.page_size
Number?
Default:10
|
The minimum number of maps on each page is 1. |
Returns:
Array: Returns an array of raster layers.
Example:
const rasterLayers = await Server.getRasters({q:`name = 'string'`,user_id :0});
getRasterInfo(raster_uuid)
Returns the desired existing raster layer information. This information includes extent and color bands of the raster layer.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Object: Returns an object that contains raster layer information.
Example:
const rasterLayerInfo = await Server.getRasterInfo('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
getRasterPoint(raster_uuid, latitude, longitude)
Returns the desired existing raster layer information in a point (in a pixel).
Parameters:
raster_uuid is the available raster layer uuid.
latitude and longitude are geographic coordinates of the point.
Returns:
Array: Returns an array that contains pixel information.
Example:
const pixelInfo = await Server.getRasterPoint('4f9f3e4b-4dc1-469b-83ab-00ae00f02581', 45, 32);
getRasterSettings(raster_uuid)
Returns the raster layer settings.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Object: Returns an object that contains raster layer settings.
Example:
const rasterLayerSettings = await Server.getRasterSettings('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
setRasterSettings(raster_uuid, options )
Updates the raster layer settings.
Parameters:
raster_uuid is the available raster layer uuid.
options (Object)
Name | Description |
---|---|
options.visual_settings
Object
|
An object contains visualization settings. See raster visualization for more guidance. e.g.:
{ 'nodata': null, 'indexes': [1], 'rescale': [[0,255]], 'colormap_name': null, 'colormap': null, 'color_formula': null, 'expression': null, 'exaggeration': 10 } |
options.tile_settings
Object
|
An object contains tiles settings. See raster visualization for more guidance. e.g.:
{ 'min_zoom': 0, 'max_zoom': 22, 'use_cache': true, 'cache_until_zoom': 17 } |
Returns:
Object: Returns an object that contains raster layer settings.
Example:
const rasterLayerSettings = await Server.setRasterSettings('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ 'visual_settings': { 'nodata': null, 'indexes': [1], 'rescale': [[0,255]], 'colormap_name': null, 'colormap': null, 'color_formula': null, 'expression': null, 'exaggeration': 10 }, 'tile_settings': { 'min_zoom': 0, 'max_zoom': 22, 'use_cache': true, 'cache_until_zoom': 17 } });
getRasterStatistics(raster_uuid)
Returns the statistical information of the raster layer.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Object: Returns an object that contains raster layer statistics information.
Example:
const rasterLayerStatistics = await Server.getRasterStatistics('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
getRasterTilejson(raster_uuid)
Returns raster layer tile information such as tile access address.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Object: Returns an object that contains information of raster layer tiles.
Example:
const rasterLayerTilejson = await Server.getRasterTilejson('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
updateRaster(raster_uuid, options )
Updates the existing raster layer.
Parameters:
raster_uuid is the available raster layer uuid.
options (Object)
Name | Description |
---|---|
options.name
String
|
Name of raster layer. |
options.display_name
String?
|
Display name of raster layer. This parameter is helpful in identifying raster layer easily. |
options.description
String?
|
Description of raster layer. |
Returns:
Raster layer: Returns itself to allow for method chaining.
Example:
const rasterLayer = await Server.updateRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ 'name': 'string', 'display_name': 'string', 'description': 'string' });
deleteRaster(raster_uuid)
Deletes the existing raster layer.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
String: Returns a message that shows deleting was successful or not. Null message means deleting was successful.
Example:
const result = await Server.deleteRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
seedCacheRaster(raster_uuid, options)
Generates and stores tiles for the existing raster layer. See generating and storing tiles for more guidance.
Parameters:
raster_uuid is the available raster layer uuid.
options (Object)
Name | Description |
---|---|
options.from_zoom
Number
|
from_zoom parameter is between 0 and 22. |
options.to_zoom
Number
|
to_zoom parameter is between 0 and 22. |
options.extent
Array
|
[southwest x, southwest y, northeast x, northeast y] |
options.workers
Number
|
Number of CPU cores. |
options.user_id
Number?
|
If the admin wants to build cache for a raster layer of a certain user, this parameter determines which user is the target user. |
Returns:
Object: Returns task id to manage task.
Example:
const taskId = await Server.seedCacheRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ 'from_zoom': 0, 'to_zoom': 2, 'extent': [51, 35, 52, 36], 'workers': 1, 'user_id': 2 })
getCacheSizeRaster(raster_uuid)
Returns the size of tiles generated and stored for raster layer in bytes.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
Number: Returns tiles size in byte.
Example:
const tilesSize = await Server.getCacheSizeRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');
clearCacheRaster(raster_uuid)
Removes generated tiles for the desired raster layer.
Parameters:
raster_uuid is the available raster layer uuid.
Returns:
String: Returns a message that shows clearing was successful or not. Null message means clearing was successful.
Example:
const result = await Server.clearCacheRaster('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');