# Cant Import Shapefile

**URL:** <https://community.thinkgeo.com/t/cant-import-shapefile/3966>\
**Category:** MVC\
**Created:** [April 11, 2012, 9:12am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966 "2012-04-11T09:12:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 11, 2012, 9:12am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/1 "2012-04-11T09:12:35Z")

</div>

Ive&nbsp;been&nbsp;trying&nbsp;to&nbsp;import&nbsp;my&nbsp;shapefile&nbsp;into&nbsp;the&nbsp;ASP.net&nbsp;framework&nbsp;using&nbsp;Mapsuite&nbsp;ASP.net&nbsp;but&nbsp;a&nbsp;message&nbsp;comes&nbsp;up&nbsp;when&nbsp;debugging&nbsp;the&nbsp;program&nbsp;requesting&nbsp;for&nbsp;a&nbsp;.idx&nbsp;file.&nbsp;The&nbsp;.idx&nbsp;file&nbsp;is&nbsp;available&nbsp;in&nbsp;the&nbsp;same&nbsp;folder&nbsp;of&nbsp;that&nbsp;of&nbsp;the&nbsp;actual&nbsp;shapefile&nbsp;im&nbsp;trying&nbsp;to&nbsp;import

I&nbsp;tried&nbsp;using&nbsp;ShapeFileFeatureSource.BuildinIndexFile&nbsp;aswel&nbsp;as&nbsp;ShapeFileFeaturLayer.BuildIndexFile&nbsp;and&nbsp;.RequiredIndex&nbsp;set&nbsp;to&nbsp;false.

This&nbsp;removes&nbsp;the&nbsp;message&nbsp;of&nbsp;the&nbsp;.idx&nbsp;file&nbsp;missing&nbsp;but&nbsp;no&nbsp;shapefile&nbsp;is&nbsp;still&nbsp;displayed&nbsp;when&nbsp;i&nbsp;run&nbsp;the&nbsp;program

Below&nbsp;is&nbsp;my&nbsp;code

Thank&nbsp;you

@

@

using&nbsp;ThinkGeo.MapSuite.MvcEditionusing&nbsp;ThinkGeo.MapSuite.Core

\<

div\>

@{

Html.ThinkGeo().Map(

.MapBackground(

.CurrentExtent(5,&nbsp;78,&nbsp;30,&nbsp;26)

.MapUnit(

.StaticOverlay(overlay&nbsp;=\>

{

&nbsp;

&nbsp;

"Map1",&nbsp;600,&nbsp;500)new&nbsp;BackgroundLayer(new&nbsp;GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"))))GeographyUnit.DecimalDegree)

&nbsp;

ShapeFileFeatureLayer&nbsp;layer&nbsp;=&nbsp;new&nbsp;ShapeFileFeatureLayer(@"F:\Maps\1ST&nbsp;FLOOR\BUILDING\Building.shp");

ShapeFileFeatureLayer

.BuildIndexFile(@"F:\Maps\1ST&nbsp;FLOOR\BUILDING\Building.shp");&nbsp;

layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle&nbsp;=

layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=

overlay.Layer(layer);

AreaStyles.Forest1;ApplyUntilZoomLevel.Level20;

})

.Render();

}

\</

div\>

---

<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:** [April 11, 2012, 3:19pm UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/2 "2012-04-11T15:19:39Z")

</div>

Hello&nbsp;Ross,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;your&nbsp;code&nbsp;looks&nbsp;like&nbsp;no&nbsp;problem,&nbsp;and&nbsp;if&nbsp;you&nbsp;set&nbsp;RequiredIndex&nbsp;&nbsp;to&nbsp;false,&nbsp;it&nbsp;will&nbsp;work&nbsp;even&nbsp;with&nbsp;out&nbsp;idx&nbsp;file.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;could&nbsp;you&nbsp;please&nbsp;check&nbsp;your&nbsp;shape&nbsp;file’s&nbsp;projection&nbsp;see&nbsp;if&nbsp;you&nbsp;set&nbsp;right,&nbsp;and&nbsp;if&nbsp;you&nbsp;can&nbsp;provide&nbsp;the&nbsp;shape&nbsp;file,&nbsp;we&nbsp;can&nbsp;do&nbsp;some&nbsp;test&nbsp;on&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;it’s&nbsp;too&nbsp;big&nbsp;to&nbsp;upload&nbsp;here,&nbsp;you&nbsp;can&nbsp;sent&nbsp;to&nbsp;[forumsupport@thinkgeo.com](mailto:forumsupport@thinkgeo.com)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 16, 2012, 3:01am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/3 "2012-04-16T03:01:46Z")

</div>

Gary&nbsp;ive&nbsp;sent&nbsp;a&nbsp;email&nbsp;containing&nbsp;the&nbsp;problem&nbsp;shapefile&nbsp;to&nbsp;[forumsupport@thinkgeo.com](mailto:forumsupport@thinkgeo.com)&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Could&nbsp;you&nbsp;see&nbsp;it&nbsp;in&nbsp;relation&nbsp;to&nbsp;this&nbsp;discussion

---

<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:** [April 16, 2012, 9:58am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/4 "2012-04-16T09:58:35Z")

</div>

Hello&nbsp;Ross,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;data,&nbsp;but&nbsp;I&nbsp;only&nbsp;got&nbsp;your&nbsp;Building.shp&nbsp;file,&nbsp;I&nbsp;need&nbsp;Building.shx&nbsp;and&nbsp;Building.dbf&nbsp;file,&nbsp;with&nbsp;this&nbsp;three&nbsp;file,&nbsp;we&nbsp;can&nbsp;open&nbsp;a&nbsp;shape&nbsp;file.&nbsp;Could&nbsp;you&nbsp;please&nbsp;send&nbsp;the&nbsp;rest&nbsp;of&nbsp;them&nbsp;to&nbsp;me?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 17, 2012, 12:51am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/5 "2012-04-17T00:51:28Z")

</div>

Apologies&nbsp;Gary&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ive&nbsp;sent&nbsp;the&nbsp;.shx&nbsp;and&nbsp;.dbf&nbsp;files&nbsp;to&nbsp;[forumsupport@thinkgeo.com](mailto:forumsupport@thinkgeo.com)&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;You&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ross

---

<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:** [April 17, 2012, 3:11pm UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/6 "2012-04-17T15:11:57Z")

</div>

Hello&nbsp;Ross,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;data,&nbsp;your&nbsp;shape&nbsp;file&nbsp;has&nbsp;no&nbsp;problem,&nbsp;and&nbsp;your&nbsp;code&nbsp;has&nbsp;no&nbsp;problem,&nbsp;the&nbsp;only&nbsp;reason&nbsp;is&nbsp;you&nbsp;set&nbsp;the&nbsp;wrong&nbsp;extent&nbsp;to&nbsp;the&nbsp;map,&nbsp;so&nbsp;that&nbsp;map&nbsp;shows&nbsp;not&nbsp;your&nbsp;shape&nbsp;at.&nbsp;Please&nbsp;try&nbsp;the&nbsp;extent&nbsp;below:&nbsp;  
&nbsp;&nbsp;  
&nbsp;(25.6696547960048,-33.9994236973752,25.6736244653469,-34.002256110095)&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary

---

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 18, 2012, 6:12am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/7 "2012-04-18T06:12:36Z")

</div>

Thanx&nbsp;Gary&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;will&nbsp;attempt&nbsp;to&nbsp;change&nbsp;the&nbsp;extent&nbsp;and&nbsp;notify&nbsp;you&nbsp;how&nbsp;it&nbsp;goes&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ross

---

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 18, 2012, 6:12am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/8 "2012-04-18T06:12:46Z")

</div>

Thanx&nbsp;Gary&nbsp;&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;will&nbsp;attempt&nbsp;to&nbsp;change&nbsp;the&nbsp;extent&nbsp;and&nbsp;notify&nbsp;you&nbsp;how&nbsp;it&nbsp;goes&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you&nbsp;  
&nbsp;&nbsp;  
&nbsp;Ross

---

<div class="post-metadata">

**Author:** ![Ross](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@Ross](https://community.thinkgeo.com/u/Ross)\
**Post date:** [April 18, 2012, 7:36am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/9 "2012-04-18T07:36:29Z")

</div>

Thanx&nbsp;alot&nbsp;Gary&nbsp;the&nbsp;importing&nbsp;of&nbsp;the&nbsp;shapefile&nbsp;was&nbsp;successful&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards&nbsp;&nbsp;  
&nbsp;Ross

---

<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:** [April 18, 2012, 9:50am UTC](https://community.thinkgeo.com/t/cant-import-shapefile/3966/10 "2012-04-18T09:50:01Z")

</div>

Hello&nbsp;Ross,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
