# QueryTools Borken in InMemoryFeatureLayer?

**URL:** <https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815>\
**Category:** WinForms\
**Created:** [October 20, 2011, 6:24am UTC](https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815 "2011-10-20T06:24:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ioannis](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/ad7895/32.png) [@Ioannis](https://community.thinkgeo.com/u/Ioannis)\
**Post date:** [October 20, 2011, 6:24am UTC](https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815/1 "2011-10-20T06:24:24Z")

</div>

Hello&nbsp;people,

I&nbsp;am&nbsp;a&nbsp;little&nbsp;bit&nbsp;desperate&nbsp;here&nbsp;as&nbsp;the&nbsp;QueryTools&nbsp;does&nbsp;not&nbsp;seems&nbsp;to&nbsp;work&nbsp;as&nbsp;advertised&nbsp;in&nbsp;for&nbsp;the&nbsp;MemoryFeatureLayer.&nbsp;I&nbsp;am&nbsp;using&nbsp;version&nbsp;5.0.124&nbsp;but&nbsp;the&nbsp;problem&nbsp;has&nbsp;been&nbsp;present&nbsp;since&nbsp;5.0.0.&nbsp;Here&nbsp;is&nbsp;the&nbsp;problem:

1.&nbsp;I&nbsp;Create&nbsp;an&nbsp;InMemoryFeatureLayer.&nbsp;When&nbsp;I&nbsp;populate&nbsp;it&nbsp;and&nbsp;I&nbsp;inspect&nbsp;it&nbsp;in&nbsp;VisualStudio&nbsp;I&nbsp;can&nbsp;see&nbsp;that&nbsp;it&nbsp;has&nbsp;3600&nbsp;InternalFeatures.&nbsp;If&nbsp;I&nbsp;further&nbsp;inspect&nbsp;these&nbsp;3600&nbsp;InternalFeatures&nbsp;I&nbsp;can&nbsp;see&nbsp;that&nbsp;they&nbsp;all&nbsp;have&nbsp;a&nbsp;column&nbsp;named&nbsp;"Georef"&nbsp;(key)&nbsp;with&nbsp;a&nbsp;Corresponing&nbsp;String&nbsp;(value)&nbsp;Value.

2.&nbsp;If&nbsp;I&nbsp;now&nbsp;do&nbsp;aLayer.QueryTools.GetFeaturesIntersecting(aShape,&nbsp;New&nbsp;String()&nbsp;{"Georef"})&nbsp;I&nbsp;get&nbsp;back&nbsp;the&nbsp;features&nbsp;that&nbsp;are&nbsp;interesected&nbsp;but&nbsp;with&nbsp;NO&nbsp;Column&nbsp;values.&nbsp;Instead&nbsp;if&nbsp;I&nbsp;inpsect&nbsp;them&nbsp;I&nbsp;can&nbsp;see&nbsp;that&nbsp;there&nbsp;is&nbsp;a&nbsp;column&nbsp;Georef&nbsp;as&nbsp;key&nbsp;but&nbsp;with&nbsp;no&nbsp;value.

3.&nbsp;If&nbsp;I&nbsp;do&nbsp;aLayer.QueryTools.GetFeaturesIntersecting(aShape,&nbsp;ReturningColumnsType.AllColumns)&nbsp;I&nbsp;get&nbsp;no&nbsp;columns&nbsp;at&nbsp;all.

4.&nbsp;The&nbsp;only&nbsp;way&nbsp;I&nbsp;found&nbsp;to&nbsp;have&nbsp;this&nbsp;working&nbsp;is&nbsp;to&nbsp;add&nbsp;my&nbsp;"key"&nbsp;or&nbsp;in&nbsp;general&nbsp;the&nbsp;information&nbsp;I&nbsp;need&nbsp;to&nbsp;"remain&nbsp;available"&nbsp;after&nbsp;the&nbsp;SpatialQuery,&nbsp;as&nbsp;the&nbsp;TAG&nbsp;of&nbsp;the&nbsp;feature.

So&nbsp;In&nbsp;order&nbsp;to&nbsp;recoup,&nbsp;I&nbsp;think&nbsp;there&nbsp;is&nbsp;a&nbsp;bug&nbsp;at&nbsp;QueryTools/SpatialQuery&nbsp;on&nbsp;the&nbsp;InmemoryFeature&nbsp;layer.&nbsp;The&nbsp;bug&nbsp;is&nbsp;that&nbsp;possibly&nbsp;the&nbsp;Spatial&nbsp;Query&nbsp;copies&nbsp;the&nbsp;correct&nbsp;Feature.ID,&nbsp;the&nbsp;correct&nbsp;Feature.Tag&nbsp;but&nbsp;fails&nbsp;to&nbsp;copy&nbsp;the&nbsp;Columns&nbsp;(some&nbsp;or&nbsp;all&nbsp;of&nbsp;them).

Any&nbsp;help&nbsp;will&nbsp;be&nbsp;much&nbsp;appreciated.

Kind&nbsp;Regards

Yiannis

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [October 22, 2011, 12:32am UTC](https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815/2 "2011-10-22T00:32:23Z")

</div>

Ioannis,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;the&nbsp;Columns&nbsp;of&nbsp;your&nbsp;in&nbsp;memory&nbsp;feature&nbsp;layer&nbsp;is&nbsp;not&nbsp;included&nbsp;the&nbsp;column&nbsp;of&nbsp;the&nbsp;feature,&nbsp;you&nbsp;can&nbsp;add&nbsp;them&nbsp;by&nbsp;following&nbsp;code.&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inMemoryLayer.Open();&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inMemoryLayer.Columns.Add(new&nbsp;FeatureSourceColumn("myColumn"));&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inMemoryLayer.Close();&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;James&nbsp;

---

<div class="post-metadata">

**Author:** ![Ioannis](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/i/ad7895/32.png) [@Ioannis](https://community.thinkgeo.com/u/Ioannis)\
**Post date:** [October 22, 2011, 3:59am UTC](https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815/3 "2011-10-22T03:59:48Z")

</div>

Spot&nbsp;on&nbsp;James,&nbsp;I&nbsp;bet&nbsp;this&nbsp;must&nbsp;be&nbsp;a&nbsp;common&nbsp;question&nbsp;from&nbsp;people&nbsp;like&nbsp;me&nbsp;who&nbsp;easily&nbsp;forget.&nbsp;I&nbsp;would&nbsp;suggest&nbsp;however&nbsp;to&nbsp;implement&nbsp;some&nbsp;kind&nbsp;of&nbsp;Exception&nbsp;when&nbsp;someone&nbsp;tries&nbsp;to&nbsp;insert&nbsp;columns&nbsp;that&nbsp;have&nbsp;not&nbsp;been&nbsp;explicitly&nbsp;declared&nbsp;on&nbsp;the&nbsp;layer.

In&nbsp;any&nbsp;case&nbsp;accept&nbsp;my&nbsp;apologises.

Kind&nbsp;Regards

Yiannis

---

<div class="post-metadata">

**Author:** ![Gary2](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/49beb7/32.png) [@Gary2](https://community.thinkgeo.com/u/Gary2)\
**Post date:** [October 24, 2011, 7:37am UTC](https://community.thinkgeo.com/t/querytools-borken-in-inmemoryfeaturelayer/1815/4 "2011-10-24T07:37:08Z")

</div>

Hello&nbsp;Ioannis,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;advise,&nbsp;we&nbsp;will&nbsp;consider&nbsp;that&nbsp;in&nbsp;our&nbsp;5.5.0&nbsp;release.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
