# FormatException with InMemoryGridFeatureSource.GetAllFeatures()

**URL:** <https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176>\
**Category:** Services\
**Created:** [January 30, 2013, 3:54am UTC](https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176 "2013-01-30T03:54:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marius](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@Marius](https://community.thinkgeo.com/u/Marius)\
**Post date:** [January 30, 2013, 3:54am UTC](https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176/1 "2013-01-30T03:54:19Z")

</div>

&nbsp;Hi,

I&nbsp;am&nbsp;attempting&nbsp;to&nbsp;get&nbsp;all&nbsp;the&nbsp;features&nbsp;from&nbsp;the&nbsp;interpolated&nbsp;grid&nbsp;as&nbsp;polygons&nbsp;using&nbsp;InMemoryGridFeatureSource&nbsp;as&nbsp;below&nbsp;but&nbsp;when&nbsp;I'm&nbsp;trying&nbsp;to&nbsp;retrieve&nbsp;the&nbsp;features,&nbsp;I&nbsp;get&nbsp;this&nbsp;exception:

`// Input data in WGS84var boundary = new Feature("POLYGON ((-90.282488000113517 33.580227999947965, -90.282328000059351 33.5802599999588, -90.2821919999551 33.5802599999588, -90.282016000011936 33.58027600008063, -90.2818879999686 33.580328000010923, -90.281815999886021 33.580456000054255, -90.281752000097185 33.580612000077963, -90.28170399996452 33.580739999888465, -90.281607999932021 33.5808679999318, -90.281560000032187 33.581055999966338, -90.281615999992937 33.581220000050962, -90.2817760000471 33.581336000002921, -90.281864000018686 33.581464000046253, -90.281840000068769 33.581607999978587, -90.281832000007853 33.581744000082836, -90.281752000097185 33.5818080001045, -90.2816800000146 33.581920000026, -90.281656000064686 33.582063999958336, -90.28164800000377 33.5822240000125, -90.28164800000377 33.582395999925211, -90.281639999942854 33.582575999898836, -90.281632000114769 33.58273999998346, -90.281624000053853 33.582891999976709, -90.281607999932021 33.583067999919876, -90.28159200004302 33.583227999974042, -90.281543999910355 33.58338399999775, -90.2814720000606 33.583559999940917, -90.2813919999171 33.583739999914542, -90.281327999895439 33.583931999979541, -90.2812640001066 33.584120000014082, -90.281224000034854 33.584304000018165, -90.281215999973938 33.584488000022247, -90.281200000084937 33.58467200002633, -90.2811680000741 33.584856000030413, -90.2810879999306 33.584971999982372, -90.280967999948189 33.584939999971539, -90.280967999948189 33.584772000089288, -90.281008000019938 33.584543999983, -90.281055999919772 33.584319999907166, -90.281104000052437 33.584111999953166, -90.281160000013188 33.583908000029624, -90.281215999973938 33.583692000014707, -90.2812959998846 33.583480000030249, -90.281327999895439 33.583347999956459, -90.2813760000281 33.583172000013292, -90.2813919999171 33.582951999967918, -90.281408000038937 33.582727999892086, -90.281408000038937 33.582515999907628, -90.281399999978021 33.582316000014544, -90.281416000099853 33.582123999949545, -90.281423999927938 33.58192400005646, -90.281479999888688 33.581748000113294, -90.2814879999496 33.581644000019878, -90.2813760000281 33.5816160000395, -90.2812799999956 33.581712000072, -90.281200000084937 33.581903999904171, -90.281112000113353 33.582159999990836, -90.281048000091687 33.582412000047043, -90.280959999887273 33.582660000072792, -90.2808640000876 33.582911999896169, -90.2807839999441 33.583167999982834, -90.280712000094354 33.583431999897584, -90.280608000000939 33.583696000045165, -90.280543999979272 33.583951999899, -90.280439999885857 33.584192000096664, -90.28035999997519 33.584439999889582, -90.280248000053689 33.584687999915332, -90.280224000103772 33.584911999991164, -90.280199999921024 33.585063999984413, -90.280128000071272 33.585147999925539, -90.280040000099689 33.585327999899164, -90.279944000067189 33.585547999944538, -90.279880000045523 33.585787999909371, -90.27979200007394 33.586024000076577, -90.279728000052273 33.58626400004141, -90.279655999969691 33.58651200006716, -90.279600000008941 33.586756000062451, -90.279576000059024 33.5870040000882, -90.279559999937192 33.587248000083491, -90.279567999998108 33.587492000078782, -90.279567999998108 33.587743999902159, -90.279583999887109 33.588004000019282, -90.279591999948025 33.588243999984115, -90.279600000008941 33.588479999918491, -90.279600000008941 33.588723999913782, -90.279608000069857 33.588952000020072, -90.279608000069857 33.589187999954447, -90.279600000008941 33.589440000010654, -90.279623999958858 33.589679999975488, -90.279632000019774 33.58990400005132, -90.279632000019774 33.590120000066236, -90.279687999980524 33.590328000020236, -90.279743999941275 33.590456000063568, -90.279728000052273 33.590572000015527, -90.279679999919608 33.590715999947861, -90.279679999919608 33.590916000073776, -90.279704000102356 33.591143999947235, -90.279704000102356 33.591391999972984, -90.279719999991357 33.591627999907359, -90.279719999991357 33.591860000044107, -90.279728000052273 33.592100000008941, -90.279728000052273 33.592324000084773, -90.27975200000219 33.592543999897316, -90.279880000045523 33.592671999940649, -90.280167999910191 33.592667999910191, -90.280520000029355 33.592643999960274, -90.280871999915689 33.592607999918982, -90.281239999923855 33.592568000080064, -90.28159200004302 33.592543999897316, -90.281960000051185 33.592495999997482, -90.282335999887437 33.592431999975815, -90.2826880000066 33.592384000075981, -90.28303200006485 33.592339999973774, -90.283383999951184 33.5923119999934, -90.2837119998876 33.592352000065148, -90.284008000046015 33.592491999967024, -90.284295999910682 33.592620000010356, -90.284560000058264 33.592731999931857, -90.284847999922931 33.592851999914274, -90.285112000070512 33.592964000068605, -90.285279999952763 33.593039999948815, -90.2853119999636 33.593056000070646, -90.285895999986678 33.593003999907523, -90.28591200010851 33.592956000007689, -90.285983999958262 33.592787999892607, -90.286071999929845 33.592560000019148, -90.286176000023261 33.592307999962941, -90.286279999883845 33.592027999926358, -90.286360000027344 33.591751999920234, -90.286432000109926 33.591468000086024, -90.286616000114009 33.591216000029817, -90.286888000089675 33.590991999953985, -90.287184000015259 33.590779999969527, -90.287472000112757 33.590563999954611, -90.287815999938175 33.590272000059485, -90.288127999985591 33.590071999933571, -90.288495999993756 33.589964000042528, -90.2887599999085 33.589791999896988, -90.288823999930173 33.589495999971405, -90.288928000023589 33.588823999976739, -90.288968000095338 33.588487999979407, -90.289031999884173 33.588136000093073, -90.28909599990584 33.587768000084907, -90.2891599999275 33.58736400003545, -90.289223999949172 33.586991999996826, -90.289360000053421 33.586251999950036, -90.289431999903172 33.585864000022411, -90.289551999885589 33.585483999922872, -90.28976000007242 33.585143999895081, -90.290015999926254 33.584836000110954, -90.290263999952 33.584531999891624, -90.290456000017 33.584263999946415, -90.2905520000495 33.584092000033706, -90.290608000010252 33.583916000090539, -90.290631999960169 33.583704000106081, -90.290648000082 33.583467999938875, -90.290672000031918 33.5832320000045, -90.290672000031918 33.583000000100583, -90.290672000031918 33.582759999902919, -90.290680000092834 33.582543999888, -90.29068799992092 33.582316000014544, -90.29068799992092 33.582084000110626, -90.290680000092834 33.58184799994342, -90.290695999981835 33.5816160000395, -90.290704000042751 33.581387999933213, -90.290695999981835 33.581167999887839, -90.290608000010252 33.581000000005588, -90.290424000006169 33.580935999983922, -90.290199999930337 33.580916000064462, -90.29002399998717 33.580871999962255, -90.289888000115752 33.580824000062421, -90.2897679999005 33.580768000101671, -90.289591999957338 33.580739999888465, -90.289416000014171 33.580708000110462, -90.289199999999255 33.580676000099629, -90.289015999995172 33.580651999916881, -90.288831999991089 33.580644000088796, -90.288647999987 33.58063600002788, -90.288472000043839 33.580612000077963, -90.288423999911174 33.580612000077963, -90.288416000083089 33.580644000088796, -90.28827999997884 33.580623999936506, -90.288119999924675 33.580631999997422, -90.28801600006409 33.58063600002788, -90.287896000081673 33.580627999966964, -90.287768000038341 33.580612000077963, -90.287639999995008 33.58063600002788, -90.287552000023425 33.580687999958172, -90.287511999951676 33.580700000049546, -90.287464000051841 33.580672000069171, -90.287376000080258 33.580599999986589, -90.287248000036925 33.5805480000563, -90.287087999982759 33.580527999904007, -90.286912000039592 33.580527999904007, -90.286768000107259 33.580524000106379, -90.286608000053093 33.58048400003463, -90.28648000000976 33.580456000054255, -90.286351999966428 33.580435999901965, -90.28621600009501 33.580432000104338, -90.28606400010176 33.5804520000238, -90.2859040000476 33.580464000115171, -90.285743999993429 33.580460000084713, -90.28560799988918 33.580456000054255, -90.28545599989593 33.5804520000238, -90.285303999902681 33.580435999901965, -90.285159999970347 33.58042800007388, -90.2849920000881 33.580415999982506, -90.2848159999121 33.580400000093505, -90.284639999968931 33.580388000002131, -90.284440000075847 33.580375999910757, -90.284231999889016 33.58037200011313, -90.284008000046015 33.580347999930382, -90.283815999981016 33.580328000010923, -90.283616000087932 33.580315999919549, -90.2833920000121 33.580291999969631, -90.2831840000581 33.580263999989256, -90.2829919999931 33.580240000039339, -90.282848000060767 33.5802440000698, -90.282696000067517 33.580236000008881, -90.282488000113517 33.580227999947965))");var dataPoints = new Dictionary<PointShape, double>();dataPoints.Add(new PointShape(){ X = -90.5176819052947, Y = 33.3351474890471 }, 214);dataPoints.Add(new PointShape(){ X = -90.5166210650288, Y = 33.3360337851921 }, 290);dataPoints.Add(new PointShape(){ X = -90.5166210650288, Y = 33.3342611838843 }, 264);dataPoints.Add(new PointShape(){ X = -90.5166212448932, Y = 33.3333748697038 }, 236);// Projectionsvar directProjection = new Proj4Projection(Proj4Projection.GetWgs84ParametersString(),                                                   Proj4Projection.GetGoogleMapParametersString());var inverseProjection = new Proj4Projection(Proj4Projection.GetGoogleMapParametersString(),                                                 Proj4Projection.GetWgs84ParametersString());// Reproject to GoogleMap the boundary and data pointsvar reprojectedDataPoints = new Dictionary<PointShape, double>();directProjection.Open();Feature reprojectedBoundary = directProjection.ConvertToExternalProjection(boundary);foreach (var dataPoint in dataPoints){              reprojectedDataPoints.Add((PointShape)directProjection.ConvertToExternalProjection(dataPoint.Key), dataPoint.Value);}directProjection.Close();// Create the feature source and attempt to get featuresvar interpolationExtent = reprojectedBoundary.GetBoundingBox();var gridDefinition = new GridDefinition(interpolationExtent, 10, 0,reprojectedDataPoints);var interpolationModel = new InverseDistanceWeightedGridInterpolationModel();var featureSource = new InMemoryGridFeatureSource();featureSource.GridMatrix = InMemoryGridFeatureLayer.GenerateGridMatrix(gridDefinition, interpolationModel);featureSource.Open();var features = featureSource.GetAllFeatures(ReturningColumnsType.AllColumns);featureSource.Close();`

[FormatException:&nbsp;24141:&nbsp;A&nbsp;number&nbsp;is&nbsp;expected&nbsp;at&nbsp;position&nbsp;31&nbsp;of&nbsp;the&nbsp;input.&nbsp;The&nbsp;input&nbsp;has&nbsp;-1.79769313486232E+308.]

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.WellKnownTextReader.RecognizeDouble()&nbsp;+642

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.WellKnownTextReader.ParseLineStringText()&nbsp;+82

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.WellKnownTextReader.ParsePolygonText()&nbsp;+267

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.WellKnownTextReader.ParseTaggedText(OpenGisType&nbsp;type)&nbsp;+209

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.WellKnownTextReader.Read(OpenGisType&nbsp;type,&nbsp;Int32&nbsp;srid)&nbsp;+61

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.SqlGeometry.GeometryFromText(OpenGisType&nbsp;type,&nbsp;SqlChars&nbsp;text,&nbsp;Int32&nbsp;srid)&nbsp;+223

&nbsp;&nbsp;&nbsp;Microsoft.SqlServer.Types.SqlGeometry.STGeomFromText(SqlChars&nbsp;geometryTaggedText,&nbsp;Int32&nbsp;srid)&nbsp;+59

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.BaseShape.IntersectsCore(BaseShape&nbsp;targetShape)&nbsp;+330

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.BaseShape.Intersects(BaseShape&nbsp;targetShape)&nbsp;+124

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.InMemoryGridFeatureSource.GetFeaturesInsideBoundingBoxCore(RectangleShape&nbsp;boundingBox,&nbsp;IEnumerable`1&nbsp;returningColumnNames)&nbsp;+233

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.InMemoryGridFeatureSource.GetAllFeaturesCore(IEnumerable`1&nbsp;returningColumnNames)&nbsp;+138

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.FeatureSource.GetAllFeatures(IEnumerable`1&nbsp;returningColumnNames)&nbsp;+187

&nbsp;&nbsp;&nbsp;ThinkGeo.MapSuite.Core.FeatureSource.GetAllFeatures(ReturningColumnsType&nbsp;returningColumnNamesType)&nbsp;+133

&nbsp;&nbsp;&nbsp;TestingThinkGeo.Controllers.ThinkGeoController.GridFeatureSourceIssue()&nbsp;in&nbsp;C:\Users\Marius\Documents\Visual&nbsp;Studio&nbsp;2010\Projects\TestingThinkGeo\TestingThinkGeo\Controllers\ThinkGeoController.cs:95

&nbsp;&nbsp;&nbsp;lambda\_method(Closure&nbsp;,&nbsp;ControllerBase&nbsp;,&nbsp;Object[]&nbsp;)&nbsp;+101

&nbsp;&nbsp;&nbsp;System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase&nbsp;controller,&nbsp;Object[]&nbsp;parameters)&nbsp;+14

&nbsp;&nbsp;&nbsp;System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext&nbsp;controllerContext,&nbsp;IDictionary`2&nbsp;parameters)&nbsp;+211

&nbsp;&nbsp;&nbsp;System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext&nbsp;controllerContext,&nbsp;ActionDescriptor&nbsp;actionDescriptor,&nbsp;IDictionary`2&nbsp;parameters)&nbsp;+27

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass42.\<BeginInvokeSynchronousActionMethod\>b\_\_41()&nbsp;+28

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass8`1.\<BeginSynchronous\>b\_\_7(IAsyncResult&nbsp;\_)&nbsp;+10

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+57

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult&nbsp;asyncResult)&nbsp;+48

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass39.\<BeginInvokeActionMethodWithFilters\>b\_\_33()&nbsp;+57

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass4f.\<InvokeActionMethodFilterAsynchronously\>b\_\_49()&nbsp;+223

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass37.\<BeginInvokeActionMethodWithFilters\>b\_\_36(IAsyncResult&nbsp;asyncResult)&nbsp;+10

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+57

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult&nbsp;asyncResult)&nbsp;+48

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass2a.\<BeginInvokeAction\>b\_\_20()&nbsp;+24

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass25.\<BeginInvokeAction\>b\_\_22(IAsyncResult&nbsp;asyncResult)&nbsp;+102

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+57

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult&nbsp;asyncResult)&nbsp;+43

&nbsp;&nbsp;&nbsp;System.Web.Mvc.\<\>c\_\_DisplayClass1d.\<BeginExecuteCore\>b\_\_18(IAsyncResult&nbsp;asyncResult)&nbsp;+14

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass4.\<MakeVoidDelegate\>b\_\_3(IAsyncResult&nbsp;ar)&nbsp;+23

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+62

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult&nbsp;asyncResult)&nbsp;+57

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass4.\<MakeVoidDelegate\>b\_\_3(IAsyncResult&nbsp;ar)&nbsp;+23

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+62

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Controller.EndExecute(IAsyncResult&nbsp;asyncResult)&nbsp;+47

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult&nbsp;asyncResult)&nbsp;+10

&nbsp;&nbsp;&nbsp;System.Web.Mvc.\<\>c\_\_DisplayClass8.\<BeginProcessRequest\>b\_\_3(IAsyncResult&nbsp;asyncResult)&nbsp;+25

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.\<\>c\_\_DisplayClass4.\<MakeVoidDelegate\>b\_\_3(IAsyncResult&nbsp;ar)&nbsp;+23

&nbsp;&nbsp;&nbsp;System.Web.Mvc.Async.WrappedAsyncResult`1.End()&nbsp;+62

&nbsp;&nbsp;&nbsp;System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult&nbsp;asyncResult)&nbsp;+47

&nbsp;&nbsp;&nbsp;System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult&nbsp;result)&nbsp;+9

&nbsp;&nbsp;&nbsp;System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()&nbsp;+9629296

&nbsp;&nbsp;&nbsp;System.Web.HttpApplication.ExecuteStep(IExecutionStep&nbsp;step,&nbsp;Boolean&&nbsp;completedSynchronously)&nbsp;+155

Regards,&nbsp;

Marius

---

<div class="post-metadata">

**Author:** ![Edgar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/e/b487fb/32.png) [@Edgar](https://community.thinkgeo.com/u/Edgar)\
**Post date:** [January 30, 2013, 11:18pm UTC](https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176/2 "2013-01-30T23:18:28Z")

</div>

Hi&nbsp;&nbsp;Marius&nbsp;  
&nbsp;&nbsp;  
&nbsp;We&nbsp;have&nbsp;fix&nbsp;this&nbsp;issue,&nbsp;please&nbsp;get&nbsp;the&nbsp;latest&nbsp;version&nbsp;6.0.0.263&nbsp;or&nbsp;6.0.263.0.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Hope&nbsp;it&nbsp;helps.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Edgar&nbsp;

---

<div class="post-metadata">

**Author:** ![Marius](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@Marius](https://community.thinkgeo.com/u/Marius)\
**Post date:** [February 1, 2013, 3:08am UTC](https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176/3 "2013-02-01T03:08:10Z")

</div>

&nbsp;Thanks&nbsp;Edgar,

the&nbsp;fix&nbsp;works.

---

<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:** [February 3, 2013, 11:45pm UTC](https://community.thinkgeo.com/t/formatexception-with-inmemorygridfeaturesource-getallfeatures/7176/4 "2013-02-03T23:45:27Z")

</div>

Hello&nbsp;Marius,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I’m&nbsp;glad&nbsp;it’s&nbsp;working&nbsp;,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;your&nbsp;problems.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Gary
