# Thematic features on Business Data

**URL:** <https://community.thinkgeo.com/t/thematic-features-on-business-data/1783>\
**Category:** WinForms\
**Created:** [September 5, 2011, 8:41am UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783 "2011-09-05T08:41:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@Eric](https://community.thinkgeo.com/u/Eric)\
**Post date:** [September 5, 2011, 8:41am UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/1 "2011-09-05T08:41:03Z")

</div>

Hello,

I'm&nbsp;not&nbsp;sure&nbsp;I&nbsp;understand&nbsp;the&nbsp;interest&nbsp;of&nbsp;the&nbsp;event&nbsp;"FeatureSource.CustomColumnFetch"&nbsp;to&nbsp;apply&nbsp;a&nbsp;ClassBreakStyle&nbsp;on&nbsp;business&nbsp;data&nbsp;from&nbsp;SQL&nbsp;Database.

In&nbsp;my&nbsp;case,&nbsp;the&nbsp;shapefile&nbsp;contains&nbsp;approximately&nbsp;10,000&nbsp;features,&nbsp;the&nbsp;business&nbsp;data&nbsp;concern&nbsp;only&nbsp;100&nbsp;features&nbsp;spread&nbsp;over&nbsp;the&nbsp;entire&nbsp;shapefile.

It&nbsp;seems&nbsp;to&nbsp;me&nbsp;"CustomColumnFetch"&nbsp;is&nbsp;fired&nbsp;for&nbsp;each&nbsp;feature&nbsp;to&nbsp;display&nbsp;(10,000&nbsp;times&nbsp;in&nbsp;the&nbsp;first&nbsp;display,&nbsp;if&nbsp;fullextent),&nbsp;then&nbsp;each&nbsp;refresh&nbsp;(zoom&nbsp;in&nbsp;/&nbsp;out,&nbsp;...)&nbsp;as&nbsp;many&nbsp;times&nbsp;as&nbsp;features&nbsp;to&nbsp;display.&nbsp;Which&nbsp;is&nbsp;not&nbsp;very&nbsp;fluid.

Is&nbsp;there&nbsp;another&nbsp;way&nbsp;to&nbsp;do&nbsp;it?&nbsp;with&nbsp;InMemoryFeatureLayer&nbsp;to&nbsp;create&nbsp;a&nbsp;column&nbsp;to&nbsp;store&nbsp;business&nbsp;data&nbsp;(100&nbsp;features)&nbsp;and&nbsp;apply&nbsp;the&nbsp;style&nbsp;based&nbsp;on&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;layer&nbsp;column,&nbsp;only&nbsp;one&nbsp;time&nbsp;?

Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;advice.

---

<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:** [September 5, 2011, 12:20pm UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/2 "2011-09-05T12:20:21Z")

</div>

Eric,&nbsp;  
&nbsp;&nbsp;  
&nbsp;There&nbsp;are&nbsp;two&nbsp;ways&nbsp;to&nbsp;make&nbsp;it&nbsp;fluid,&nbsp;one&nbsp;is&nbsp;split&nbsp;shape&nbsp;files&nbsp;by&nbsp;different&nbsp;type&nbsp;column&nbsp;values,&nbsp;if&nbsp;you&nbsp;don’t&nbsp;want&nbsp;to&nbsp;split&nbsp;it,&nbsp;you&nbsp;can&nbsp;build&nbsp;custom&nbsp;indexes,&nbsp;you&nbsp;can&nbsp;find&nbsp;sample&nbsp;code&nbsp;at&nbsp;[wiki.thinkgeo.com/wiki/Map\_Suite\_Desktop\_Edition\_All\_Samples#Build\_Custom\_Shapefile\_Indexes](http://wiki.thinkgeo.com/wiki/Map_Suite_Desktop_Edition_All_Samples#Build_Custom_Shapefile_Indexes)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;questions.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;James

---

<div class="post-metadata">

**Author:** ![Eric](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@Eric](https://community.thinkgeo.com/u/Eric)\
**Post date:** [September 6, 2011, 1:31am UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/3 "2011-09-06T01:31:00Z")

</div>

James,&nbsp;Thank&nbsp;you&nbsp;for&nbsp;this&nbsp;solution.

However,&nbsp;this&nbsp;does&nbsp;not&nbsp;answer&nbsp;to&nbsp;my&nbsp;problem.

This&nbsp;geographical&nbsp;analysis,&nbsp;for&nbsp;which&nbsp;the&nbsp;user&nbsp;queries&nbsp;the&nbsp;data&nbsp;in&nbsp;a&nbsp;database,&nbsp;involve&nbsp;100&nbsp;features&nbsp;(among&nbsp;the&nbsp;10000&nbsp;possible)&nbsp;in&nbsp;the&nbsp;shapefile,&nbsp;which&nbsp;are&nbsp;not&nbsp;known&nbsp;in&nbsp;advance&nbsp;and&nbsp;change&nbsp;each&nbsp;user&nbsp;request.  
  
Thus,&nbsp;it&nbsp;is&nbsp;not&nbsp;possible&nbsp;to&nbsp;provide&nbsp;a&nbsp;split&nbsp;or&nbsp;an&nbsp;index&nbsp;in&nbsp;advance

I&nbsp;found&nbsp;that&nbsp;the&nbsp;method&nbsp;using&nbsp;the&nbsp;event&nbsp;CustomColumnFetch&nbsp;works&nbsp;at&nbsp;each&nbsp;refresh,&nbsp;by&nbsp;looping&nbsp;through&nbsp;each&nbsp;feature&nbsp;of&nbsp;the&nbsp;shapefile,&nbsp;to&nbsp;populate&nbsp;the&nbsp;ColumnValue&nbsp;to&nbsp;be&nbsp;considered&nbsp;for&nbsp;the&nbsp;display&nbsp;of&nbsp;style.

In&nbsp;my&nbsp;case,&nbsp;it&nbsp;seemed&nbsp;to&nbsp;me&nbsp;more&nbsp;efficient,&nbsp;to&nbsp;reverse&nbsp;the&nbsp;logic&nbsp;by&nbsp;looping&nbsp;over&nbsp;the&nbsp;100&nbsp;datatable&nbsp;rows&nbsp;resulting&nbsp;of&nbsp;the&nbsp;user's&nbsp;query,&nbsp;only&nbsp;to&nbsp;draw&nbsp;the&nbsp;style&nbsp;of&nbsp;the&nbsp;features&nbsp;involved&nbsp;(and&nbsp;only&nbsp;one&nbsp;time,&nbsp;not&nbsp;at&nbsp;each&nbsp;refresh).

So&nbsp;I&nbsp;am&nbsp;looking&nbsp;for&nbsp;a&nbsp;sample&nbsp;in&nbsp;order&nbsp;to&nbsp;create&nbsp;an&nbsp;InMemoryFeatureLayer,&nbsp;then&nbsp;create&nbsp;a&nbsp;column&nbsp;in&nbsp;it,&nbsp;populate&nbsp;this&nbsp;column&nbsp;with&nbsp;business&nbsp;data,&nbsp;and&nbsp;apply&nbsp;style&nbsp;on&nbsp;this&nbsp;column.  
  
Is&nbsp;that&nbsp;possible&nbsp;?  
  
Thanks.

---

<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:** [September 6, 2011, 10:00am UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/4 "2011-09-06T10:00:26Z")

</div>

&nbsp;Eric,

I&nbsp;attached&nbsp;the&nbsp;sample&nbsp;code&nbsp;to&nbsp;show&nbsp;you&nbsp;how&nbsp;to&nbsp;use&nbsp;InMemroyFeaturelayer

` InMemoryFeatureLayer austinStreetsLabelLayer = new InMemoryFeatureLayer();            austinStreetsLabelLayer.Open();            austinStreetsLabelLayer.Columns.Add(new FeatureSourceColumn("FENAME"));            austinStreetsLabelLayer.Close();            Feature feature = new Feature(new PointShape(1, 2));            feature.ColumnValues.Add("FENAME", "value");            austinStreetsLabelLayer.InternalFeatures.Add(feature);            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(TextStyles.LocalRoad1("FENAME"));            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;`

Thanks,

James

---

<div class="post-metadata">

**Author:** ![Eric](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/898d66/32.png) [@Eric](https://community.thinkgeo.com/u/Eric)\
**Post date:** [September 7, 2011, 10:53am UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/5 "2011-09-07T10:53:40Z")

</div>

OK&nbsp;thank&nbsp;you&nbsp;very&nbsp;much&nbsp;James.  
  
That's&nbsp;exactly&nbsp;what&nbsp;I&nbsp;was&nbsp;looking,&nbsp;to&nbsp;push&nbsp;the&nbsp;custom&nbsp;data&nbsp;in&nbsp;the&nbsp;layer.

---

<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:** [September 7, 2011, 12:33pm UTC](https://community.thinkgeo.com/t/thematic-features-on-business-data/1783/6 "2011-09-07T12:33:03Z")

</div>

Eric,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
