@esri/arcgis-rest-feature-service
Version:
Feature layer query and edit helpers for @esri/arcgis-rest-js
745 lines • 31.5 kB
JavaScript
"use strict";
/* istanbul ignore file --@preserve */
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeatureCollectionPBufferSegmentType = exports.FeatureCollectionPBufferQuantizeOriginPostion = exports.FeatureCollectionPBufferSQLType = exports.FeatureCollectionPBufferFieldType = exports.FeatureCollectionPBufferGeometryType = void 0;
exports.readFeatureCollectionPBuffer = readFeatureCollectionPBuffer;
exports.writeFeatureCollectionPBuffer = writeFeatureCollectionPBuffer;
exports.readFeatureCollectionPBufferSpatialReference = readFeatureCollectionPBufferSpatialReference;
exports.writeFeatureCollectionPBufferSpatialReference = writeFeatureCollectionPBufferSpatialReference;
exports.readFeatureCollectionPBufferField = readFeatureCollectionPBufferField;
exports.writeFeatureCollectionPBufferField = writeFeatureCollectionPBufferField;
exports.readFeatureCollectionPBufferGeometryField = readFeatureCollectionPBufferGeometryField;
exports.writeFeatureCollectionPBufferGeometryField = writeFeatureCollectionPBufferGeometryField;
exports.readFeatureCollectionPBufferEnvelope = readFeatureCollectionPBufferEnvelope;
exports.writeFeatureCollectionPBufferEnvelope = writeFeatureCollectionPBufferEnvelope;
exports.readFeatureCollectionPBufferValue = readFeatureCollectionPBufferValue;
exports.writeFeatureCollectionPBufferValue = writeFeatureCollectionPBufferValue;
exports.readFeatureCollectionPBufferGeometry = readFeatureCollectionPBufferGeometry;
exports.writeFeatureCollectionPBufferGeometry = writeFeatureCollectionPBufferGeometry;
exports.readFeatureCollectionPBufferCurveGeometry = readFeatureCollectionPBufferCurveGeometry;
exports.writeFeatureCollectionPBufferCurveGeometry = writeFeatureCollectionPBufferCurveGeometry;
exports.readFeatureCollectionPBufferSegmentSet = readFeatureCollectionPBufferSegmentSet;
exports.writeFeatureCollectionPBufferSegmentSet = writeFeatureCollectionPBufferSegmentSet;
exports.readFeatureCollectionPBufferesriShapeBuffer = readFeatureCollectionPBufferesriShapeBuffer;
exports.writeFeatureCollectionPBufferesriShapeBuffer = writeFeatureCollectionPBufferesriShapeBuffer;
exports.readFeatureCollectionPBufferFeature = readFeatureCollectionPBufferFeature;
exports.writeFeatureCollectionPBufferFeature = writeFeatureCollectionPBufferFeature;
exports.readFeatureCollectionPBufferUniqueIdField = readFeatureCollectionPBufferUniqueIdField;
exports.writeFeatureCollectionPBufferUniqueIdField = writeFeatureCollectionPBufferUniqueIdField;
exports.readFeatureCollectionPBufferGeometryProperties = readFeatureCollectionPBufferGeometryProperties;
exports.writeFeatureCollectionPBufferGeometryProperties = writeFeatureCollectionPBufferGeometryProperties;
exports.readFeatureCollectionPBufferServerGens = readFeatureCollectionPBufferServerGens;
exports.writeFeatureCollectionPBufferServerGens = writeFeatureCollectionPBufferServerGens;
exports.readFeatureCollectionPBufferScale = readFeatureCollectionPBufferScale;
exports.writeFeatureCollectionPBufferScale = writeFeatureCollectionPBufferScale;
exports.readFeatureCollectionPBufferTranslate = readFeatureCollectionPBufferTranslate;
exports.writeFeatureCollectionPBufferTranslate = writeFeatureCollectionPBufferTranslate;
exports.readFeatureCollectionPBufferTransform = readFeatureCollectionPBufferTransform;
exports.writeFeatureCollectionPBufferTransform = writeFeatureCollectionPBufferTransform;
exports.readFeatureCollectionPBufferFeatureResult = readFeatureCollectionPBufferFeatureResult;
exports.writeFeatureCollectionPBufferFeatureResult = writeFeatureCollectionPBufferFeatureResult;
exports.readFeatureCollectionPBufferCountResult = readFeatureCollectionPBufferCountResult;
exports.writeFeatureCollectionPBufferCountResult = writeFeatureCollectionPBufferCountResult;
exports.readFeatureCollectionPBufferObjectIdsResult = readFeatureCollectionPBufferObjectIdsResult;
exports.writeFeatureCollectionPBufferObjectIdsResult = writeFeatureCollectionPBufferObjectIdsResult;
exports.readFeatureCollectionPBufferExtentCountResult = readFeatureCollectionPBufferExtentCountResult;
exports.writeFeatureCollectionPBufferExtentCountResult = writeFeatureCollectionPBufferExtentCountResult;
exports.readFeatureCollectionPBufferQueryResult = readFeatureCollectionPBufferQueryResult;
exports.writeFeatureCollectionPBufferQueryResult = writeFeatureCollectionPBufferQueryResult;
// generated from https://github.com/Esri/arcgis-pbf/blob/main/proto/FeatureCollection/FeatureCollection.proto
// code generated by pbf v4.0.1
function readFeatureCollectionPBuffer(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferField, { version: "", queryResult: undefined }, end);
}
function _readFeatureCollectionPBufferField(tag, obj, pbf) {
if (tag === 1)
obj.version = pbf.readString();
else if (tag === 2)
obj.queryResult = readFeatureCollectionPBufferQueryResult(pbf, pbf.readVarint() + pbf.pos);
}
function writeFeatureCollectionPBuffer(obj, pbf) {
if (obj.version)
pbf.writeStringField(1, obj.version);
if (obj.queryResult)
pbf.writeMessage(2, writeFeatureCollectionPBufferQueryResult, obj.queryResult);
}
exports.FeatureCollectionPBufferGeometryType = {
esriGeometryTypePoint: 0,
esriGeometryTypeMultipoint: 1,
esriGeometryTypePolyline: 2,
esriGeometryTypePolygon: 3,
esriGeometryTypeMultipatch: 4,
esriGeometryTypeNone: 127,
esriGeometryTypeEnvelope: 5
};
exports.FeatureCollectionPBufferFieldType = {
esriFieldTypeSmallInteger: 0,
esriFieldTypeInteger: 1,
esriFieldTypeSingle: 2,
esriFieldTypeDouble: 3,
esriFieldTypeString: 4,
esriFieldTypeDate: 5,
esriFieldTypeOID: 6,
esriFieldTypeGeometry: 7,
esriFieldTypeBlob: 8,
esriFieldTypeRaster: 9,
esriFieldTypeGUID: 10,
esriFieldTypeGlobalID: 11,
esriFieldTypeXML: 12,
esriFieldTypeBigInteger: 13,
esriFieldTypeDateOnly: 14,
esriFieldTypeTimeOnly: 15,
esriFieldTypeTimestampOffset: 16
};
exports.FeatureCollectionPBufferSQLType = {
sqlTypeBigInt: 0,
sqlTypeBinary: 1,
sqlTypeBit: 2,
sqlTypeChar: 3,
sqlTypeDate: 4,
sqlTypeDecimal: 5,
sqlTypeDouble: 6,
sqlTypeFloat: 7,
sqlTypeGeometry: 8,
sqlTypeGUID: 9,
sqlTypeInteger: 10,
sqlTypeLongNVarchar: 11,
sqlTypeLongVarbinary: 12,
sqlTypeLongVarchar: 13,
sqlTypeNChar: 14,
sqlTypeNVarchar: 15,
sqlTypeOther: 16,
sqlTypeReal: 17,
sqlTypeSmallInt: 18,
sqlTypeSqlXml: 19,
sqlTypeTime: 20,
sqlTypeTimestamp: 21,
sqlTypeTimestamp2: 22,
sqlTypeTinyInt: 23,
sqlTypeVarbinary: 24,
sqlTypeVarchar: 25,
sqlTypeTimestampWithTimezone: 26
};
exports.FeatureCollectionPBufferQuantizeOriginPostion = {
upperLeft: 0,
lowerLeft: 1
};
exports.FeatureCollectionPBufferSegmentType = {
line: 0,
arc: 1,
bezier: 2,
ellipticArc: 3
};
function readFeatureCollectionPBufferSpatialReference(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferSpatialReferenceField, { wkid: 0, latestWkid: 0, vcsWkid: 0, latestVcsWkid: 0, wkt: "", wkt2: "" }, end);
}
function _readFeatureCollectionPBufferSpatialReferenceField(tag, obj, pbf) {
if (tag === 1)
obj.wkid = pbf.readVarint();
else if (tag === 2)
obj.latestWkid = pbf.readVarint();
else if (tag === 3)
obj.vcsWkid = pbf.readVarint();
else if (tag === 4)
obj.latestVcsWkid = pbf.readVarint();
else if (tag === 5)
obj.wkt = pbf.readString();
else if (tag === 6)
obj.wkt2 = pbf.readString();
}
function writeFeatureCollectionPBufferSpatialReference(obj, pbf) {
if (obj.wkid)
pbf.writeVarintField(1, obj.wkid);
if (obj.latestWkid)
pbf.writeVarintField(2, obj.latestWkid);
if (obj.vcsWkid)
pbf.writeVarintField(3, obj.vcsWkid);
if (obj.latestVcsWkid)
pbf.writeVarintField(4, obj.latestVcsWkid);
if (obj.wkt)
pbf.writeStringField(5, obj.wkt);
if (obj.wkt2)
pbf.writeStringField(6, obj.wkt2);
}
function readFeatureCollectionPBufferField(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferFieldField, {
name: "",
fieldType: 0,
alias: "",
sqlType: 0,
domain: "",
defaultValue: ""
}, end);
}
function _readFeatureCollectionPBufferFieldField(tag, obj, pbf) {
if (tag === 1)
obj.name = pbf.readString();
else if (tag === 2)
obj.fieldType = pbf.readVarint();
else if (tag === 3)
obj.alias = pbf.readString();
else if (tag === 4)
obj.sqlType = pbf.readVarint();
else if (tag === 5)
obj.domain = pbf.readString();
else if (tag === 6)
obj.defaultValue = pbf.readString();
}
function writeFeatureCollectionPBufferField(obj, pbf) {
if (obj.name)
pbf.writeStringField(1, obj.name);
if (obj.fieldType)
pbf.writeVarintField(2, obj.fieldType);
if (obj.alias)
pbf.writeStringField(3, obj.alias);
if (obj.sqlType)
pbf.writeVarintField(4, obj.sqlType);
if (obj.domain)
pbf.writeStringField(5, obj.domain);
if (obj.defaultValue)
pbf.writeStringField(6, obj.defaultValue);
}
function readFeatureCollectionPBufferGeometryField(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferGeometryFieldField, { field: undefined, geometryType: 0 }, end);
}
function _readFeatureCollectionPBufferGeometryFieldField(tag, obj, pbf) {
if (tag === 1)
obj.field = readFeatureCollectionPBufferField(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 2)
obj.geometryType = pbf.readVarint();
}
function writeFeatureCollectionPBufferGeometryField(obj, pbf) {
if (obj.field)
pbf.writeMessage(1, writeFeatureCollectionPBufferField, obj.field);
if (obj.geometryType)
pbf.writeVarintField(2, obj.geometryType);
}
function readFeatureCollectionPBufferEnvelope(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferEnvelopeField, { XMin: 0, YMin: 0, XMax: 0, YMax: 0, SpatialReference: undefined }, end);
}
function _readFeatureCollectionPBufferEnvelopeField(tag, obj, pbf) {
if (tag === 1)
obj.XMin = pbf.readDouble();
else if (tag === 2)
obj.YMin = pbf.readDouble();
else if (tag === 3)
obj.XMax = pbf.readDouble();
else if (tag === 4)
obj.YMax = pbf.readDouble();
else if (tag === 5)
obj.SpatialReference = readFeatureCollectionPBufferSpatialReference(pbf, pbf.readVarint() + pbf.pos);
}
function writeFeatureCollectionPBufferEnvelope(obj, pbf) {
if (obj.XMin)
pbf.writeDoubleField(1, obj.XMin);
if (obj.YMin)
pbf.writeDoubleField(2, obj.YMin);
if (obj.XMax)
pbf.writeDoubleField(3, obj.XMax);
if (obj.YMax)
pbf.writeDoubleField(4, obj.YMax);
if (obj.SpatialReference)
pbf.writeMessage(5, writeFeatureCollectionPBufferSpatialReference, obj.SpatialReference);
}
function readFeatureCollectionPBufferValue(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferValueField, {
string_value: "",
value_type: undefined,
float_value: 0,
double_value: 0,
sint_value: 0,
uint_value: 0,
int64_value: 0,
uint64_value: 0,
sint64_value: 0,
bool_value: false,
null_value: false,
index: 0
}, end);
}
function _readFeatureCollectionPBufferValueField(tag, obj, pbf) {
if (tag === 1) {
obj.string_value = pbf.readString();
obj.value_type = "string_value";
}
else if (tag === 2) {
obj.float_value = pbf.readFloat();
obj.value_type = "float_value";
}
else if (tag === 3) {
obj.double_value = pbf.readDouble();
obj.value_type = "double_value";
}
else if (tag === 4) {
obj.sint_value = pbf.readSVarint();
obj.value_type = "sint_value";
}
else if (tag === 5) {
obj.uint_value = pbf.readVarint();
obj.value_type = "uint_value";
}
else if (tag === 6) {
obj.int64_value = pbf.readVarint(true);
obj.value_type = "int64_value";
}
else if (tag === 7) {
obj.uint64_value = pbf.readVarint();
obj.value_type = "uint64_value";
}
else if (tag === 8) {
obj.sint64_value = pbf.readSVarint();
obj.value_type = "sint64_value";
}
else if (tag === 9) {
obj.bool_value = pbf.readBoolean();
obj.value_type = "bool_value";
}
else if (tag === 10) {
obj.null_value = pbf.readBoolean();
obj.value_type = "null_value";
}
else if (tag === 11)
obj.index = pbf.readVarint();
}
function writeFeatureCollectionPBufferValue(obj, pbf) {
if (obj.string_value != null)
pbf.writeStringField(1, obj.string_value);
if (obj.float_value != null)
pbf.writeFloatField(2, obj.float_value);
if (obj.double_value != null)
pbf.writeDoubleField(3, obj.double_value);
if (obj.sint_value != null)
pbf.writeSVarintField(4, obj.sint_value);
if (obj.uint_value != null)
pbf.writeVarintField(5, obj.uint_value);
if (obj.int64_value != null)
pbf.writeVarintField(6, obj.int64_value);
if (obj.uint64_value != null)
pbf.writeVarintField(7, obj.uint64_value);
if (obj.sint64_value != null)
pbf.writeSVarintField(8, obj.sint64_value);
if (obj.bool_value != null)
pbf.writeBooleanField(9, obj.bool_value);
if (obj.null_value != null)
pbf.writeBooleanField(10, obj.null_value);
if (obj.index)
pbf.writeVarintField(11, obj.index);
}
function readFeatureCollectionPBufferGeometry(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferGeometryField, { geometryType: 0, lengths: [], coords: [], ids: [] }, end);
}
function _readFeatureCollectionPBufferGeometryField(tag, obj, pbf) {
if (tag === 1)
obj.geometryType = pbf.readVarint();
else if (tag === 2)
pbf.readPackedVarint(obj.lengths);
else if (tag === 3)
pbf.readPackedSVarint(obj.coords);
else if (tag === 4)
pbf.readPackedSVarint(obj.ids);
}
function writeFeatureCollectionPBufferGeometry(obj, pbf) {
if (obj.geometryType)
pbf.writeVarintField(1, obj.geometryType);
if (obj.lengths)
pbf.writePackedVarint(2, obj.lengths);
if (obj.coords)
pbf.writePackedSVarint(3, obj.coords);
if (obj.ids)
pbf.writePackedSVarint(4, obj.ids);
}
function readFeatureCollectionPBufferCurveGeometry(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferCurveGeometryField, { geometryType: 0, parts: [], segmentSets: [], coords: [] }, end);
}
function _readFeatureCollectionPBufferCurveGeometryField(tag, obj, pbf) {
if (tag === 1)
obj.geometryType = pbf.readVarint();
else if (tag === 2)
pbf.readPackedVarint(obj.parts);
else if (tag === 3)
obj.segmentSets.push(readFeatureCollectionPBufferSegmentSet(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 4)
pbf.readPackedSVarint(obj.coords);
}
function writeFeatureCollectionPBufferCurveGeometry(obj, pbf) {
if (obj.geometryType)
pbf.writeVarintField(1, obj.geometryType);
if (obj.parts)
pbf.writePackedVarint(2, obj.parts);
if (obj.segmentSets)
for (const item of obj.segmentSets)
pbf.writeMessage(3, writeFeatureCollectionPBufferSegmentSet, item);
if (obj.coords)
pbf.writePackedSVarint(4, obj.coords);
}
function readFeatureCollectionPBufferSegmentSet(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferSegmentSetField, { type: 0, count: 0, parameters: [] }, end);
}
function _readFeatureCollectionPBufferSegmentSetField(tag, obj, pbf) {
if (tag === 1)
obj.type = pbf.readVarint();
else if (tag === 2)
obj.count = pbf.readVarint();
else if (tag === 3)
pbf.readPackedDouble(obj.parameters);
}
function writeFeatureCollectionPBufferSegmentSet(obj, pbf) {
if (obj.type)
pbf.writeVarintField(1, obj.type);
if (obj.count)
pbf.writeVarintField(2, obj.count);
if (obj.parameters)
pbf.writePackedDouble(3, obj.parameters);
}
function readFeatureCollectionPBufferesriShapeBuffer(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferesriShapeBufferField, { bytes: undefined }, end);
}
function _readFeatureCollectionPBufferesriShapeBufferField(tag, obj, pbf) {
if (tag === 1)
obj.bytes = pbf.readBytes();
}
function writeFeatureCollectionPBufferesriShapeBuffer(obj, pbf) {
if (obj.bytes != null)
pbf.writeBytesField(1, obj.bytes);
}
function readFeatureCollectionPBufferFeature(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferFeatureField, {
attributes: [],
geometry: undefined,
compressed_geometry: undefined,
shapeBuffer: undefined,
curveGeometry: undefined,
centroid: undefined,
aggregateGeometries: [],
envelope: undefined
}, end);
}
function _readFeatureCollectionPBufferFeatureField(tag, obj, pbf) {
if (tag === 1)
obj.attributes.push(readFeatureCollectionPBufferValue(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 2) {
obj.geometry = readFeatureCollectionPBufferGeometry(pbf, pbf.readVarint() + pbf.pos);
obj.compressed_geometry = "geometry";
}
else if (tag === 3) {
obj.shapeBuffer = readFeatureCollectionPBufferesriShapeBuffer(pbf, pbf.readVarint() + pbf.pos);
obj.compressed_geometry = "shapeBuffer";
}
else if (tag === 7) {
obj.curveGeometry = readFeatureCollectionPBufferCurveGeometry(pbf, pbf.readVarint() + pbf.pos);
obj.compressed_geometry = "curveGeometry";
}
else if (tag === 4)
obj.centroid = readFeatureCollectionPBufferGeometry(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 5)
obj.aggregateGeometries.push(readFeatureCollectionPBufferGeometry(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 6)
obj.envelope = readFeatureCollectionPBufferEnvelope(pbf, pbf.readVarint() + pbf.pos);
}
function writeFeatureCollectionPBufferFeature(obj, pbf) {
if (obj.attributes)
for (const item of obj.attributes)
pbf.writeMessage(1, writeFeatureCollectionPBufferValue, item);
if (obj.geometry)
pbf.writeMessage(2, writeFeatureCollectionPBufferGeometry, obj.geometry);
if (obj.shapeBuffer)
pbf.writeMessage(3, writeFeatureCollectionPBufferesriShapeBuffer, obj.shapeBuffer);
if (obj.curveGeometry)
pbf.writeMessage(7, writeFeatureCollectionPBufferCurveGeometry, obj.curveGeometry);
if (obj.centroid)
pbf.writeMessage(4, writeFeatureCollectionPBufferGeometry, obj.centroid);
if (obj.aggregateGeometries)
for (const item of obj.aggregateGeometries)
pbf.writeMessage(5, writeFeatureCollectionPBufferGeometry, item);
if (obj.envelope)
pbf.writeMessage(6, writeFeatureCollectionPBufferEnvelope, obj.envelope);
}
function readFeatureCollectionPBufferUniqueIdField(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferUniqueIdFieldField, { name: "", isSystemMaintained: false }, end);
}
function _readFeatureCollectionPBufferUniqueIdFieldField(tag, obj, pbf) {
if (tag === 1)
obj.name = pbf.readString();
else if (tag === 2)
obj.isSystemMaintained = pbf.readBoolean();
}
function writeFeatureCollectionPBufferUniqueIdField(obj, pbf) {
if (obj.name)
pbf.writeStringField(1, obj.name);
if (obj.isSystemMaintained)
pbf.writeBooleanField(2, obj.isSystemMaintained);
}
function readFeatureCollectionPBufferGeometryProperties(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferGeometryPropertiesField, { shapeAreaFieldName: "", shapeLengthFieldName: "", units: "" }, end);
}
function _readFeatureCollectionPBufferGeometryPropertiesField(tag, obj, pbf) {
if (tag === 1)
obj.shapeAreaFieldName = pbf.readString();
else if (tag === 2)
obj.shapeLengthFieldName = pbf.readString();
else if (tag === 3)
obj.units = pbf.readString();
}
function writeFeatureCollectionPBufferGeometryProperties(obj, pbf) {
if (obj.shapeAreaFieldName)
pbf.writeStringField(1, obj.shapeAreaFieldName);
if (obj.shapeLengthFieldName)
pbf.writeStringField(2, obj.shapeLengthFieldName);
if (obj.units)
pbf.writeStringField(3, obj.units);
}
function readFeatureCollectionPBufferServerGens(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferServerGensField, { minServerGen: 0, serverGen: 0 }, end);
}
function _readFeatureCollectionPBufferServerGensField(tag, obj, pbf) {
if (tag === 1)
obj.minServerGen = pbf.readVarint();
else if (tag === 2)
obj.serverGen = pbf.readVarint();
}
function writeFeatureCollectionPBufferServerGens(obj, pbf) {
if (obj.minServerGen)
pbf.writeVarintField(1, obj.minServerGen);
if (obj.serverGen)
pbf.writeVarintField(2, obj.serverGen);
}
function readFeatureCollectionPBufferScale(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferScaleField, { xScale: 0, yScale: 0, mScale: 0, zScale: 0 }, end);
}
function _readFeatureCollectionPBufferScaleField(tag, obj, pbf) {
if (tag === 1)
obj.xScale = pbf.readDouble();
else if (tag === 2)
obj.yScale = pbf.readDouble();
else if (tag === 3)
obj.mScale = pbf.readDouble();
else if (tag === 4)
obj.zScale = pbf.readDouble();
}
function writeFeatureCollectionPBufferScale(obj, pbf) {
if (obj.xScale)
pbf.writeDoubleField(1, obj.xScale);
if (obj.yScale)
pbf.writeDoubleField(2, obj.yScale);
if (obj.mScale)
pbf.writeDoubleField(3, obj.mScale);
if (obj.zScale)
pbf.writeDoubleField(4, obj.zScale);
}
function readFeatureCollectionPBufferTranslate(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferTranslateField, { xTranslate: 0, yTranslate: 0, mTranslate: 0, zTranslate: 0 }, end);
}
function _readFeatureCollectionPBufferTranslateField(tag, obj, pbf) {
if (tag === 1)
obj.xTranslate = pbf.readDouble();
else if (tag === 2)
obj.yTranslate = pbf.readDouble();
else if (tag === 3)
obj.mTranslate = pbf.readDouble();
else if (tag === 4)
obj.zTranslate = pbf.readDouble();
}
function writeFeatureCollectionPBufferTranslate(obj, pbf) {
if (obj.xTranslate)
pbf.writeDoubleField(1, obj.xTranslate);
if (obj.yTranslate)
pbf.writeDoubleField(2, obj.yTranslate);
if (obj.mTranslate)
pbf.writeDoubleField(3, obj.mTranslate);
if (obj.zTranslate)
pbf.writeDoubleField(4, obj.zTranslate);
}
function readFeatureCollectionPBufferTransform(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferTransformField, { quantizeOriginPostion: 0, scale: undefined, translate: undefined }, end);
}
function _readFeatureCollectionPBufferTransformField(tag, obj, pbf) {
if (tag === 1)
obj.quantizeOriginPostion = pbf.readVarint();
else if (tag === 2)
obj.scale = readFeatureCollectionPBufferScale(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 3)
obj.translate = readFeatureCollectionPBufferTranslate(pbf, pbf.readVarint() + pbf.pos);
}
function writeFeatureCollectionPBufferTransform(obj, pbf) {
if (obj.quantizeOriginPostion)
pbf.writeVarintField(1, obj.quantizeOriginPostion);
if (obj.scale)
pbf.writeMessage(2, writeFeatureCollectionPBufferScale, obj.scale);
if (obj.translate)
pbf.writeMessage(3, writeFeatureCollectionPBufferTranslate, obj.translate);
}
function readFeatureCollectionPBufferFeatureResult(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferFeatureResultField, {
objectIdFieldName: "",
uniqueIdField: undefined,
globalIdFieldName: "",
geohashFieldName: "",
geometryProperties: undefined,
serverGens: undefined,
geometryType: 0,
spatialReference: undefined,
exceededTransferLimit: false,
hasZ: false,
hasM: false,
transform: undefined,
fields: [],
values: [],
features: [],
geometryFields: []
}, end);
}
function _readFeatureCollectionPBufferFeatureResultField(tag, obj, pbf) {
if (tag === 1)
obj.objectIdFieldName = pbf.readString();
else if (tag === 2)
obj.uniqueIdField = readFeatureCollectionPBufferUniqueIdField(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 3)
obj.globalIdFieldName = pbf.readString();
else if (tag === 4)
obj.geohashFieldName = pbf.readString();
else if (tag === 5)
obj.geometryProperties = readFeatureCollectionPBufferGeometryProperties(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 6)
obj.serverGens = readFeatureCollectionPBufferServerGens(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 7)
obj.geometryType = pbf.readVarint();
else if (tag === 8)
obj.spatialReference = readFeatureCollectionPBufferSpatialReference(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 9)
obj.exceededTransferLimit = pbf.readBoolean();
else if (tag === 10)
obj.hasZ = pbf.readBoolean();
else if (tag === 11)
obj.hasM = pbf.readBoolean();
else if (tag === 12)
obj.transform = readFeatureCollectionPBufferTransform(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 13)
obj.fields.push(readFeatureCollectionPBufferField(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 14)
obj.values.push(readFeatureCollectionPBufferValue(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 15)
obj.features.push(readFeatureCollectionPBufferFeature(pbf, pbf.readVarint() + pbf.pos));
else if (tag === 16)
obj.geometryFields.push(readFeatureCollectionPBufferGeometryField(pbf, pbf.readVarint() + pbf.pos));
}
function writeFeatureCollectionPBufferFeatureResult(obj, pbf) {
if (obj.objectIdFieldName)
pbf.writeStringField(1, obj.objectIdFieldName);
if (obj.uniqueIdField)
pbf.writeMessage(2, writeFeatureCollectionPBufferUniqueIdField, obj.uniqueIdField);
if (obj.globalIdFieldName)
pbf.writeStringField(3, obj.globalIdFieldName);
if (obj.geohashFieldName)
pbf.writeStringField(4, obj.geohashFieldName);
if (obj.geometryProperties)
pbf.writeMessage(5, writeFeatureCollectionPBufferGeometryProperties, obj.geometryProperties);
if (obj.serverGens)
pbf.writeMessage(6, writeFeatureCollectionPBufferServerGens, obj.serverGens);
if (obj.geometryType)
pbf.writeVarintField(7, obj.geometryType);
if (obj.spatialReference)
pbf.writeMessage(8, writeFeatureCollectionPBufferSpatialReference, obj.spatialReference);
if (obj.exceededTransferLimit)
pbf.writeBooleanField(9, obj.exceededTransferLimit);
if (obj.hasZ)
pbf.writeBooleanField(10, obj.hasZ);
if (obj.hasM)
pbf.writeBooleanField(11, obj.hasM);
if (obj.transform)
pbf.writeMessage(12, writeFeatureCollectionPBufferTransform, obj.transform);
if (obj.fields)
for (const item of obj.fields)
pbf.writeMessage(13, writeFeatureCollectionPBufferField, item);
if (obj.values)
for (const item of obj.values)
pbf.writeMessage(14, writeFeatureCollectionPBufferValue, item);
if (obj.features)
for (const item of obj.features)
pbf.writeMessage(15, writeFeatureCollectionPBufferFeature, item);
if (obj.geometryFields)
for (const item of obj.geometryFields)
pbf.writeMessage(16, writeFeatureCollectionPBufferGeometryField, item);
}
function readFeatureCollectionPBufferCountResult(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferCountResultField, { count: 0 }, end);
}
function _readFeatureCollectionPBufferCountResultField(tag, obj, pbf) {
if (tag === 1)
obj.count = pbf.readVarint();
}
function writeFeatureCollectionPBufferCountResult(obj, pbf) {
if (obj.count)
pbf.writeVarintField(1, obj.count);
}
function readFeatureCollectionPBufferObjectIdsResult(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferObjectIdsResultField, { objectIdFieldName: "", serverGens: undefined, objectIds: [] }, end);
}
function _readFeatureCollectionPBufferObjectIdsResultField(tag, obj, pbf) {
if (tag === 1)
obj.objectIdFieldName = pbf.readString();
else if (tag === 2)
obj.serverGens = readFeatureCollectionPBufferServerGens(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 3)
pbf.readPackedVarint(obj.objectIds);
}
function writeFeatureCollectionPBufferObjectIdsResult(obj, pbf) {
if (obj.objectIdFieldName)
pbf.writeStringField(1, obj.objectIdFieldName);
if (obj.serverGens)
pbf.writeMessage(2, writeFeatureCollectionPBufferServerGens, obj.serverGens);
if (obj.objectIds)
pbf.writePackedVarint(3, obj.objectIds);
}
function readFeatureCollectionPBufferExtentCountResult(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferExtentCountResultField, { extent: undefined, count: 0 }, end);
}
function _readFeatureCollectionPBufferExtentCountResultField(tag, obj, pbf) {
if (tag === 1)
obj.extent = readFeatureCollectionPBufferEnvelope(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 2)
obj.count = pbf.readVarint();
}
function writeFeatureCollectionPBufferExtentCountResult(obj, pbf) {
if (obj.extent)
pbf.writeMessage(1, writeFeatureCollectionPBufferEnvelope, obj.extent);
if (obj.count)
pbf.writeVarintField(2, obj.count);
}
function readFeatureCollectionPBufferQueryResult(pbf, end) {
return pbf.readFields(_readFeatureCollectionPBufferQueryResultField, {
featureResult: undefined,
Results: undefined,
countResult: undefined,
idsResult: undefined,
extentCountResult: undefined
}, end);
}
function _readFeatureCollectionPBufferQueryResultField(tag, obj, pbf) {
if (tag === 1) {
obj.featureResult = readFeatureCollectionPBufferFeatureResult(pbf, pbf.readVarint() + pbf.pos);
obj.Results = "featureResult";
}
else if (tag === 2) {
obj.countResult = readFeatureCollectionPBufferCountResult(pbf, pbf.readVarint() + pbf.pos);
obj.Results = "countResult";
}
else if (tag === 3) {
obj.idsResult = readFeatureCollectionPBufferObjectIdsResult(pbf, pbf.readVarint() + pbf.pos);
obj.Results = "idsResult";
}
else if (tag === 4) {
obj.extentCountResult = readFeatureCollectionPBufferExtentCountResult(pbf, pbf.readVarint() + pbf.pos);
obj.Results = "extentCountResult";
}
}
function writeFeatureCollectionPBufferQueryResult(obj, pbf) {
if (obj.featureResult)
pbf.writeMessage(1, writeFeatureCollectionPBufferFeatureResult, obj.featureResult);
if (obj.countResult)
pbf.writeMessage(2, writeFeatureCollectionPBufferCountResult, obj.countResult);
if (obj.idsResult)
pbf.writeMessage(3, writeFeatureCollectionPBufferObjectIdsResult, obj.idsResult);
if (obj.extentCountResult)
pbf.writeMessage(4, writeFeatureCollectionPBufferExtentCountResult, obj.extentCountResult);
}
//# sourceMappingURL=PbfFeatureCollectionV2.js.map