I am creating a buffered geometry around a point feature in order to search for other nearby features. I use the TopologicalOperator to create my buffered geometry. I am attempting to search a feature class when a ComException is thrown telling me that 'the number of points is less than required for feature'. I am unsure whether it is referring to the geometry I am searching with, which I have verified is a polygon with 129 points, or to a feature in the feature class that I am searching within. I have run an ArcObject routine to try and rid the various features classes of features with invalid geometries, but this error persists.
The data's SR is WGS84 with a XY resolution of .000000001. The MXD's projection is Web Mercator Auxiliary Sphere. I am buffering my points by 10 feet. The code works and buffer size work fine in the dev environment but is failing in the test environment.
Spatial Indexes on Search FCs
FC1
1.133126
0.000000
0.000000
FC2
0.310968
0.000000
0.000000
FC3
0.193221
0.000000
0.000000
Snippits of source below. Note that GeoUtil has several methods that will pull values off the ServerContext.
Create Buffered Geometry
private IGeometry GetBufferedGeometry(IFeature feature, int bufferFeet, GeodatabaseUtil geoUtil)
{
// Convert shape to Map's spatial reference
var geometry = feature.ShapeCopy;
geometry.Project(geoUtil.GetMapSpatialReference());
// Convert buffer feet to Map's distance units
IUnitConverter converter = new UnitConverterClass();
var bufferUnits = converter.ConvertUnits(bufferFeet, esriUnits.esriFeet, geoUtil.GetMapDistanceUnits());
// Buffer shape
var topoOp = geometry as ITopologicalOperator;
var bufferedGeometry = topoOp.Buffer(bufferUnits);
// Project buffered shape back to dataset projection
bufferedGeometry.Project(feature.Shape.SpatialReference);
return bufferedGeometry;
}
Search for features
// Create buffered filter
var spatialFilter = geoUtil.NewSpatialFilter();
spatialFilter.Geometry = GetBufferedGeometry(feature, searchBuffer, geoUtil);
spatialFilter.SpatialRel = info.SpatialRelationship;
// Search for features within filter
var featureCursor = searchClass.Search(spatialFilter, true);
var foundFeature = featureCursor.NextFeature();
while (foundFeature != null)
geometryvariable to represent two different objects. The first being the geometry of the feature, and the 2nd being the geometry of the buffer. I'm not completely sure, but that would at least be something to eliminate as a starting point. – Get Spatial Aug 27 '12 at 21:22IsKnownSimple_2-- I don't know why. See here: help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/… – blah238 Aug 27 '12 at 21:55