Raster mosaic layers

Methods:

createMosaic(options)

Creates new raster mosaic layer. This function is an asynchronous function.

Parameters:

options (Object)

Name Description
options.name
String
Name of new mosaic.
options.display_name
String?
Display name of new mosaic. This parameter is helpful in identifying mosaic easily.
options.description
String?
Description of mosaic.
options.pixel_selection
String
How to select pixel values in overlapping regions.

Chioces are: ‘FirstMethod’ | ‘LowestMethod’ | ‘HighestMethod’ | ‘MeanMethod’ | ‘MedainMethod’ | ‘StdevMethod’ | ‘LastBandHigh’ | ‘LastBandLow’

options.user_id
Number?
If the admin wants to create mosaic layer for a certain user, this parameter determines which user is the target user.

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const newMosaicLayer = await Server.createMosaic({
   'name': 'string',
   'display_name': 'string',
   'description': 'string',
   'pixel_selection': 'FirstMethod',
   'user_id': 0
});

updateMosaic(mosaic_uuid, options)

Updates the existing mosaic layer. This function is an asynchronous function.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

options (Object)

Name Description
options.name
String
New name of mosaic.
options.display_name
String?
New display name of mosaic. This parameter is helpful in identifying mosaic easily.
options.description
String?
New description of mosaic.
options.pixel_selection
String
How to select pixel values in overlapping regions.

Chioces are: ‘FirstMethod’ | ‘LowestMethod’ | ‘HighestMethod’ | ‘MeanMethod’ | ‘MedainMethod’ | ‘StdevMethod’ | ‘LastBandHigh’ | ‘LastBandLow’

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const mosaicLayer = await Server.updateMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{
   'name': 'string',
   'display_name': 'string',
   'description': 'string',
   'pixel_selection': 'FirstMethod'
});

getMosaic(mosaic_uuid)

Returns the desired existing mosaic layer. This function is an asynchronous function.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const mosaicLayer = await Server.getMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

getMosaicsByIds(options)

Returns the desired existing mosaic layers. This function is an asynchronous function.

Parameters:

options (Object)

Name Description
options.ids
Number | Array
Ids of mosaic layers. If you want a single mosaic layer, insert id as a string.
options.user_id
Number?
If the admin wants to fetch mosaic layers of a certain user, this parameter determines which user is the target user.

Returns:

Array: Returns an array of mosaic layers.

Example:

const mosaicLayers = await Server.getMosaicsByIds({
   'ids': [25,125],
   'user_id' :0
});

getMosaicByName(name, user_id)

Returns the desired existing mosaic layer. This function is an asynchronous function.

Parameters:

name is the available mosaic name.

user_id is the id of the user that mosaic belongs to.

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const mosaicLayer = await Server.getMosaicByName('city',2);

getMosaics(options)

Returns the desired existing mosaic 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 mosaic layers.
options.limit
Number?
Default:10
Maximum number for result mosaic layers.
options.user_id
Number?
If the admin wants to fetch mosaic layers of a certain user, this parameter determines which user is the target user.
options.shared
Bolean
default: false
If true, returns only the mosaics 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 mosaic layers.

Example:

const mosaicLayers = await Server.getMosaics({q:`name = 'string'`,user_id :0});

getMosaicRasters(mosaic_uuid)

Returns the raster layers which compose the mosaic layer. This function is an asynchronous function.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

Returns:

Array: Returns an array that contains constitutive raster layers.

Example:

const rasterLayers = await Server.getMosaicRasters('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

getMosaicPoint(mosaic_uuid, latitude, longitude)

Returns the desired existing mosaic layer information in a point (in a pixel).

Parameters:

mosaic_uuid is the available mosaic 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.getMosaicPoint('4f9f3e4b-4dc1-469b-83ab-00ae00f02581', 45, 32);

getMosaicSettings(mosaic_uuid)

Returns the mosaic layer settings.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

Returns:

Object: Returns an object that contains mosaic layer settings.

Example:

const mosaicLayerSettings = await Server.getMosaicSettings('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

setMosaicSettings(mosaic_uuid, options )

Updates the mosaic layer settings.

Parameters:

mosaic_uuid is the available mosaic 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 mosaic settings.

Example:

const mosaicLayerSettings = await Server.setMosaicSettings('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
   }
});

getMosaicTilejson(mosaic_uuid)

Returns mosaic layer tile information such as tile access address.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

Returns:

Object: Returns an object that contains mosaic layer tiles information.

Example:

const mosaicLayerTilejson = await Server.getMosaicTilejson('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

addRasterToMosaic(mosaic_uuid, options)

Adds raster layers to the desired existing mosaic layer.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

options (Object)

Name Description
options.ids
Array
Array of ids of raster layers.

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const mosaicLayer = await Server.addRasterToMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ids:[1,10]});

removeRasterFromMosaic(mosaic_uuid, options)

Removes raster layers from the desired existing mosaic layer.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

options (Object)

Name Description
options.ids
Array
Array of Ids of raster layers.

Returns:

Mosaic layer: Returns itself to allow for method chaining.

Example:

const mosaicLayer = await Server.removeRasterFromMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ids:[1,10]});

deleteMosaic(mosaic_uuid)

Deletes the existing mosaic layer.

Parameters:

mosaic_uuid is the available mosaic 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.deleteMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

seedCacheMosaic(mosaic_uuid, options)

Generates and stores tiles for the existing mosaic layer. See generating and storing tiles for more guidance.

Parameters:

mosaic_uuid is the available mosaic 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 mosaic 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.seedCacheMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{
   'from_zoom': 0,
   'to_zoom': 2,
   'extent': [51, 35, 52, 36],
   'workers': 1,
   'user_id': 2
})

getCacheSizeMosaic(mosaic_uuid)

Returns the size of tiles generated and stored for mosaic layer in bytes.

Parameters:

mosaic_uuid is the available mosaic layer uuid.

Returns:

Number: Returns tiles size in byte.

Example:

const tilesSize = await Server.getCacheSizeMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

clearCacheMosaic(mosaic_uuid)

Removes generated tiles for the desired mosaic layer.

Parameters:

mosaic_uuid is the available mosaic 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.clearCacheMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

Leave a comment

Your email address will not be published. Required fields are marked *