ThinkGeo.com    |     Documentation    |     Premium Support

Returning feature in data query

Greetings,


I would like to return all the features and its data based on a column value.  Currently, I am using layer.FeatureSource.ExecuteQuery to get the dataset, and then call layer.FeatureSource.GetFeaturesByColumnValue to get the specific feature.  I was wondering if there was a better/quicker way to do this.


Thank you for your time and help,


.Ryan.



Ryan, 
  
   The way you are doing seems like the best now however it seems like the GetFeaturesByColumnValue is not as useful an API as it could be.  I mean that it should have an additional overload for you to specify what column values you want returned like all, a single one or a collection of values.  In that case you could use the one API and not have to use the SQL query. 
  
   Underneath the API for shape files are least there is just the DBF and there is not a very good way to get records by column without iterating through all of the records and checking the values.  I think at least if we did the changes above that you would only need to loop through once.  I will record this and see if we can put this in next week.  We will also add this to the Layer.QueryTools object as that is were it should also be. 
  
 Can you respond back to this post to keep in on our radar? 
  
 David 
  


Thanks David, that sounds like it might work.  What I am specifically trying to do is grab all the features and their corresponding data that have any value for a specific column (where column <> '').  Unsure if your suggestion would allow me to do this or not, and if not I'll just have to do it the other way, but either way I do think the addition you suggested would be beneficial for me in the future for upcoming items I will be implementing.


Thank you so much for your help.


Ryan



Ryan, 
  
 We are now working the best solution for this, and if any progress we will let you know as soon as possible. If you want, please response back to keep this thread alive. 
  
 Thanks. 
  
 Yale 


Thanks for the update, Yale.



Ryan,


We have a public refresh update which added two Overloads for the API GetFeaturesByColumnValue. You can get it from below link or contact or support:
gis.thinkgeo.com/Products/Ma...fault.aspx
 
Hope it helps.
Any more questions please feel free to let me know.
 
Thanks.
 
Yale

Ryan, 



I am sorry that I forget to let you that even with the new added APIs, we cannot supported the <> logic described in your previous post, These APIs only support the == logic. 



Any more questions please feel free to let me know. 



Thanks. 



Yale