# Display Grids with No Data Values very Slow

**URL:** <https://community.thinkgeo.com/t/display-grids-with-no-data-values-very-slow/2237>\
**Category:** WinForms\
**Created:** [May 15, 2013, 1:48pm UTC](https://community.thinkgeo.com/t/display-grids-with-no-data-values-very-slow/2237 "2013-05-15T13:48:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Damian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/5f9b8f/32.png) [@Damian1](https://community.thinkgeo.com/u/Damian1)\
**Post date:** [May 15, 2013, 1:48pm UTC](https://community.thinkgeo.com/t/display-grids-with-no-data-values-very-slow/2237/1 "2013-05-15T13:48:31Z")

</div>

Hi&nbsp;All,

I've&nbsp;been&nbsp;working&nbsp;more&nbsp;with&nbsp;grids&nbsp;using&nbsp;the&nbsp;Inverse&nbsp;Weighted&nbsp;Difference&nbsp;approach&nbsp;and&nbsp;have&nbsp;found&nbsp;some&nbsp;problems&nbsp;with&nbsp;performance.

Essentially,&nbsp;if&nbsp;I&nbsp;get&nbsp;a&nbsp;dataset&nbsp;that&nbsp;is&nbsp;rectangular&nbsp;sampled,&nbsp;but&nbsp;at&nbsp;an&nbsp;angle,&nbsp;the&nbsp;rectangular&nbsp;grid&nbsp;that&nbsp;encompasses&nbsp;it&nbsp;in&nbsp;turn&nbsp;has&nbsp;many&nbsp;places&nbsp;where&nbsp;no&nbsp;interpolation&nbsp;will&nbsp;be&nbsp;done&nbsp;because&nbsp;it&nbsp;is&nbsp;well&nbsp;outside&nbsp;the&nbsp;search&nbsp;radius&nbsp;of&nbsp;the&nbsp;IWD&nbsp;approach.&nbsp;&nbsp;These&nbsp;areas&nbsp;get&nbsp;tagged&nbsp;with&nbsp;the&nbsp;NoData&nbsp;value&nbsp;(currently&nbsp;-9999&nbsp;in&nbsp;my&nbsp;code)&nbsp;in&nbsp;the&nbsp;output&nbsp;grid&nbsp;files.

I&nbsp;have&nbsp;noticed&nbsp;that&nbsp;the&nbsp;more&nbsp;NoData&nbsp;values&nbsp;that&nbsp;are&nbsp;in&nbsp;the&nbsp;grid&nbsp;file,&nbsp;the&nbsp;longer&nbsp;it&nbsp;will&nbsp;take&nbsp;to&nbsp;display.&nbsp;&nbsp;In&nbsp;my&nbsp;example,&nbsp;I&nbsp;have&nbsp;datasets&nbsp;which&nbsp;can&nbsp;take&nbsp;several&nbsp;minutes&nbsp;to&nbsp;display.&nbsp;&nbsp;However,&nbsp;if&nbsp;I&nbsp;manually&nbsp;edit&nbsp;a&nbsp;grid&nbsp;file&nbsp;to&nbsp;change&nbsp;the&nbsp;-9999&nbsp;values&nbsp;to&nbsp;say&nbsp;0.0,&nbsp;the&nbsp;display&nbsp;time&nbsp;is&nbsp;about&nbsp;4&nbsp;times&nbsp;faster&nbsp;and&nbsp;looks&nbsp;identical&nbsp;with&nbsp;my&nbsp;color&nbsp;scale&nbsp;settings.

So,&nbsp;I&nbsp;conclude&nbsp;that&nbsp;there&nbsp;must&nbsp;be&nbsp;some&nbsp;special&nbsp;handling&nbsp;in&nbsp;GridFeatureLayers&nbsp;for&nbsp;the&nbsp;NoData&nbsp;value&nbsp;which&nbsp;is&nbsp;causing&nbsp;the&nbsp;big&nbsp;slow&nbsp;down.&nbsp;&nbsp;Can&nbsp;this&nbsp;be&nbsp;fixed?

I&nbsp;have&nbsp;attached&nbsp;two&nbsp;grid&nbsp;examples&nbsp;and&nbsp;also&nbsp;a&nbsp;subset&nbsp;of&nbsp;the&nbsp;input&nbsp;X,Y,Z&nbsp;data&nbsp;values&nbsp;(truncated&nbsp;due&nbsp;to&nbsp;attachment&nbsp;size&nbsp;limits).&nbsp;&nbsp;The&nbsp;grid&nbsp;file&nbsp;coordinates&nbsp;are&nbsp;Spherical&nbsp;Mercator&nbsp;meters,&nbsp;but&nbsp;the&nbsp;text&nbsp;is&nbsp;in&nbsp;WGS84&nbsp;UTM&nbsp;22N&nbsp;meters.&nbsp;&nbsp;Sorry,&nbsp;you'll&nbsp;have&nbsp;to&nbsp;do&nbsp;any&nbsp;conversions&nbsp;to&nbsp;do&nbsp;a&nbsp;full&nbsp;test.

Also,&nbsp;the&nbsp;files&nbsp;I&nbsp;supply&nbsp;to&nbsp;the&nbsp;gridding&nbsp;are&nbsp;normally&nbsp;between&nbsp;5-50&nbsp;Mb.&nbsp;&nbsp;The&nbsp;time&nbsp;it&nbsp;takes&nbsp;to&nbsp;process&nbsp;and&nbsp;display&nbsp;datasets&nbsp;bigger&nbsp;than&nbsp;10Mb&nbsp;without&nbsp;doing&nbsp;some&nbsp;decimation&nbsp;proportional&nbsp;to&nbsp;the&nbsp;cell&nbsp;size&nbsp;is&nbsp;inordinately&nbsp;long&nbsp;(20&nbsp;min&nbsp;to&nbsp;1hr).&nbsp;&nbsp;Can&nbsp;you&nbsp;please&nbsp;investigate&nbsp;speed&nbsp;improvements?&nbsp;&nbsp;Basically,&nbsp;all&nbsp;your&nbsp;examples&nbsp;on&nbsp;the&nbsp;wiki&nbsp;use&nbsp;tiny&nbsp;datasets&nbsp;and&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;display&nbsp;bathymetry&nbsp;data&nbsp;which&nbsp;can&nbsp;be&nbsp;much&nbsp;more&nbsp;dense.

Thanks,

Damian

[Inputs2.zip](https://community.thinkgeo.com/uploads/default/original/1X/e3066d8471877fe18a3bb5146d45d0d516677a56.zip) (1.34 MB)

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [May 17, 2013, 11:40am UTC](https://community.thinkgeo.com/t/display-grids-with-no-data-values-very-slow/2237/2 "2013-05-17T11:40:59Z")

</div>

Hi&nbsp;Damian,  
&nbsp;  
Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;but&nbsp;I&nbsp;am&nbsp;sorry&nbsp;to&nbsp;say&nbsp;that&nbsp;the&nbsp;problem&nbsp;didn’t&nbsp;show&nbsp;up&nbsp;with&nbsp;the&nbsp;data,&nbsp;attached&nbsp;is&nbsp;our&nbsp;test&nbsp;code,&nbsp;would&nbsp;you&nbsp;please&nbsp;check&nbsp;it&nbsp;and&nbsp;tell&nbsp;us&nbsp;what&nbsp;we&nbsp;missed,&nbsp;also&nbsp;can&nbsp;you&nbsp;let&nbsp;me&nbsp;know&nbsp;what&nbsp;version&nbsp;you&nbsp;are&nbsp;using?  
&nbsp;  
The&nbsp;result&nbsp;we&nbsp;get&nbsp;is&nbsp;:  
&nbsp;  
Using&nbsp;IWD\_1000m\_NoEmpty.grd&nbsp;:&nbsp;1215.9244ms  
Using&nbsp;IWD\_1000m.grd:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1225.3063ms  
&nbsp;  
As&nbsp;you&nbsp;can&nbsp;see,&nbsp;they&nbsp;cost&nbsp;almost&nbsp;same&nbsp;time&nbsp;to&nbsp;draw.  
&nbsp;  
Waiting&nbsp;for&nbsp;your&nbsp;further&nbsp;information  
&nbsp;  
Johnny

&nbsp;

[PostSmple11239.txt](https://community.thinkgeo.com/uploads/default/original/2X/b/b435fd05b614fc6a11a62c1cce253be5cd3a5e6b.txt) (2.36 KB)
