Hi
I'm getting an exception thrown when I call QueryTools.GetFeaturesNearestTo
Details below. Running v6.0.178.0.
If checked IsValid - returned True.
I tried MakeValid - still crashed.
Works OK when I zoom into the map using box zoom. Fails when I quickly zoom in using ChangeScale.
Any ideas?
Here is the code:
Collection<Feature> features = featureLayer.QueryTools.GetFeaturesNearestTo(feature.ShapeFeature,
GeographyUnit.Meter, 1, ReturningColumnsType.AllColumns);
Here is the error message:
24144: This operation cannot be completed because the instance is not valid. Use MakeValid to convert the instance to a valid instance. Note that MakeValid may cause the points of a geometry instance to shift slightly.
Here is the stack Trace:
at Microsoft.SqlServer.Types.SqlGeometry.ThrowIfInvalid()
at Microsoft.SqlServer.Types.SqlGeometry.STIntersects(SqlGeometry other)
at ThinkGeo.MapSuite.Core.BaseShape.IntersectsCore(BaseShape targetShape)
at ThinkGeo.MapSuite.Core.BaseShape.Intersects(BaseShape targetShape)
at ThinkGeo.MapSuite.Core.PolygonShape.GetDistanceToCore(BaseShape targetShape, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.BaseShape.GetDistanceTo(BaseShape targetShape, GeographyUnit shapeUnit, DistanceUnit distanceUnit)
at ThinkGeo.MapSuite.Core.FeatureSource.IBQ=(Collection`1 IRQ=, BaseShape IhQ=, GeographyUnit IxQ=, Int32 JBQ=)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestToCore(BaseShape targetShape, GeographyUnit unitOfData, Int32 maxItemsToFind, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestTo(BaseShape targetShape, GeographyUnit unitOfFeatureSource, Int32 maxItemsToFind, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestTo(Feature targetFeature, GeographyUnit unitOfData, Int32 maxItemsToFind, IEnumerable`1 returningColumnNames)
at ThinkGeo.MapSuite.Core.FeatureSource.GetFeaturesNearestTo(Feature targetFeature, GeographyUnit unitOfData, Int32 maxItemsToFind, ReturningColumnsType returningColumnNamesType)
at ThinkGeo.MapSuite.Core.QueryTools.GetFeaturesNearestTo(Feature targetFeature, GeographyUnit unitOfData, Int32 maxItemsToFind, ReturningColumnsType returningColumnNamesType)
Cheers
Steve