{"id":6134,"date":"2023-01-01T15:55:30","date_gmt":"2023-01-01T12:25:30","guid":{"rendered":"https:\/\/en.geobox.ir\/developers\/?post_type=docs&#038;p=6134"},"modified":"2023-01-26T13:45:26","modified_gmt":"2023-01-26T10:15:26","slug":"working-with-mosaic","status":"publish","type":"docs","link":"https:\/\/en.geobox.ir\/developers\/docs\/mosaic\/working-with-mosaic\/","title":{"rendered":"Raster mosaic layers"},"content":{"rendered":"<h2>Methods:<\/h2>\n<h3>createMosaic(options)<\/h3>\n<p>Creates new raster mosaic layer. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 316px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 26px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 26px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.name<\/div>\n<div>String<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">Name of new mosaic.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.display_name<\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">Display name of new mosaic. This parameter is helpful in identifying mosaic easily.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.description<code class=\"language-json\"><\/code><\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">Description of mosaic.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.pixel_selection<\/div>\n<div>String<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">How to select pixel values in overlapping regions.<\/p>\n<p>Chioces are: &#8216;FirstMethod&#8217; | &#8216;LowestMethod&#8217; | &#8216;HighestMethod&#8217; | &#8216;MeanMethod&#8217; | &#8216;MedainMethod&#8217; | &#8216;StdevMethod&#8217; | &#8216;LastBandHigh&#8217; | &#8216;LastBandLow&#8217;<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.user_id<\/div>\n<div>Number?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">If the admin wants to create mosaic layer for a certain user, this parameter determines which user is the target user.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p class=\"unprose txt-m mb3 anchor mt12\"><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const newMosaicLayer = await Server.createMosaic({\r\n   'name': 'string',\r\n   'display_name': 'string',\r\n   'description': 'string',\r\n   'pixel_selection': 'FirstMethod',\r\n   'user_id': 0\r\n});<\/pre>\n<h3>updateMosaic(mosaic_uuid, options)<\/h3>\n<p>Updates the existing mosaic layer. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 316px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 26px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 26px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.name<\/div>\n<div>String<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">New name of mosaic.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.display_name<\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">New display name of mosaic. This parameter is helpful in identifying mosaic easily.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.description<code class=\"language-json\"><\/code><\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">New description of mosaic.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.pixel_selection<\/div>\n<div>String<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">How to select pixel values in overlapping regions.<\/p>\n<p>Chioces are: &#8216;FirstMethod&#8217; | &#8216;LowestMethod&#8217; | &#8216;HighestMethod&#8217; | &#8216;MeanMethod&#8217; | &#8216;MedainMethod&#8217; | &#8216;StdevMethod&#8217; | &#8216;LastBandHigh&#8217; | &#8216;LastBandLow&#8217;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p class=\"unprose txt-m mb3 anchor mt12\"><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayer = await Server.updateMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{\r\n   'name': 'string',\r\n   'display_name': 'string',\r\n   'description': 'string',\r\n   'pixel_selection': 'FirstMethod'\r\n});<\/pre>\n<h3>getMosaic(mosaic_uuid)<\/h3>\n<p>Returns the desired existing mosaic layer. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayer = await Server.getMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>getMosaicsByIds(options)<\/h3>\n<p>Returns the desired existing mosaic layers. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 112px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 33px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 33px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.ids<\/div>\n<div>Number | Array<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">Ids of mosaic layers. If you want a single mosaic layer, insert id as a string.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.user_id<\/div>\n<div>Number?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 103.063%; text-align: left;\">If the admin wants to fetch mosaic layers of a certain user, this parameter determines which user is the target user.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p class=\"unprose txt-m mb3 anchor mt12\">Array: Returns an array of mosaic layers.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayers = await Server.getMosaicsByIds({\r\n   'ids': [25,125],\r\n   'user_id' :0\r\n});<\/pre>\n<h3>getMosaicByName(name, user_id)<\/h3>\n<p>Returns the desired existing mosaic layer. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>name is the available mosaic name.<\/p>\n<p>user_id is the id of the user that mosaic belongs to.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p class=\"unprose txt-m mb3 anchor mt12\"><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayer = await Server.getMosaicByName('city',2);<\/pre>\n<h3>getMosaics(options)<\/h3>\n<p>Returns the desired existing mosaic layers. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5964%; height: 493px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 48px; width: 22.8381%;\">Name<\/th>\n<th style=\"text-align: left; height: 48px; width: 102.491%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">f<\/span><\/div>\n<div>String<\/div>\n<div>defult: &#8216;json&#8217;<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Output format. Choices are: \u2018json\u2019 | \u2018html\u2019<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">q<\/span><\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Query filter based on <a href=\"https:\/\/portal.ogc.org\/files\/96288\" rel=\"noopener noreferrer\">OGC CQL standard<\/a>.<br \/>\ne.g. &#8220;field1 LIKE &#8216;%GIS%&#8217; AND created_at &gt; &#8216;2021-01-01&#8242;&#8221;<\/td>\n<\/tr>\n<tr style=\"height: 79px;\">\n<td style=\"height: 79px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">search<\/span><\/div>\n<div>String?<\/div>\n<\/div>\n<\/td>\n<td style=\"height: 79px; width: 102.491%; text-align: left;\">Search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value.<br \/>\nNOTE: if q param is defined this param will be ignored.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.search_fields<\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Comma separated list of fields for searching<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">order_by<\/span><\/div>\n<div>String?<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Comma seperated list of fields for sorting results [field1 A|D, field2 A|D, \u2026]. e.g. name A, type D<br \/>\nNOTE: &#8220;A&#8221; denotes ascending order and &#8220;D&#8221; denotes descending order.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">skip<\/span><\/div>\n<div>\n<div>Number?<\/div>\n<div>Default: 0<\/div>\n<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Number of skipped mosaic layers.<\/td>\n<\/tr>\n<tr style=\"height: 79px;\">\n<td style=\"height: 79px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">limit<\/span><\/div>\n<div>\n<div>Number?<\/div>\n<div>Default:10<\/div>\n<\/div>\n<\/div>\n<\/td>\n<td style=\"height: 79px; width: 102.491%; text-align: left;\">Maximum number for result mosaic layers.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">user_id<\/span><\/div>\n<div>Number?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 102.491%; text-align: left;\">If the admin wants to fetch mosaic layers of a certain user, this parameter determines which user is the target user.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">shared<\/span><\/div>\n<div>Bolean<\/div>\n<div>default: false<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">If true, returns only the mosaics that are shared.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">page<\/span><\/div>\n<div>Number?<\/div>\n<div>Default:1<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">The minimum number of pages is 1.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">page_size<\/span><\/div>\n<div>\n<div>Number?<\/div>\n<div>Default:10<\/div>\n<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">The minimum number of maps on each page is 1.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Array: Returns an array of mosaic layers.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayers = await Server.getMosaics({q:`name = 'string'`,user_id :0});<\/pre>\n<h3>getMosaicRasters(mosaic_uuid)<\/h3>\n<p>Returns the raster layers which compose the mosaic layer. This function is an asynchronous function.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Array: Returns an array that contains constitutive raster layers.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const rasterLayers = await Server.getMosaicRasters('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>getMosaicPoint(mosaic_uuid, latitude, longitude)<\/h3>\n<p>Returns the desired existing mosaic layer information in a point (in a pixel).<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>latitude and longitude are geographic coordinates of the point.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Array: Returns an array that contains pixel information.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const pixelInfo = await Server.getMosaicPoint('4f9f3e4b-4dc1-469b-83ab-00ae00f02581', 45, 32);<\/pre>\n<h3>getMosaicSettings(mosaic_uuid)<\/h3>\n<p>Returns the mosaic layer settings.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Object: Returns an object that contains mosaic layer settings.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayerSettings = await Server.getMosaicSettings('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>setMosaicSettings(mosaic_uuid, options )<\/h3>\n<p>Updates the mosaic layer settings.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 108px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 32px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 32px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.visual_settings<\/div>\n<div>Object<\/div>\n<\/td>\n<td style=\"height: 26px; width: 103.063%; text-align: left;\">An object contains visualization settings. See <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d8%af%d8%a7%d8%af%d9%87%d9%87%d8%a7%db%8c-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/%d8%a8%d8%b5%d8%b1%db%8c%d8%b3%d8%a7%d8%b2%db%8c-%d8%af%d8%a7%d8%af%d9%87-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/\">raster visualization<\/a>\u00a0for more guidance. e.g.:<\/p>\n<pre>{\r\n      'nodata': null,\r\n      'indexes': [1],\r\n      'rescale': [[0,255]],\r\n      'colormap_name': null,\r\n      'colormap': null,\r\n      'color_formula': null,\r\n      'expression': null,\r\n      'exaggeration': 10\r\n}<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 50px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.tile_settings<\/div>\n<div>Object<\/div>\n<\/td>\n<td style=\"height: 50px; width: 103.063%; text-align: left;\">An object contains tiles settings. See <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d8%af%d8%a7%d8%af%d9%87%d9%87%d8%a7%db%8c-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/%d8%a8%d8%b5%d8%b1%db%8c%d8%b3%d8%a7%d8%b2%db%8c-%d8%af%d8%a7%d8%af%d9%87-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/\">raster visualization<\/a>\u00a0for more guidance. e.g.:<\/p>\n<pre>{\r\n      'min_zoom': 0,\r\n      'max_zoom': 22,\r\n      'use_cache': true,\r\n      'cache_until_zoom': 17\r\n}<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Object: Returns an object that contains mosaic settings.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayerSettings = await Server.setMosaicSettings('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{\r\n   'visual_settings': {\r\n      'nodata': null,\r\n      'indexes': [1],\r\n      'rescale': [[0,255]],\r\n      'colormap_name': null,\r\n      'colormap': null,\r\n      'color_formula': null,\r\n      'expression': null,\r\n      'exaggeration': 10\r\n   },\r\n   'tile_settings': {\r\n      'min_zoom': 0,\r\n      'max_zoom': 22,\r\n      'use_cache': true,\r\n      'cache_until_zoom': 17\r\n   }\r\n});<\/pre>\n<h3>getMosaicTilejson(mosaic_uuid)<\/h3>\n<p>Returns mosaic layer tile information such as tile access address.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Object: Returns an object that contains mosaic layer tiles information.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayerTilejson = await Server.getMosaicTilejson('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>addRasterToMosaic(mosaic_uuid, options)<\/h3>\n<p>Adds raster layers to the desired existing mosaic layer.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 36px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 26px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 26px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 10px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.ids<\/div>\n<div>Array<\/div>\n<\/td>\n<td style=\"height: 10px; width: 103.063%; text-align: left;\">Array of ids of raster layers.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayer = await Server.addRasterToMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ids:[1,10]});<\/pre>\n<h3>removeRasterFromMosaic(mosaic_uuid, options)<\/h3>\n<p>Removes raster layers from the desired existing mosaic layer.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5238%; height: 36px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 26px; width: 22.9905%;\">Name<\/th>\n<th style=\"text-align: left; height: 26px; width: 103.063%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 10px; width: 22.9905%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.ids<\/div>\n<div>Array<\/div>\n<\/td>\n<td style=\"height: 10px; width: 103.063%; text-align: left;\">Array of Ids of raster layers.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p><a href=\"https:\/\/www.geobox.ir\/\">Mosaic layer<\/a>: Returns itself to allow for method chaining.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const mosaicLayer = await Server.removeRasterFromMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{ids:[1,10]});<\/pre>\n<h3>deleteMosaic(mosaic_uuid)<\/h3>\n<p>Deletes the existing mosaic layer.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>String: Returns a message that shows deleting was successful or not. Null message means deleting was successful.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const result = await Server.deleteMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>seedCacheMosaic(mosaic_uuid, options)<\/h3>\n<p>Generates and stores tiles for the existing mosaic layer. See <a href=\"https:\/\/www.geobox.ir\/doc\/v1\/%d8%af%d8%a7%d8%af%d9%87%d9%87%d8%a7%db%8c-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/%d9%85%d8%af%db%8c%d8%b1%db%8c%d8%aa-%d9%84%d8%a7%db%8c%d9%87%d9%87%d8%a7%db%8c-%d8%b1%d8%b3%d8%aa%d8%b1%db%8c\/#2-toc-title\">generating and storing tiles<\/a>\u00a0for more guidance.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p>options (Object)<\/p>\n<table class=\"table table--fixed table--compact\" style=\"width: 82.5964%; height: 316px;\">\n<thead>\n<tr class=\"bg-gray-faint\" style=\"height: 26px;\">\n<th style=\"text-align: left; height: 26px; width: 22.8381%;\">Name<\/th>\n<th style=\"text-align: left; height: 26px; width: 102.491%;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.from_zoom<\/div>\n<div>Number<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">from_zoom parameter is between 0 and 22.<\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.to_zoom<\/div>\n<div>Number<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">to_zoom parameter is between 0 and 22.<\/td>\n<\/tr>\n<tr style=\"height: 79px;\">\n<td style=\"height: 79px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">extent<\/span><\/div>\n<div>Array<\/div>\n<\/div>\n<\/td>\n<td style=\"height: 79px; width: 102.491%; text-align: left;\"><span class=\"enlighter-s0\">[southwest x, southwest y,\u00a0 northeast x, northeast y]<\/span><\/td>\n<\/tr>\n<tr style=\"height: 26px;\">\n<td style=\"height: 26px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.workers<\/div>\n<div>Number<\/div>\n<\/td>\n<td style=\"height: 26px; width: 102.491%; text-align: left;\">Number of cpu cores.<\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"height: 53px; width: 22.8381%; text-align: left;\">\n<div class=\"txt-mono txt-bold txt-break-word\">options.<span style=\"font-family: inherit; font-size: inherit;\">user_id<\/span><\/div>\n<div>Number?<\/div>\n<\/td>\n<td style=\"height: 53px; width: 102.491%; text-align: left;\">If the admin wants to build cache for a mosaic layer of a certain user, this parameter determines which user is the target user.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Object: Returns task id to manage task.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const taskId = await Server.seedCacheMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{\r\n   'from_zoom': 0,\r\n   'to_zoom': 2,\r\n   'extent': [51, 35, 52, 36],\r\n   'workers': 1,\r\n   'user_id': 2\r\n})<\/pre>\n<h3>getCacheSizeMosaic(mosaic_uuid)<\/h3>\n<p>Returns the size of tiles generated and stored for mosaic layer in bytes.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>Number: Returns tiles size in byte.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const tilesSize = await Server.getCacheSizeMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n<h3>clearCacheMosaic(mosaic_uuid)<\/h3>\n<p>Removes generated tiles for the desired mosaic layer.<\/p>\n<p><strong>Parameters:<\/strong><\/p>\n<p>mosaic_uuid is the available mosaic layer uuid.<\/p>\n<p id=\"zoomin-returns\" class=\"unprose txt-m mb3 anchor mt12\"><strong>Returns:<\/strong><\/p>\n<p>String: Returns a message that shows clearing was successful or not. Null message means clearing was successful.<\/p>\n<p><strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">const result = await Server.clearCacheMosaic('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[69],"doc_tag":[],"class_list":["post-6134","docs","type-docs","status-publish","hentry","doc_category-mosaic"],"_links":{"self":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/comments?post=6134"}],"version-history":[{"count":28,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6134\/revisions"}],"predecessor-version":[{"id":6678,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/docs\/6134\/revisions\/6678"}],"wp:attachment":[{"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/media?parent=6134"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_category?post=6134"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/en.geobox.ir\/developers\/wp-json\/wp\/v2\/doc_tag?post=6134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}