# MultipleShapefileFeatureLayer

**URL:** <https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532>\
**Category:** WinForms\
**Created:** [July 7, 2009, 6:57am UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532 "2009-07-07T06:57:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [July 7, 2009, 6:57am UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/1 "2009-07-07T06:57:38Z")

</div>

I'm&nbsp;starting&nbsp;to&nbsp;use&nbsp;the&nbsp;WorldMapKit&nbsp;(and&nbsp;yes,&nbsp;I&nbsp;know&nbsp;there&nbsp;is&nbsp;a&nbsp;forum&nbsp;for&nbsp;that).&nbsp;&nbsp;&nbsp;The&nbsp;renderers&nbsp;in&nbsp;that&nbsp;package&nbsp;operate&nbsp;on&nbsp;a&nbsp;folder&nbsp;of&nbsp;shapefiles,&nbsp;and&nbsp;read&nbsp;them&nbsp;all&nbsp;into&nbsp;a&nbsp;MultipleShapefileFeatureLayer.&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;done&nbsp;by&nbsp;using&nbsp;a&nbsp;constructor&nbsp;that&nbsp;accepts&nbsp;a&nbsp;wildcard&nbsp;pattern&nbsp;for&nbsp;the&nbsp;shapefiles,&nbsp;and&nbsp;a&nbsp;single&nbsp;filename&nbsp;for&nbsp;an&nbsp;index&nbsp;file&nbsp;that&nbsp;covers&nbsp;the&nbsp;entire&nbsp;set&nbsp;of&nbsp;shapefiles.&nbsp;&nbsp;&nbsp;The&nbsp;extension&nbsp;of&nbsp;the&nbsp;index&nbsp;is&nbsp;an&nbsp;midx/mids&nbsp;pair,&nbsp;instead&nbsp;of&nbsp;the&nbsp;normal&nbsp;idx/ids&nbsp;pair.

This&nbsp;structure&nbsp;is&nbsp;a&nbsp;problem&nbsp;for&nbsp;us,&nbsp;because&nbsp;of&nbsp;the&nbsp;volume&nbsp;of&nbsp;the&nbsp;deployment,&nbsp;and&nbsp;any&nbsp;one&nbsp;customer&nbsp;is&nbsp;only&nbsp;interested&nbsp;in&nbsp;a&nbsp;single&nbsp;state.&nbsp;&nbsp;&nbsp;I'm&nbsp;exploring&nbsp;two&nbsp;options.&nbsp;&nbsp;&nbsp;We&nbsp;are&nbsp;going&nbsp;to&nbsp;deploy&nbsp;one&nbsp;DVD&nbsp;of&nbsp;common&nbsp;world&nbsp;and&nbsp;USA&nbsp;data&nbsp;to&nbsp;all&nbsp;customers,&nbsp;and&nbsp;then&nbsp;state-specific&nbsp;add-on&nbsp;DVD's&nbsp;to&nbsp;individuals.&nbsp;&nbsp;&nbsp;Having&nbsp;made&nbsp;this&nbsp;decision,&nbsp;I&nbsp;now&nbsp;have&nbsp;questions&nbsp;about&nbsp;the&nbsp;MultipleShapefileFeatureLayer&nbsp;that&nbsp;are&nbsp;more&nbsp;generic&nbsp;than&nbsp;the&nbsp;specific&nbsp;WorldMapKit&nbsp;application,&nbsp;hence&nbsp;posting&nbsp;here:

1)&nbsp;Is&nbsp;an&nbsp;midx/mids&nbsp;pair&nbsp;a&nbsp;"multiple&nbsp;file"&nbsp;version&nbsp;of&nbsp;the&nbsp;idx/ids&nbsp;pair?

2)&nbsp;The&nbsp;second&nbsp;parameter&nbsp;of&nbsp;the&nbsp;two&nbsp;parameter&nbsp;constructor&nbsp;is&nbsp;defined&nbsp;as&nbsp;an&nbsp;index&nbsp;name&nbsp;pattern.&nbsp;&nbsp;&nbsp;The&nbsp;shapefilename&nbsp;pattern&nbsp;is&nbsp;defined&nbsp;as&nbsp;"??lka40.shp",&nbsp;for&nbsp;instance,&nbsp;and&nbsp;the&nbsp;??&nbsp;matches&nbsp;the&nbsp;two&nbsp;state&nbsp;abbreviation,&nbsp;as&nbsp;there&nbsp;is&nbsp;an&nbsp;lka40&nbsp;file&nbsp;for&nbsp;each&nbsp;state.&nbsp;&nbsp;&nbsp;But&nbsp;in&nbsp;the&nbsp;WorldMapKit,&nbsp;the&nbsp;index&nbsp;name&nbsp;pattern&nbsp;is&nbsp;just&nbsp;"lka40.midx".&nbsp;&nbsp;&nbsp;There&nbsp;is&nbsp;only&nbsp;one&nbsp;index&nbsp;for&nbsp;all&nbsp;50&nbsp;state&nbsp;shapefiles.&nbsp;&nbsp;&nbsp;But.....&nbsp;&nbsp;could&nbsp;I&nbsp;build&nbsp;an&nbsp;idx/ids&nbsp;pair&nbsp;for&nbsp;each&nbsp;state&nbsp;shapefile,&nbsp;and&nbsp;then&nbsp;use&nbsp;"??lka.idx"&nbsp;as&nbsp;the&nbsp;index&nbsp;name&nbsp;pattern?&nbsp;&nbsp;&nbsp;Can&nbsp;the&nbsp;Multiple&nbsp;FeatureShapefile&nbsp;operate&nbsp;off&nbsp;of&nbsp;multiple&nbsp;index&nbsp;files,&nbsp;as&nbsp;the&nbsp;constructor&nbsp;parameter&nbsp;implies?

3)&nbsp;If&nbsp;the&nbsp;answer&nbsp;to&nbsp;question&nbsp;2)&nbsp;is&nbsp;yes,&nbsp;then&nbsp;are&nbsp;there&nbsp;performance&nbsp;hits&nbsp;for&nbsp;using&nbsp;multiple&nbsp;index&nbsp;files?&nbsp;&nbsp;&nbsp;Certainly&nbsp;not&nbsp;when&nbsp;only&nbsp;one&nbsp;shapefile&nbsp;is&nbsp;included,&nbsp;but&nbsp;how&nbsp;about&nbsp;two?&nbsp;&nbsp;ten?&nbsp;&nbsp;twenty?

4)&nbsp;The&nbsp;MultipleShapefileFeatureLayer&nbsp;BuildIndex&nbsp;has&nbsp;an&nbsp;overload&nbsp;defined&nbsp;as:&nbsp;&nbsp;ThinkGeo.MapSuite.Core.MultipleShapeFileFeatureLayer.BuildIndex(string,&nbsp;string,&nbsp;ThinkGeo.MapSuite.Core.BuildIndexMode),&nbsp;where&nbsp;the&nbsp;second&nbsp;parameter&nbsp;is&nbsp;defined&nbsp;as&nbsp;an&nbsp;indexFilenamePattern.&nbsp;&nbsp;Does&nbsp;this&nbsp;mean&nbsp;that&nbsp;if&nbsp;I&nbsp;call&nbsp;Buildindex&nbsp;with&nbsp;"??lka40.shp"&nbsp;as&nbsp;the&nbsp;shapefile&nbsp;pattern,&nbsp;and&nbsp;"??lka40.idx"&nbsp;as&nbsp;the&nbsp;index&nbsp;file&nbsp;pattern,&nbsp;that&nbsp;I&nbsp;would&nbsp;get&nbsp;a&nbsp;matching&nbsp;index&nbsp;for&nbsp;each&nbsp;shapefile?&nbsp;&nbsp;&nbsp;Or&nbsp;is&nbsp;that&nbsp;parameter&nbsp;really&nbsp;a&nbsp;little&nbsp;misnamed?&nbsp;

Is&nbsp;there&nbsp;any&nbsp;documentation&nbsp;on&nbsp;the&nbsp;MultipleShapefileFeatureLayer&nbsp;or&nbsp;MultipleShapefileFeatureSource?

Thanks!

&nbsp;

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [July 7, 2009, 1:06pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/2 "2009-07-07T13:06:27Z")

</div>

I&nbsp;did&nbsp;find&nbsp;a&nbsp;help&nbsp;file&nbsp;lurking&nbsp;in&nbsp;the&nbsp;documentation&nbsp;folder,&nbsp;and&nbsp;it&nbsp;describes&nbsp;the&nbsp;answers&nbsp;to&nbsp;several&nbsp;of&nbsp;my&nbsp;questions.&nbsp;&nbsp;&nbsp;However,&nbsp;I&nbsp;also&nbsp;tested&nbsp;those&nbsp;same&nbsp;suppositions,&nbsp;and&nbsp;I&nbsp;found&nbsp;that&nbsp;using&nbsp;a&nbsp;pattern&nbsp;for&nbsp;the&nbsp;indices&nbsp;did&nbsp;not&nbsp;work.&nbsp;&nbsp;&nbsp;Does&nbsp;evertying&nbsp;in&nbsp;the&nbsp;RC1&nbsp;still&nbsp;work&nbsp;as&nbsp;documented&nbsp;in&nbsp;this&nbsp;area?

---

<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:** [July 7, 2009, 7:51pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/3 "2009-07-07T19:51:49Z")

</div>

Ted,

Thanks&nbsp;for&nbsp;your&nbsp;post!  
&nbsp;  
I&nbsp;think&nbsp;if&nbsp;you&nbsp;notice&nbsp;the&nbsp;other&nbsp;usage&nbsp;of&nbsp;MultipleShapeFileFeatureLayer,&nbsp;most&nbsp;of&nbsp;your&nbsp;problem&nbsp;will&nbsp;be&nbsp;solved.  
&nbsp;  
Let&nbsp;us&nbsp;take&nbsp; **_??lka40.shp_** &nbsp;as&nbsp;example.&nbsp;There&nbsp;are&nbsp;2&nbsp;ways&nbsp;to&nbsp;use&nbsp;it&nbsp;a&nbsp;as&nbsp;MultipleShapeFileFeaureLayer.  
&nbsp;  
**_First&nbsp;way:&nbsp;Multiple&nbsp;shape&nbsp;file&nbsp;vs&nbsp;One&nbsp;midx/mids_**  
This&nbsp;is&nbsp;the&nbsp;way&nbsp;you&nbsp;talked&nbsp;about,&nbsp;but&nbsp;I&nbsp;do&nbsp;not&nbsp;think&nbsp;it&nbsp;is&nbsp;suitable&nbsp;for&nbsp;you&nbsp;because&nbsp;of&nbsp;your&nbsp;special&nbsp;deployment&nbsp;requirement&nbsp;as&nbsp;you&nbsp;said.  
&nbsp;  
**_Second&nbsp;way:&nbsp;Multiple&nbsp;shape&nbsp;file&nbsp;vs&nbsp;Multple&nbsp;midx/&nbsp;mids_**  
That&nbsp;is&nbsp;to&nbsp;say,&nbsp;one&nbsp;shape&nbsp;file&nbsp;will&nbsp;have&nbsp;one&nbsp;midx/mids&nbsp;as&nbsp;its&nbsp;RTree&nbsp;file,&nbsp;and&nbsp;this&nbsp;way&nbsp;will&nbsp;not&nbsp;cause&nbsp;obvious&nbsp;performance&nbsp;lost.  
&nbsp;  
When&nbsp;you&nbsp;build&nbsp;index,&nbsp;you&nbsp;can&nbsp;do&nbsp;as&nbsp;following:  
&nbsp;  
`MultipleShapeFileFeatureLayer.BuildIndex(@"??lka40.shp","??lka40.midx", BuildIndexMode.DoNotRebuild);`  
&nbsp;  
  
Also,&nbsp;when&nbsp;you&nbsp;create&nbsp;a&nbsp;MultipleShapeFileFeatureLayer,&nbsp;you&nbsp;can&nbsp;do&nbsp;it&nbsp;as&nbsp;following:

&nbsp;

`MultipleShapeFileFeatureLayer a = new MultipleShapeFileFeatureLayer(@"??lka40.shp", "??lka40.midx");`

In&nbsp;this&nbsp;way,&nbsp;you&nbsp;will&nbsp;have&nbsp;choice&nbsp;to&nbsp;deploy&nbsp;different&nbsp;data&nbsp;to&nbsp;different&nbsp;DVD&nbsp;without&nbsp;changing&nbsp;any&nbsp;codes.

&nbsp;  
I&nbsp;am&nbsp;not&nbsp;sure&nbsp;you&nbsp;get&nbsp;all&nbsp;answers&nbsp;you&nbsp;need&nbsp;with&nbsp;this,&nbsp;if&nbsp;not,&nbsp;do&nbsp;not&nbsp;hesitate&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks  
&nbsp;  
Yale  
  
&nbsp;

---

<div class="post-metadata">

**Author:** ![Ted](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/db5fbb/32.png) [@Ted](https://community.thinkgeo.com/u/Ted)\
**Post date:** [July 7, 2009, 9:34pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/4 "2009-07-07T21:34:51Z")

</div>

I&nbsp;tried&nbsp;creating&nbsp;a&nbsp;MultipleShapefileFeatureLayer&nbsp;using&nbsp;??lka40.idx&nbsp;(creating&nbsp;the&nbsp;.idx&nbsp;files&nbsp;from&nbsp;MapExplorer),&nbsp;and&nbsp;it&nbsp;did&nbsp;not&nbsp;work.&nbsp;&nbsp;Is&nbsp;there&nbsp;a&nbsp;difference&nbsp;between&nbsp;a&nbsp;.midx&nbsp;file&nbsp;and&nbsp;a&nbsp;.idx&nbsp;file?&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;suspect&nbsp;this&nbsp;is&nbsp;the&nbsp;case,&nbsp;and&nbsp;was&nbsp;my&nbsp;problem.&nbsp;  
&nbsp;&nbsp;  
&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:** [July 7, 2009, 9:42pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/5 "2009-07-07T21:42:36Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;sorry&nbsp;to&nbsp;say&nbsp;that&nbsp;the&nbsp;data&nbsp;format&nbsp;is&nbsp;different&nbsp;between&nbsp;.idx&nbsp;and&nbsp;.midx,&nbsp;now&nbsp;they&nbsp;are&nbsp;not&nbsp;compatible&nbsp;with&nbsp;each&nbsp;other.&nbsp;  
&nbsp;&nbsp;  
&nbsp;.idx/.ids&nbsp;is&nbsp;only&nbsp;for&nbsp;ShapeFileFeatureSource&nbsp;and&nbsp;ShapeFileFeatureLayer,&nbsp;this&nbsp;can&nbsp;be&nbsp;created&nbsp;with&nbsp;MapSuiteExplorer.&nbsp;  
&nbsp;&nbsp;  
&nbsp;.midx/.mids&nbsp;is&nbsp;only&nbsp;for&nbsp;MultipleShapeFileFeatureSource&nbsp;and&nbsp;MultpleShapeFileLayer,&nbsp;this&nbsp;cannot&nbsp;be&nbsp;created&nbsp;with&nbsp;MapSuite&nbsp;Explorer.&nbsp;It&nbsp;can&nbsp;only&nbsp;be&nbsp;created&nbsp;by&nbsp;static&nbsp;API&nbsp;provided&nbsp;above.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;problems!&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;

---

<div class="post-metadata">

**Author:** ![Adolfo](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@Adolfo](https://community.thinkgeo.com/u/Adolfo)\
**Post date:** [January 5, 2010, 5:04pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/6 "2010-01-05T17:04:19Z")

</div>

Yale,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;a&nbsp;question&nbsp;related&nbsp;to&nbsp;one&nbsp;of&nbsp;the&nbsp;constructor&nbsp;of&nbsp;MultipleShapeFileFeatureLayer:&nbsp;  
&nbsp;&nbsp;  
&nbsp;public&nbsp;static&nbsp;void&nbsp;BuildIndex(&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;multipleShapeFilePattern,&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;columnName,&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;regularExpression,&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;indexFilename&nbsp;  
&nbsp;)&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;various&nbsp;shapefiles&nbsp;with&nbsp;the&nbsp;same&nbsp;structure&nbsp;and&nbsp;I&nbsp;want&nbsp;to&nbsp;display&nbsp;only&nbsp;some&nbsp;in&nbsp;each&nbsp;shapefile.&nbsp;Can&nbsp;you&nbsp;give&nbsp;me&nbsp;an&nbsp;example&nbsp;on&nbsp;how&nbsp;to&nbsp;write&nbsp;the&nbsp;regular&nbsp;expression?&nbsp;For&nbsp;example&nbsp;how&nbsp;would&nbsp;you&nbsp;write&nbsp;the&nbsp;expression&nbsp;to&nbsp;get&nbsp;only&nbsp;the&nbsp;records&nbsp;above&nbsp;a&nbsp;certain&nbsp;value?&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you.

---

<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:** [January 5, 2010, 6:04pm UTC](https://community.thinkgeo.com/t/multipleshapefilefeaturelayer/532/7 "2010-01-05T18:04:06Z")

</div>

Adolfo,

&nbsp;  
I&nbsp;do&nbsp;not&nbsp;think&nbsp;you&nbsp;can&nbsp;just&nbsp;select&nbsp;part&nbsp;of&nbsp;the&nbsp;shape&nbsp;files&nbsp;from&nbsp;a&nbsp;same&nbsp;structure&nbsp;shape&nbsp;file&nbsp;folder&nbsp;which&nbsp;containing&nbsp;many&nbsp;shape&nbsp;files.&nbsp;We&nbsp;have&nbsp;considered&nbsp;to&nbsp;enhance&nbsp;this&nbsp;feature.&nbsp;Folllowing&nbsp;post(also&nbsp;created&nbsp;by&nbsp;you)&nbsp;talking&nbsp;about&nbsp;this,&nbsp;please&nbsp;take&nbsp;a&nbsp;look&nbsp;if&nbsp;you&nbsp;are&nbsp;interested.  
[gis.thinkgeo.com/Support/Dis...fault.aspx](http://gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/5921/afv/topic/Default.aspx)  
&nbsp;  
I&nbsp;am&nbsp;afraid&nbsp;the&nbsp;way&nbsp;now&nbsp;you&nbsp;can&nbsp;do&nbsp;is&nbsp;by&nbsp;move&nbsp;files&nbsp;you&nbsp;want&nbsp;to&nbsp;do&nbsp;into&nbsp;a&nbsp;separate&nbsp;folder.  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale
