import QuantizationParameters from "@arcgis/core/rest/support/QuantizationParameters.js";const QuantizationParameters = await $arcgis.import("@arcgis/core/rest/support/QuantizationParameters.js");- Inheritance:
- QuantizationParameters→
Accessor
- Since
- ArcGIS Maps SDK for JavaScript 5.0
QuantizationParameters define how geometries are to be quantized (converted to integers) in the response from a Query operation. Used to project the geometry onto a virtual grid, likely representing pixels on the screen. Geometry coordinates are converted to integers by building a grid with a resolution matching the tolerance. Each coordinate is then snapped to one pixel on the grid.
- See also
Constructors
Constructor
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| properties | | |
Properties
extent
An extent defining the quantization grid bounds. Its SpatialReference matches the input geometry spatial reference if one is specified for the query. Otherwise, the extent will be in the layer's spatial reference.
tolerance
- Type
- number
The size of one pixel in the units of the outSpatialReference.
This number is used to convert coordinates to integers by building a grid with a resolution matching the tolerance.
Each coordinate is then snapped to one pixel on the grid. Consecutive coordinates snapped to the same pixel are removed
for reducing the overall response size. The units of tolerance will match the units of outSpatialReference.
If outSpatialReference is not specified, then tolerance is assumed to be in the units of the spatial
reference of the layer. If tolerance is not specified, the maxAllowableOffset is used.
If tolerance and maxAllowableOffset are not specified, a grid of 10,000 * 10,000 grid is used by default.
- Default value
- 1
Methods
fromJSON
- Signature
-
fromJSON (json: any): any
Creates a new instance of this class and initializes it with values from a JSON object
generated from an ArcGIS product. The object passed into the input json
parameter often comes from a response to a query operation in the REST API or a
toJSON()
method from another ArcGIS product. See the Using fromJSON()
topic in the Guide for details and examples of when and how to use this function.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| json | A JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects. | |
- Returns
- any
Returns a new instance of this class.
toJSON
- Signature
-
toJSON (): any
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() guide topic for more information.
- Returns
- any
The ArcGIS portal JSON representation of an instance of this class.