In a widget routine I want to perform a spatial query (intersect) with a negative distance buffer: create an effective search geometry that is smaller than the selected input.
Currently I am attempting to create a buffer using a geometry service with a negative distance:
var BP = new BufferParameters();
var gsvc = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
BP.bufferSpatialReference = featureSet.features.spatialReference;
BP.unit = GeometryService.UNIT_METER;
BP.distances = -5;
BP.geometries = featureSet.features.geometry;
//Define a Query: get all features from the target feature layer that intersect the geometry of the input featureset.feature
Q = new Query();
//Q.geometry = featureSet.features.geometry;
Q.geometry = PBuffer.geometry;
Q.outFields = [ "*" ];
Q.spatialRelationship = Query.SPATIAL_REL_INTERSECTS;
Q.returnGeometry = true;
//Q.distance = -5;
//Q.units = "meters";
In the browser console this throws the following error (line 39 is line 7 above):
TypeError: a.join is not a function
at Object.toJson (BufferParameters.js:5)
at Object.buffer (init.js:2274)
I've previously attempted to simply define a query distance, commented out in the code block, but that did not appear to have an affect.
What am I doing wrong and how to best achieve what I'm trying to do?