ThinkGeo.com    |     Documentation    |     Premium Support

Point layer

Hi,


I've looked at the example "GetDataWhenUserClick".  I have tried this on a point layer but I can't seem to get it to work.  It always returns 0 selectedFeatures.  It works fine on a polygon layer but I have to do this on a point layer. I have used the GetFeaturesContaining(e.Position statement as in the example.


Does anyone knows how to get the information on a point layer?


Thanks,


Sonja


 


 



Greetings.  I'm having the same issue with a line style layer.  No matter where I click on the a road, I can't seem to get a hit from the GetFeaturesContaining method.  I haven't tried a point style layer yet.  It works fine for an area style layer.


Binu



Hi, 
  
 I found a solution for the point and line layers.  I’m using the layer.QueryTools.GetFeaturesWithinDistanceOf(e.Position, GeographyUnit.Meter, DistanceUnit.Meter, 0.5, ReturningColumnsType.AllColumns); statement instead of the GetFeaturesContaining.  This does however return at times more than one selected feature (if the features are close to each other).  
  
  I don’t know if there is another way.  I would prefer it if a user can select only one item at a time, especially with the delete of a feature but I haven’t figure that out yet.   
  
 Thanks, 
 Sonja 


Sonja and Binu, 
  
 The PointLayer.QueryTools.GetFeaturesContaining(PointShape) returns records only if the PointShape is identical with one point in PointLayer, that’s almost impossible by adding points manually by our hands, even it seems they are totally override, but in fact they are not. That’s the same case for points and LineShapeLayers. So I think Binu’s way is good, just provide some buffer to get the matched result. Also we can generate a small rectangle based on the clicked position, and see if it contains any points or overlaps with any lines to get the matched record. If it returns more than one record, we can do some calculation to get the shortest one if we only have one ticket. 
  
 Thanks, 
  
 Ben