ThinkGeo.com    |     Documentation    |     Premium Support

Error with GetFeaturesWithinDistanceOf

I'm using the release version 3.1 of the web edition. I am getting a strange error on at some points when I call GetFeaturesWithinDistanceOf. Here is my line of code:



 



var features = layer.QueryTools.GetFeaturesWithinDistanceOf(e.Position, GeographyUnit.Meter, DistanceUnit.Meter, double.Parse(Configuration.GetConfigurationElement("GISSearchRadius")), columnNames);

The GISSearchRadius is .3, and e.Position =  


-  e.Position {ThinkGeo.MapSuite.Core.PointShape} ThinkGeo.MapSuite.Core.PointShape

+  base {ThinkGeo.MapSuite.Core.PointShape} ThinkGeo.MapSuite.Core.PointBaseShape {ThinkGeo.MapSuite.Core.PointShape}

  CanRotate true bool

  X 2460352.5213927007 double

  Y 5734096.3710874338 double

  Z 0.0 double


The error only occurs on one layer in a certain area. The error I get is:


"The shape you provided does not pass our simple validation.The shape you provided does not pass our simple validation."


What validation am I breaking???? The API should tell me what validation I have broken.




Christian, 
  
 After getting data from data source, we will do a “simple validation” and check if the data can be converted to a feature. As there are whole bunch of different situations that cannot pass the validation we couldn’t list all of them, but we only have the exception “cannot pass the simple validation”. Usually that exceptions means some data read from the data source cannot be converted to a feature (like a point, a polygon). 
  
  Can you have a quick test calling layer.QueryTools.GetAllFeatures() and see if it works fine? If it also throws that exception you can specify which feature has that problem by calling Layer.GetFeatureById() on every record. If all is fine, maybe something wrong when getting the data using the GetFeaturesWithinDistanceOf() method, then can you send that data to us and we do the test here? you can send it to support@thinkgeo.com and ask to forward to Ben. 
  
 Let me know if you have any issues. 
  
 Thanks, 
  
 Ben