# Best approach to optimized rendering

**URL:** <https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294>\
**Category:** WinForms\
**Created:** [March 20, 2009, 6:43am UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294 "2009-03-20T06:43:01Z")\
**Posts on this page:** 5\
**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:** [March 20, 2009, 6:43am UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294/1 "2009-03-20T06:43:01Z")

</div>

We&nbsp;display&nbsp;many&nbsp;layers&nbsp;that&nbsp;are&nbsp;surface&nbsp;representations&nbsp;based&nbsp;upon&nbsp;small&nbsp;polygons.&nbsp;&nbsp;&nbsp;We&nbsp;display&nbsp;only&nbsp;area&nbsp;styles...&nbsp;no&nbsp;labels&nbsp;or&nbsp;outlines.&nbsp;&nbsp;&nbsp;The&nbsp;field&nbsp;to&nbsp;be&nbsp;themed&nbsp;is&nbsp;numeric.&nbsp;&nbsp;We'll&nbsp;tend&nbsp;to&nbsp;use&nbsp;about&nbsp;20&nbsp;class&nbsp;breaks.&nbsp;&nbsp;&nbsp;The&nbsp;feature&nbsp;source&nbsp;will&nbsp;have&nbsp;from&nbsp;5,000&nbsp;to&nbsp;50,000&nbsp;"cells".

What&nbsp;is&nbsp;the&nbsp;most&nbsp;efficient&nbsp;way&nbsp;to&nbsp;theme&nbsp;this?&nbsp;&nbsp;&nbsp;I'm&nbsp;looking&nbsp;for&nbsp;some&nbsp;insight&nbsp;into&nbsp;the&nbsp;ValueStyle&nbsp;and&nbsp;ClassBreakStyle&nbsp;themes.&nbsp;&nbsp;In&nbsp;the&nbsp;Feature,&nbsp;I&nbsp;have&nbsp;to&nbsp;convert&nbsp;my&nbsp;numeric&nbsp;value&nbsp;and&nbsp;provide&nbsp;it&nbsp;to&nbsp;you&nbsp;as&nbsp;a&nbsp;string.&nbsp;&nbsp;&nbsp;And,&nbsp;in&nbsp;a&nbsp;classbreak&nbsp;style,&nbsp;you&nbsp;convert&nbsp;that&nbsp;back&nbsp;to&nbsp;a&nbsp;number&nbsp;and&nbsp;then&nbsp;drive&nbsp;into&nbsp;the&nbsp;class&nbsp;break&nbsp;table?&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;you&nbsp;do&nbsp;that,&nbsp;do&nbsp;you&nbsp;do&nbsp;a&nbsp;sequential&nbsp;search&nbsp;through&nbsp;the&nbsp;breaks,&nbsp;or&nbsp;a&nbsp;binary&nbsp;search?&nbsp;&nbsp;&nbsp;Do&nbsp;you&nbsp;cache&nbsp;the&nbsp;most&nbsp;recently&nbsp;used&nbsp;break&nbsp;and&nbsp;test&nbsp;for&nbsp;it&nbsp;first,&nbsp;assuming&nbsp;that&nbsp;there&nbsp;is&nbsp;a&nbsp;good&nbsp;chance&nbsp;that&nbsp;sequential&nbsp;geometries&nbsp;will&nbsp;fall&nbsp;within&nbsp;the&nbsp;same&nbsp;class&nbsp;break?&nbsp;&nbsp;(which&nbsp;is&nbsp;the&nbsp;case&nbsp;with&nbsp;our&nbsp;layers).

As&nbsp;an&nbsp;alternative...&nbsp;I&nbsp;have&nbsp;an&nbsp;optimized&nbsp;style&nbsp;picker&nbsp;that&nbsp;works&nbsp;on&nbsp;the&nbsp;numerical&nbsp;data&nbsp;w/o&nbsp;conversion,&nbsp;caches&nbsp;the&nbsp;most&nbsp;recently&nbsp;used&nbsp;break,&nbsp;and&nbsp;uses&nbsp;a&nbsp;binary&nbsp;search&nbsp;when&nbsp;the&nbsp;value&nbsp;doesn't&nbsp;fall&nbsp;within&nbsp;the&nbsp;cached&nbsp;break.&nbsp;&nbsp;Should&nbsp;I&nbsp;use&nbsp;this&nbsp;object&nbsp;within&nbsp;my&nbsp;FeatureSource&nbsp;and&nbsp;create&nbsp;a&nbsp;FeatureCollection&nbsp;where&nbsp;the&nbsp;field&nbsp;is&nbsp;a&nbsp;resultant&nbsp;index&nbsp;for&nbsp;a&nbsp;ValueStyle,&nbsp;rather&nbsp;than&nbsp;the&nbsp;numerical&nbsp;number.&nbsp;&nbsp;&nbsp;Do&nbsp;you&nbsp;have&nbsp;a&nbsp;mechanism&nbsp;that&nbsp;would&nbsp;find&nbsp;which&nbsp;of&nbsp;20&nbsp;value&nbsp;style&nbsp;members&nbsp;should&nbsp;be&nbsp;used&nbsp;that&nbsp;would&nbsp;be&nbsp;a&nbsp;lot&nbsp;faster&nbsp;than&nbsp;determining&nbsp;which&nbsp;of&nbsp;20&nbsp;class&nbsp;breaks&nbsp;should&nbsp;be&nbsp;used?

Do&nbsp;you&nbsp;offer&nbsp;a&nbsp;style&nbsp;where&nbsp;I&nbsp;could&nbsp;have&nbsp;my&nbsp;field&nbsp;be&nbsp;an&nbsp;actual&nbsp;index&nbsp;into&nbsp;right&nbsp;member,&nbsp;rather&nbsp;than&nbsp;you&nbsp;having&nbsp;to&nbsp;search&nbsp;for&nbsp;the&nbsp;right&nbsp;member?

Do&nbsp;I&nbsp;have&nbsp;any&nbsp;options&nbsp;for&nbsp;building&nbsp;custom&nbsp;renderers&nbsp;for&nbsp;this&nbsp;type&nbsp;of&nbsp;data&nbsp;that&nbsp;would&nbsp;optimize&nbsp;the&nbsp;display&nbsp;of&nbsp;this&nbsp;type&nbsp;of&nbsp;data.

Thanks!

PS:&nbsp;&nbsp;When&nbsp;I&nbsp;have&nbsp;asked&nbsp;this&nbsp;question&nbsp;of&nbsp;other&nbsp;vendors&nbsp;over&nbsp;the&nbsp;past&nbsp;several&nbsp;years,&nbsp;the&nbsp;response&nbsp;is&nbsp;that&nbsp;I&nbsp;should&nbsp;represent&nbsp;my&nbsp;data&nbsp;as&nbsp;a&nbsp;raster.&nbsp;&nbsp;That&nbsp;is&nbsp;a&nbsp;topic&nbsp;worth&nbsp;discussion,&nbsp;but&nbsp;leads&nbsp;into&nbsp;many&nbsp;questions&nbsp;of&nbsp;a&nbsp;displaying&nbsp;a&nbsp;lon/lat&nbsp;WGS84&nbsp;raster&nbsp;in&nbsp;a&nbsp;UTM&nbsp;NAD83&nbsp;projection,&nbsp;etc,&nbsp;etc.&nbsp;&nbsp;&nbsp;It's&nbsp;a&nbsp;worthwhile&nbsp;discussion,&nbsp;but&nbsp;it&nbsp;doesn't&nbsp;change&nbsp;my&nbsp;interest&nbsp;in&nbsp;knowing&nbsp;how&nbsp;to&nbsp;optimize&nbsp;the&nbsp;application&nbsp;of&nbsp;styles.

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [March 20, 2009, 7:27am UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294/2 "2009-03-20T07:27:40Z")

</div>

&nbsp;Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;I&nbsp;have&nbsp;a&nbsp;few&nbsp;questions&nbsp;about&nbsp;this.&nbsp;  
&nbsp;&nbsp;  
&nbsp;1.Where&nbsp;is&nbsp;this&nbsp;data&nbsp;stored?&nbsp;&nbsp;How&nbsp;long&nbsp;does&nbsp;it&nbsp;take&nbsp;to&nbsp;read&nbsp;the&nbsp;data&nbsp;to&nbsp;display&nbsp;on&nbsp;a&nbsp;typical&nbsp;screen?&nbsp;&nbsp;Are&nbsp;the&nbsp;different&nbsp;breaks&nbsp;indexed&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;query&nbsp;our&nbsp;just&nbsp;a&nbsp;given&nbsp;break&nbsp;from&nbsp;a&nbsp;rectangle?&nbsp;  
&nbsp;2.How&nbsp;many&nbsp;polygons&nbsp;are&nbsp;typically&nbsp;drawn&nbsp;on&nbsp;a&nbsp;screen&nbsp;at&nbsp;a&nbsp;given&nbsp;time.&nbsp;&nbsp;How&nbsp;many&nbsp;points&nbsp;are&nbsp;they&nbsp;made&nbsp;up&nbsp;of&nbsp;on&nbsp;average?&nbsp;  
&nbsp;3.Are&nbsp;the&nbsp;polygons&nbsp;squares&nbsp;cells&nbsp;or&nbsp;can&nbsp;they&nbsp;be&nbsp;irregular&nbsp;shapes?&nbsp;  
&nbsp;4.Is&nbsp;this&nbsp;data&nbsp;dynamic&nbsp;and&nbsp;changing&nbsp;often,&nbsp;if&nbsp;so&nbsp;how&nbsp;often?&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;have&nbsp;some&nbsp;ideas&nbsp;about&nbsp;some&nbsp;of&nbsp;them&nbsp;require&nbsp;more&nbsp;information.&nbsp;  
&nbsp;&nbsp;  
&nbsp;1.This&nbsp;sounds&nbsp;like&nbsp;grid&nbsp;territory.&nbsp;&nbsp;You&nbsp;create&nbsp;a&nbsp;grid&nbsp;file&nbsp;and&nbsp;then&nbsp;it&nbsp;is&nbsp;loaded&nbsp;into&nbsp;memory&nbsp;and&nbsp;the&nbsp;values&nbsp;are&nbsp;colored&nbsp;based&nbsp;on&nbsp;a&nbsp;color&nbsp;range.&nbsp;&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;if&nbsp;you&nbsp;are&nbsp;familiar&nbsp;with&nbsp;this&nbsp;but&nbsp;if&nbsp;not&nbsp;we&nbsp;can&nbsp;help&nbsp;you&nbsp;with&nbsp;it.&nbsp;  
&nbsp;2.If&nbsp;you&nbsp;are&nbsp;concerned&nbsp;about&nbsp;class-breaks&nbsp;being&nbsp;slow&nbsp;to&nbsp;loop&nbsp;through&nbsp;the&nbsp;items&nbsp;then&nbsp;you&nbsp;maybe&nbsp;be&nbsp;better&nbsp;off&nbsp;setting&nbsp;two&nbsp;colors,&nbsp;the&nbsp;first&nbsp;at&nbsp;the&nbsp;low&nbsp;range&nbsp;you&nbsp;set&nbsp;and&nbsp;the&nbsp;other&nbsp;at&nbsp;the&nbsp;high&nbsp;range.&nbsp;Instead&nbsp;of&nbsp;falling&nbsp;into&nbsp;a&nbsp;break&nbsp;the&nbsp;value&nbsp;of&nbsp;a&nbsp;cell&nbsp;is&nbsp;colored&nbsp;based&nbsp;on&nbsp;where&nbsp;it&nbsp;fits&nbsp;between&nbsp;the&nbsp;high&nbsp;and&nbsp;low&nbsp;values&nbsp;and&nbsp;you&nbsp;create&nbsp;a&nbsp;color&nbsp;in&nbsp;between.&nbsp;&nbsp;In&nbsp;this&nbsp;way&nbsp;it&nbsp;is&nbsp;a&nbsp;single&nbsp;calculation&nbsp;and&nbsp;not&nbsp;a&nbsp;loop.&nbsp;&nbsp;This&nbsp;might&nbsp;save&nbsp;you&nbsp;some&nbsp;time.&nbsp;&nbsp;You&nbsp;could&nbsp;also&nbsp;create&nbsp;a&nbsp;break&nbsp;effect&nbsp;like&nbsp;this&nbsp;by&nbsp;specifying&nbsp;a&nbsp;number&nbsp;of&nbsp;steps&nbsp;that&nbsp;the&nbsp;process&nbsp;takes.&nbsp;&nbsp;This&nbsp;will&nbsp;mean&nbsp;from&nbsp;Light&nbsp;Red&nbsp;to&nbsp;Dark&nbsp;Red&nbsp;there&nbsp;are&nbsp;only&nbsp;five&nbsp;steps&nbsp;and&nbsp;the&nbsp;math&nbsp;has&nbsp;a&nbsp;rounding&nbsp;and&nbsp;a&nbsp;ceiling&nbsp;or&nbsp;floor&nbsp;type&nbsp;calculation.&nbsp;  
&nbsp;3.If&nbsp;the&nbsp;query&nbsp;from&nbsp;your&nbsp;source&nbsp;if&nbsp;really&nbsp;fast&nbsp;then&nbsp;another&nbsp;great&nbsp;way&nbsp;is&nbsp;to&nbsp;not&nbsp;use&nbsp;a&nbsp;decision&nbsp;based&nbsp;style&nbsp;like&nbsp;a&nbsp;value&nbsp;or&nbsp;class&nbsp;break&nbsp;but&nbsp;to&nbsp;have&nbsp;separate&nbsp;layers&nbsp;where&nbsp;each&nbsp;on&nbsp;focuses&nbsp;on&nbsp;a&nbsp;different&nbsp;color.&nbsp;&nbsp;We&nbsp;do&nbsp;this&nbsp;for&nbsp;our&nbsp;world&nbsp;map&nbsp;kit.&nbsp;&nbsp;When&nbsp;we&nbsp;get&nbsp;the&nbsp;original&nbsp;data&nbsp;it&nbsp;has&nbsp;all&nbsp;road&nbsp;types&nbsp;lumped&nbsp;into&nbsp;one&nbsp;shapefile.&nbsp;&nbsp;We&nbsp;then&nbsp;create&nbsp;custom&nbsp;indexes&nbsp;that&nbsp;only&nbsp;contain&nbsp;one&nbsp;type&nbsp;of&nbsp;road&nbsp;such&nbsp;as&nbsp;minor&nbsp;road,&nbsp;major&nbsp;road,&nbsp;paths,&nbsp;highways,&nbsp;interstates&nbsp;etc.&nbsp;&nbsp;We&nbsp;load&nbsp;each&nbsp;road&nbsp;type&nbsp;as&nbsp;a&nbsp;different&nbsp;layer,&nbsp;each&nbsp;layer&nbsp;uses&nbsp;the&nbsp;same&nbsp;shape&nbsp;file&nbsp;but&nbsp;a&nbsp;different&nbsp;index.&nbsp;&nbsp;In&nbsp;this&nbsp;way&nbsp;we&nbsp;do&nbsp;not&nbsp;even&nbsp;have&nbsp;to&nbsp;look&nbsp;at&nbsp;a&nbsp;field&nbsp;to&nbsp;determine&nbsp;how&nbsp;to&nbsp;draw.&nbsp;&nbsp;All&nbsp;of&nbsp;the&nbsp;drawing&nbsp;is&nbsp;hard&nbsp;coded&nbsp;to&nbsp;the&nbsp;particular&nbsp;layer.&nbsp;&nbsp;This&nbsp;works&nbsp;very&nbsp;well&nbsp;because&nbsp;our&nbsp;index&nbsp;is&nbsp;an&nbsp;Rtree&nbsp;and&nbsp;is&nbsp;very&nbsp;efficient&nbsp;in&nbsp;finding&nbsp;shapes&nbsp;in&nbsp;a&nbsp;rectangle&nbsp;quickly.&nbsp;&nbsp;One&nbsp;thing&nbsp;to&nbsp;remember&nbsp;is&nbsp;that&nbsp;we&nbsp;can&nbsp;help&nbsp;you&nbsp;to&nbsp;use&nbsp;our&nbsp;R-Tree&nbsp;index&nbsp;for&nbsp;your&nbsp;own&nbsp;custom&nbsp;data&nbsp;source.&nbsp;&nbsp;The&nbsp;R-Tree&nbsp;index&nbsp;could&nbsp;be&nbsp;a&nbsp;first&nbsp;pass&nbsp;filter&nbsp;to&nbsp;then&nbsp;tell&nbsp;you&nbsp;what&nbsp;records&nbsp;to&nbsp;fetch&nbsp;in&nbsp;your&nbsp;real&nbsp;underlying&nbsp;data.&nbsp;  
&nbsp;4.Of&nbsp;course&nbsp;whatever&nbsp;you&nbsp;can&nbsp;cache&nbsp;in&nbsp;memory&nbsp;would&nbsp;be&nbsp;good.&nbsp;&nbsp;We&nbsp;have&nbsp;some&nbsp;InMemoryFeaureLayers&nbsp;that&nbsp;also&nbsp;have&nbsp;R-Tree&nbsp;caches&nbsp;bolted&nbsp;on&nbsp;them,&nbsp;there&nbsp;is&nbsp;an&nbsp;example&nbsp;in&nbsp;the&nbsp;Developers&nbsp;Blog&nbsp;forum.&nbsp;&nbsp;If&nbsp;you&nbsp;can&nbsp;load&nbsp;it&nbsp;all&nbsp;into&nbsp;memory&nbsp;that&nbsp;would&nbsp;be&nbsp;good.&nbsp;&nbsp;When&nbsp;I&nbsp;heard&nbsp;you&nbsp;were&nbsp;using&nbsp;a&nbsp;binary&nbsp;tree&nbsp;to&nbsp;search&nbsp;through&nbsp;20&nbsp;class&nbsp;breaks&nbsp;I&nbsp;knew&nbsp;you&nbsp;were&nbsp;not&nbsp;messing&nbsp;around.&nbsp;&nbsp;My&nbsp;only&nbsp;question&nbsp;is&nbsp;that&nbsp;does&nbsp;the&nbsp;searching&nbsp;really&nbsp;take&nbsp;that&nbsp;much&nbsp;time.&nbsp;&nbsp;I&nbsp;would&nbsp;imagine&nbsp;that&nbsp;an&nbsp;optimization&nbsp;somewhere&nbsp;else&nbsp;might&nbsp;yield&nbsp;more&nbsp;fruit&nbsp;then&nbsp;this.&nbsp;&nbsp;I&nbsp;can’t&nbsp;imagine&nbsp;this&nbsp;taking&nbsp;allow&nbsp;of&nbsp;time&nbsp;versus&nbsp;getting&nbsp;the&nbsp;data,&nbsp;doing&nbsp;validation&nbsp;etc.&nbsp;&nbsp;Of&nbsp;course&nbsp;I&nbsp;have&nbsp;no&nbsp;answers&nbsp;to&nbsp;the&nbsp;questions&nbsp;above&nbsp;so&nbsp;it&nbsp;might&nbsp;be&nbsp;a&nbsp;good&nbsp;optimization&nbsp;to&nbsp;make.&nbsp;  
&nbsp;5.Of&nbsp;course&nbsp;we&nbsp;can&nbsp;share&nbsp;with&nbsp;you&nbsp;the&nbsp;code&nbsp;for&nbsp;the&nbsp;ClassBreakStyle&nbsp;if&nbsp;you&nbsp;would&nbsp;like&nbsp;however&nbsp;it&nbsp;is&nbsp;not&nbsp;very&nbsp;high&nbsp;tech&nbsp;and&nbsp;I&nbsp;think&nbsp;you&nbsp;could&nbsp;put&nbsp;one&nbsp;together&nbsp;that&nbsp;is&nbsp;faster&nbsp;for&nbsp;your&nbsp;particular&nbsp;needs.&nbsp;&nbsp;Many&nbsp;of&nbsp;the&nbsp;classes&nbsp;we&nbsp;provide&nbsp;are&nbsp;general&nbsp;purpose&nbsp;and&nbsp;have&nbsp;not&nbsp;been&nbsp;tweaked&nbsp;for&nbsp;all&nbsp;out&nbsp;speed.&nbsp;  
&nbsp;6.Another&nbsp;approach&nbsp;is&nbsp;to&nbsp;cache&nbsp;the&nbsp;rendered&nbsp;tiles.&nbsp;&nbsp;If&nbsp;your&nbsp;data&nbsp;doesn’t&nbsp;change&nbsp;that&nbsp;often&nbsp;we&nbsp;can&nbsp;cache&nbsp;what&nbsp;is&nbsp;drawn&nbsp;in&nbsp;tiles&nbsp;on&nbsp;the&nbsp;disk.&nbsp;&nbsp;This&nbsp;is&nbsp;kind&nbsp;of&nbsp;like&nbsp;what&nbsp;the&nbsp;other&nbsp;vendors&nbsp;told&nbsp;you&nbsp;but&nbsp;in&nbsp;this&nbsp;way&nbsp;we&nbsp;will&nbsp;cache&nbsp;what&nbsp;is&nbsp;drawn&nbsp;in&nbsp;tile&nbsp;sizes&nbsp;of&nbsp;your&nbsp;choosing.&nbsp;&nbsp;The&nbsp;tiles&nbsp;are&nbsp;generated&nbsp;on&nbsp;demand.&nbsp;&nbsp;As&nbsp;the&nbsp;client&nbsp;uses&nbsp;the&nbsp;system&nbsp;more&nbsp;the&nbsp;more&nbsp;will&nbsp;be&nbsp;cached.&nbsp;&nbsp;When&nbsp;you&nbsp;change&nbsp;projections&nbsp;then&nbsp;you&nbsp;specify&nbsp;a&nbsp;different&nbsp;CacheId&nbsp;and&nbsp;we&nbsp;will&nbsp;start&nbsp;a&nbsp;new&nbsp;cache.&nbsp;&nbsp;You&nbsp;can&nbsp;flip&nbsp;between&nbsp;both&nbsp;cached&nbsp;by&nbsp;changing&nbsp;the&nbsp;CacheId.&nbsp;&nbsp;This&nbsp;also&nbsp;cuts&nbsp;down&nbsp;on&nbsp;drawing&nbsp;time&nbsp;as&nbsp;the&nbsp;user&nbsp;pans&nbsp;etc.&nbsp;&nbsp;if&nbsp;the&nbsp;user&nbsp;pans&nbsp;40%&nbsp;then&nbsp;we&nbsp;only&nbsp;need&nbsp;to&nbsp;re-draw&nbsp;a&nbsp;smaller&nbsp;part&nbsp;of&nbsp;the&nbsp;screen&nbsp;as&nbsp;the&nbsp;tiles&nbsp;will&nbsp;populate&nbsp;the&nbsp;rest.&nbsp;&nbsp;We&nbsp;can&nbsp;also&nbsp;help&nbsp;you&nbsp;write&nbsp;a&nbsp;little&nbsp;routine&nbsp;to&nbsp;pre-create&nbsp;the&nbsp;tiles&nbsp;for&nbsp;a&nbsp;few&nbsp;zoom&nbsp;levels&nbsp;if&nbsp;you&nbsp;wanted&nbsp;as&nbsp;well.&nbsp;In&nbsp;this&nbsp;way&nbsp;you&nbsp;are&nbsp;in&nbsp;control.&nbsp;&nbsp;The&nbsp;nice&nbsp;thing&nbsp;about&nbsp;thte&nbsp;caching&nbsp;of&nbsp;tiles&nbsp;is&nbsp;that&nbsp;it&nbsp;is&nbsp;pretty&nbsp;transparent&nbsp;for&nbsp;you.&nbsp;&nbsp;When&nbsp;an&nbsp;overlay&nbsp;gets&nbsp;the&nbsp;Draw&nbsp;method&nbsp;called&nbsp;we&nbsp;determine&nbsp;what&nbsp;we&nbsp;have&nbsp;in&nbsp;cache&nbsp;and&nbsp;only&nbsp;call&nbsp;into&nbsp;your&nbsp;layer&nbsp;for&nbsp;the&nbsp;rest&nbsp;of&nbsp;what&nbsp;we&nbsp;don;t&nbsp;have.&nbsp;&nbsp;We&nbsp;then&nbsp;stitch&nbsp;what&nbsp;we&nbsp;had&nbsp;and&nbsp;what&nbsp;you&nbsp;give&nbsp;us&nbsp;and&nbsp;send&nbsp;it&nbsp;back.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;hope&nbsp;this&nbsp;helps,&nbsp;sounds&nbsp;like&nbsp;you&nbsp;have&nbsp;some&nbsp;interesting&nbsp;work&nbsp;going&nbsp;on&nbsp;there!&nbsp;  
&nbsp;&nbsp;&nbsp;  
&nbsp;David

---

<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:** [March 20, 2009, 9:38am UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294/3 "2009-03-20T09:38:00Z")

</div>

David,&nbsp;I&nbsp;have&nbsp;uploaded&nbsp;a&nbsp;[PowerPoint&nbsp;Slide&nbsp;Show&nbsp;](http://www.mapshots.com/ftp/weblinks/pdf/mapshots.zip)that&nbsp;illustrates&nbsp;our&nbsp;application&nbsp;and&nbsp;the&nbsp;requirements&nbsp;we&nbsp;have&nbsp;from&nbsp;a&nbsp;mapping&nbsp;engine.&nbsp;&nbsp;Within&nbsp;the&nbsp;20&nbsp;or&nbsp;30&nbsp;slides,&nbsp;there&nbsp;are&nbsp;5&nbsp;or&nbsp;6&nbsp;that&nbsp;explicitly&nbsp;illustrate&nbsp;why&nbsp;I&nbsp;have&nbsp;this&nbsp;specific&nbsp;question&nbsp;on&nbsp;rendering&nbsp;performance.

Brief&nbsp;summary:&nbsp;&nbsp;We&nbsp;are&nbsp;a&nbsp;company&nbsp;that&nbsp;builds&nbsp;software&nbsp;for&nbsp;"Precision&nbsp;Agriculture".&nbsp;&nbsp;This&nbsp;is&nbsp;the&nbsp;application&nbsp;of&nbsp;GIS&nbsp;and&nbsp;GPS&nbsp;technology&nbsp;to&nbsp;crop&nbsp;production.&nbsp;&nbsp;Our&nbsp;customers&nbsp;have&nbsp;GPS&nbsp;on&nbsp;their&nbsp;machines&nbsp;and&nbsp;the&nbsp;log&nbsp;operating&nbsp;information&nbsp;every&nbsp;second&nbsp;as&nbsp;they&nbsp;drive&nbsp;through&nbsp;a&nbsp;field.&nbsp;&nbsp;&nbsp;As&nbsp;such,&nbsp;in&nbsp;a&nbsp;1/2&nbsp;mile&nbsp;by&nbsp;1/2&nbsp;mile&nbsp;field&nbsp;(160&nbsp;acres),&nbsp;there&nbsp;might&nbsp;be&nbsp;150,000&nbsp;logged&nbsp;data&nbsp;records.&nbsp;&nbsp;&nbsp;Our&nbsp;goal&nbsp;is&nbsp;to&nbsp;display&nbsp;that&nbsp;data&nbsp;on&nbsp;a&nbsp;map,&nbsp;such&nbsp;that&nbsp;the&nbsp;user&nbsp;can&nbsp;see&nbsp;high&nbsp;and&nbsp;low&nbsp;yield&nbsp;areas,&nbsp;product&nbsp;application&nbsp;rates,&nbsp;soil&nbsp;density,&nbsp;nutrient&nbsp;analysis,&nbsp;etc,&nbsp;etc&nbsp;for&nbsp;any&nbsp;area&nbsp;in&nbsp;the&nbsp;field.&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;what&nbsp;we&nbsp;call&nbsp;Dense&nbsp;point&nbsp;data.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;90%&nbsp;of&nbsp;the&nbsp;time,&nbsp;we&nbsp;display&nbsp;all&nbsp;of&nbsp;the&nbsp;data&nbsp;for&nbsp;a&nbsp;field&nbsp;within&nbsp;the&nbsp;same&nbsp;map&nbsp;frame.&nbsp;&nbsp;The&nbsp;ability&nbsp;to&nbsp;select&nbsp;a&nbsp;specific&nbsp;subset&nbsp;as&nbsp;we&nbsp;zoom&nbsp;in&nbsp;is&nbsp;a&nbsp;low&nbsp;priority.&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;example&nbsp;of&nbsp;a&nbsp;map&nbsp;of&nbsp;"raw"&nbsp;cotton&nbsp;yield&nbsp;data&nbsp;is&nbsp;shown&nbsp;on&nbsp;the&nbsp;10th&nbsp;slide&nbsp;entitled&nbsp;"Field&nbsp;Op&nbsp;Records".

On&nbsp;the&nbsp;13th&nbsp;slide,&nbsp;entitled&nbsp;Spatially&nbsp;Aware&nbsp;Sensors,&nbsp;you&nbsp;can&nbsp;see&nbsp;that&nbsp;we&nbsp;do&nbsp;have&nbsp;reason&nbsp;to&nbsp;zoom&nbsp;in&nbsp;on&nbsp;a&nbsp;map&nbsp;at&nbsp;times.&nbsp;&nbsp;&nbsp;And&nbsp;when&nbsp;we&nbsp;do,&nbsp;we&nbsp;are&nbsp;displaying&nbsp;a&nbsp;set&nbsp;of&nbsp;dots&nbsp;that&nbsp;are&nbsp;sized&nbsp;dynamically&nbsp;to&nbsp;reflect&nbsp;the&nbsp;operating&nbsp;width&nbsp;of&nbsp;the&nbsp;machine,&nbsp;and&nbsp;overlapped&nbsp;in&nbsp;time&nbsp;series&nbsp;so&nbsp;that&nbsp;it&nbsp;is&nbsp;easy&nbsp;to&nbsp;see&nbsp;in&nbsp;what&nbsp;direction&nbsp;the&nbsp;machine&nbsp;was&nbsp;travelling.&nbsp;&nbsp;These&nbsp;are&nbsp;the&nbsp;gray&nbsp;dots.&nbsp;&nbsp;The&nbsp;green&nbsp;dots&nbsp;represent&nbsp;the&nbsp;operation&nbsp;of&nbsp;just&nbsp;a&nbsp;single&nbsp;part&nbsp;of&nbsp;the&nbsp;machine,&nbsp;as&nbsp;farmers&nbsp;may&nbsp;have&nbsp;one&nbsp;variety&nbsp;in&nbsp;each&nbsp;half&nbsp;of&nbsp;a&nbsp;planter.&nbsp;&nbsp;&nbsp;Our&nbsp;special&nbsp;skill&nbsp;within&nbsp;the&nbsp;industry&nbsp;is&nbsp;our&nbsp;ability&nbsp;to&nbsp;map&nbsp;and&nbsp;display&nbsp;these&nbsp;individual&nbsp;operating&nbsp;parts&nbsp;of&nbsp;a&nbsp;machine.

We&nbsp;also&nbsp;deal&nbsp;with&nbsp;Sparse&nbsp;data...&nbsp;manually&nbsp;pulled&nbsp;soil&nbsp;test&nbsp;sites&nbsp;within&nbsp;a&nbsp;field,&nbsp;or&nbsp;things&nbsp;like&nbsp;soil&nbsp;type&nbsp;and&nbsp;soil&nbsp;testing&nbsp;polygons.

For&nbsp;Dense&nbsp;and&nbsp;Sparse&nbsp;sites,&nbsp;we&nbsp;sometimes&nbsp;generate&nbsp;surfaces.&nbsp;&nbsp;&nbsp;These&nbsp;are&nbsp;persisted&nbsp;within&nbsp;our&nbsp;system&nbsp;as&nbsp;layers&nbsp;of&nbsp;many&nbsp;small&nbsp;rectangular&nbsp;polygons,&nbsp;with&nbsp;the&nbsp;polygons&nbsp;that&nbsp;are&nbsp;intersected&nbsp;by&nbsp;the&nbsp;containing&nbsp;field&nbsp;boundary&nbsp;being&nbsp;irregularly&nbsp;shaped.&nbsp;&nbsp;&nbsp;These&nbsp;are&nbsp;the&nbsp;5,000&nbsp;to&nbsp;50,000&nbsp;record&nbsp;surface&nbsp;layers&nbsp;to&nbsp;which&nbsp;I&nbsp;was&nbsp;referring&nbsp;in&nbsp;the&nbsp;original&nbsp;post.&nbsp;&nbsp;&nbsp;There&nbsp;is&nbsp;an&nbsp;illustration&nbsp;of&nbsp;one&nbsp;of&nbsp;these&nbsp;on&nbsp;the&nbsp;IntelliCalc&nbsp;Multi-Layer&nbsp;Processing&nbsp;slide.&nbsp;&nbsp;That's&nbsp;an&nbsp;old&nbsp;slide,&nbsp;and&nbsp;of&nbsp;our&nbsp;COM&nbsp;system,&nbsp;so&nbsp;teh&nbsp;cells&nbsp;are&nbsp;about&nbsp;10&nbsp;meters,&nbsp;and&nbsp;were&nbsp;rendered&nbsp;with&nbsp;outlines.&nbsp;&nbsp;&nbsp;In&nbsp;our&nbsp;new&nbsp;.Net&nbsp;stuff,&nbsp;the&nbsp;cells&nbsp;are&nbsp;2&nbsp;to&nbsp;5&nbsp;meters,&nbsp;and&nbsp;rendered&nbsp;w/o&nbsp;outlines.&nbsp;&nbsp;&nbsp;But,&nbsp;in&nbsp;any&nbsp;case,&nbsp;you&nbsp;can&nbsp;see&nbsp;that&nbsp;we&nbsp;are&nbsp;displaying&nbsp;them&nbsp;all&nbsp;at&nbsp;one&nbsp;time,&nbsp;in&nbsp;most&nbsp;cases.

On&nbsp;the&nbsp;FieldOps&nbsp;data,&nbsp;for&nbsp;the&nbsp;first&nbsp;five&nbsp;five&nbsp;years&nbsp;we&nbsp;used&nbsp;this&nbsp;package,&nbsp;we&nbsp;drew&nbsp;this&nbsp;data&nbsp;directly&nbsp;into&nbsp;the&nbsp;map&nbsp;window&nbsp;ourself,&nbsp;using&nbsp;GDI.&nbsp;&nbsp;&nbsp;On&nbsp;a&nbsp;1ghz&nbsp;machine,&nbsp;we&nbsp;could&nbsp;render&nbsp;50,000&nbsp;yield&nbsp;points&nbsp;within&nbsp;a&nbsp;couple&nbsp;of&nbsp;seconds.&nbsp;&nbsp;&nbsp;That&nbsp;was&nbsp;compared&nbsp;to&nbsp;10&nbsp;to&nbsp;15&nbsp;seconds&nbsp;with&nbsp;the&nbsp;out-of-the&nbsp;box&nbsp;renderers&nbsp;drawing&nbsp;from&nbsp;a&nbsp;shapefile.&nbsp;&nbsp;&nbsp;&nbsp;We&nbsp;were&nbsp;finally&nbsp;able&nbsp;to&nbsp;contract&nbsp;with&nbsp;the&nbsp;vendor&nbsp;to&nbsp;write&nbsp;an&nbsp;optimized&nbsp;renderer&nbsp;plug-in.&nbsp;&nbsp;&nbsp;They&nbsp;took&nbsp;their&nbsp;grid&nbsp;renderer&nbsp;and&nbsp;made&nbsp;it&nbsp;available&nbsp;for&nbsp;vector&nbsp;layers,&nbsp;and&nbsp;added&nbsp;a&nbsp;parameter&nbsp;for&nbsp;a&nbsp;size&nbsp;field&nbsp;when&nbsp;rendering&nbsp;dots.&nbsp;&nbsp;&nbsp;This&nbsp;let&nbsp;us&nbsp;render&nbsp;size&nbsp;and&nbsp;color&nbsp;at&nbsp;the&nbsp;same&nbsp;pass.&nbsp;&nbsp;&nbsp;On&nbsp;a&nbsp;2ghz&nbsp;machine&nbsp;today,&nbsp;I&nbsp;can&nbsp;render&nbsp;to&nbsp;50,000&nbsp;sites&nbsp;in&nbsp;about&nbsp;1/2&nbsp;second.&nbsp;&nbsp;&nbsp;The&nbsp;issue&nbsp;is&nbsp;the&nbsp;time&nbsp;it&nbsp;takes&nbsp;to&nbsp;copy&nbsp;my&nbsp;data&nbsp;into&nbsp;their&nbsp;required&nbsp;recordset&nbsp;for&nbsp;rendering.&nbsp;&nbsp;&nbsp;That&nbsp;takes&nbsp;about&nbsp;3&nbsp;seconds,&nbsp;after&nbsp;they&nbsp;gave&nbsp;us&nbsp;a&nbsp;bulk&nbsp;load&nbsp;method.&nbsp;&nbsp;It&nbsp;was&nbsp;10&nbsp;seconds.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;However,&nbsp;in&nbsp;their&nbsp;architecture,&nbsp;once&nbsp;I&nbsp;have&nbsp;created&nbsp;that&nbsp;recordset,&nbsp;I'm&nbsp;done...&nbsp;as&nbsp;the&nbsp;user&nbsp;zooms&nbsp;in&nbsp;and&nbsp;out,&nbsp;or&nbsp;pans,&nbsp;the&nbsp;rendering&nbsp;happens&nbsp;automatically&nbsp;w/o&nbsp;a&nbsp;requirement&nbsp;that&nbsp;I&nbsp;reload&nbsp;the&nbsp;recordset.&nbsp;&nbsp;&nbsp;&nbsp;I've&nbsp;accomplish&nbsp;this&nbsp;in&nbsp;MapSuite&nbsp;by&nbsp;caching&nbsp;the&nbsp;feature&nbsp;collection&nbsp;that&nbsp;I&nbsp;build.&nbsp;&nbsp;&nbsp;But&nbsp;I&nbsp;don't&nbsp;know&nbsp;how&nbsp;hard&nbsp;you&nbsp;work&nbsp;against&nbsp;that&nbsp;collection,&nbsp;though.

In&nbsp;ou&nbsp;.Net&nbsp;world,&nbsp;we&nbsp;store&nbsp;these&nbsp;50,000&nbsp;records&nbsp;as&nbsp;a&nbsp;single&nbsp;compressed&nbsp;blob&nbsp;in&nbsp;a&nbsp;database&nbsp;(or&nbsp;in&nbsp;a&nbsp;flat-file),&nbsp;and&nbsp;read&nbsp;them&nbsp;into&nbsp;a&nbsp;.Net&nbsp;dataset.&nbsp;&nbsp;The&nbsp;geometry&nbsp;is&nbsp;represented&nbsp;as&nbsp;an&nbsp;NTS&nbsp;geomtry&nbsp;object.&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;a&nbsp;separate&nbsp;question,&nbsp;I'll&nbsp;ask&nbsp;about&nbsp;that.&nbsp;&nbsp;&nbsp;Once&nbsp;I&nbsp;have&nbsp;the&nbsp;"blob"&nbsp;out&nbsp;of&nbsp;the&nbsp;database&nbsp;or&nbsp;flatfile,&nbsp;I&nbsp;can&nbsp;instantiate&nbsp;my&nbsp;pouplated&nbsp;dataset&nbsp;in&nbsp;less&nbsp;than&nbsp;a&nbsp;second.&nbsp;&nbsp;That&nbsp;becomes&nbsp;my&nbsp;datasource.&nbsp;&nbsp;Getting&nbsp;the&nbsp;blob&nbsp;depends&nbsp;if&nbsp;it&nbsp;is&nbsp;coming&nbsp;down&nbsp;the&nbsp;wire&nbsp;from&nbsp;a&nbsp;web&nbsp;service,&nbsp;or&nbsp;opening&nbsp;a&nbsp;local&nbsp;flat&nbsp;file,&nbsp;etc.

As&nbsp;you&nbsp;review&nbsp;our&nbsp;slides,&nbsp;you&nbsp;wee&nbsp;that&nbsp;we&nbsp;operate&nbsp;from&nbsp;a&nbsp;busines&nbsp;navigational&nbsp;tree.&nbsp;&nbsp;A&nbsp;farmer&nbsp;has&nbsp;farms,&nbsp;farms&nbsp;have&nbsp;fields,&nbsp;and&nbsp;fields&nbsp;have&nbsp;cropzones.&nbsp;&nbsp;Cropzones&nbsp;have&nbsp;these&nbsp;FieldOp&nbsp;records&nbsp;and&nbsp;soil&nbsp;test&nbsp;layers,&nbsp;etc.&nbsp;&nbsp;&nbsp;The&nbsp;user&nbsp;will&nbsp;navigate&nbsp;around&nbsp;by&nbsp;clicking&nbsp;on&nbsp;those&nbsp;nodes.&nbsp;&nbsp;&nbsp;We&nbsp;expect&nbsp;no&nbsp;longer&nbsp;than&nbsp;a&nbsp;3&nbsp;second&nbsp;response&nbsp;for&nbsp;displaying&nbsp;the&nbsp;"yield&nbsp;map"&nbsp;for&nbsp;a&nbsp;large&nbsp;field&nbsp;after&nbsp;the&nbsp;user&nbsp;clicks&nbsp;on&nbsp;the&nbsp;node.&nbsp;&nbsp;&nbsp;&nbsp;It&nbsp;may&nbsp;be&nbsp;longer&nbsp;the&nbsp;first&nbsp;time&nbsp;they&nbsp;click&nbsp;on&nbsp;the&nbsp;node&nbsp;if&nbsp;we&nbsp;have&nbsp;to&nbsp;cache&nbsp;the&nbsp;data&nbsp;locally&nbsp;from&nbsp;a&nbsp;remote&nbsp;source.

Clearly&nbsp;my&nbsp;other&nbsp;question&nbsp;about&nbsp;filtering&nbsp;from&nbsp;a&nbsp;feature&nbsp;source&nbsp;was&nbsp;related&nbsp;to&nbsp;having&nbsp;a&nbsp;layer&nbsp;with&nbsp;all&nbsp;of&nbsp;the&nbsp;field&nbsp;boundaries&nbsp;for&nbsp;the&nbsp;farmer,&nbsp;themed&nbsp;in&nbsp;one&nbsp;manner,&nbsp;the&nbsp;boundaries&nbsp;of&nbsp;the&nbsp;currently&nbsp;selected&nbsp;farm&nbsp;themed&nbsp;in&nbsp;a&nbsp;second&nbsp;manner,&nbsp;and&nbsp;the&nbsp;boundary&nbsp;of&nbsp;a&nbsp;currently&nbsp;selected&nbsp;field&nbsp;themed&nbsp;in&nbsp;a&nbsp;third&nbsp;manner.&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;user&nbsp;clicks&nbsp;on&nbsp;a&nbsp;farm&nbsp;node,&nbsp;then&nbsp;there&nbsp;is&nbsp;no&nbsp;field&nbsp;layer,&nbsp;but&nbsp;I&nbsp;wanted&nbsp;to&nbsp;keep&nbsp;the&nbsp;placeholder&nbsp;on&nbsp;the&nbsp;map&nbsp;so&nbsp;I&nbsp;didn't&nbsp;have&nbsp;to&nbsp;reorder&nbsp;layers&nbsp;when&nbsp;they&nbsp;go&nbsp;back&nbsp;and&nbsp;click&nbsp;on&nbsp;a&nbsp;different&nbsp;field&nbsp;(or&nbsp;a&nbsp;different&nbsp;farm).&nbsp;&nbsp;&nbsp;&nbsp;As&nbsp;the&nbsp;farm&nbsp;and&nbsp;field&nbsp;layers&nbsp;are&nbsp;subsets&nbsp;of&nbsp;the&nbsp;full&nbsp;grower&nbsp;(farmer)&nbsp;layer,&nbsp;I&nbsp;wanted&nbsp;to&nbsp;only&nbsp;have&nbsp;one&nbsp;copy&nbsp;of&nbsp;the&nbsp;data&nbsp;and&nbsp;filter&nbsp;it&nbsp;for&nbsp;the&nbsp;subset.&nbsp;&nbsp;&nbsp;&nbsp;We&nbsp;know&nbsp;know&nbsp;of&nbsp;two&nbsp;ways&nbsp;to&nbsp;handle&nbsp;that&nbsp;efficiently.

All&nbsp;of&nbsp;our&nbsp;data&nbsp;is&nbsp;stored&nbsp;as&nbsp;WGS84&nbsp;Lon/Lat,&nbsp;and&nbsp;we&nbsp;dynamically&nbsp;project&nbsp;it&nbsp;into&nbsp;UTM&nbsp;NAD83&nbsp;at&nbsp;display.&nbsp;&nbsp;&nbsp;&nbsp;On&nbsp;our&nbsp;COM&nbsp;stuff,&nbsp;we&nbsp;could&nbsp;run&nbsp;a&nbsp;bulk&nbsp;transform&nbsp;on&nbsp;the&nbsp;high-frequency&nbsp;data&nbsp;and&nbsp;project&nbsp;50,000&nbsp;sites&nbsp;in&nbsp;about&nbsp;.2&nbsp;seconds.&nbsp;&nbsp;It&nbsp;was&nbsp;amazing.&nbsp;&nbsp;&nbsp;Proj4Net&nbsp;appears&nbsp;to&nbsp;be&nbsp;pretty&nbsp;fast,&nbsp;but&nbsp;I'm&nbsp;not&nbsp;sure&nbsp;if&nbsp;you&nbsp;run&nbsp;a&nbsp;bulk&nbsp;transform&nbsp;in&nbsp;your&nbsp;drawing&nbsp;stuff,&nbsp;or&nbsp;not.&nbsp;&nbsp;&nbsp;That's&nbsp;kind&nbsp;of&nbsp;where&nbsp;I'm&nbsp;looking&nbsp;for&nbsp;a&nbsp;flow&nbsp;diagram.&nbsp;&nbsp;Where&nbsp;does&nbsp;the&nbsp;transform&nbsp;occur,&nbsp;and&nbsp;is&nbsp;it&nbsp;performed&nbsp;each&nbsp;time&nbsp;the&nbsp;map&nbsp;is&nbsp;redrawn?&nbsp;&nbsp;&nbsp;Would&nbsp;appear&nbsp;that&nbsp;it&nbsp;is,&nbsp;as&nbsp;you&nbsp;ask&nbsp;for&nbsp;a&nbsp;new&nbsp;FeatureCollection&nbsp;as&nbsp;the&nbsp;map&nbsp;is&nbsp;zoomed&nbsp;and&nbsp;panned.&nbsp;&nbsp;&nbsp;So,&nbsp;that&nbsp;likely&nbsp;means&nbsp;that&nbsp;in&nbsp;my&nbsp;FeatureSource,&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;be&nbsp;aware&nbsp;of&nbsp;the&nbsp;target&nbsp;projection,&nbsp;and&nbsp;do&nbsp;the&nbsp;projection&nbsp;one&nbsp;time&nbsp;as&nbsp;I&nbsp;build&nbsp;the&nbsp;cached&nbsp;feature&nbsp;collection,&nbsp;preventing&nbsp;you&nbsp;from&nbsp;doing&nbsp;it&nbsp;over&nbsp;and&nbsp;over&nbsp;again?

We&nbsp;have&nbsp;been&nbsp;using&nbsp;NTS&nbsp;and&nbsp;GeoAPI&nbsp;since&nbsp;we&nbsp;started&nbsp;our&nbsp;port&nbsp;to&nbsp;.Net&nbsp;two&nbsp;years&nbsp;ago.&nbsp;&nbsp;We&nbsp;have&nbsp;a&nbsp;strong&nbsp;collection&nbsp;of&nbsp;supporting&nbsp;geometry&nbsp;and&nbsp;GIS&nbsp;objects&nbsp;that&nbsp;we&nbsp;have&nbsp;written&nbsp;around&nbsp;them&nbsp;(surfacing,&nbsp;topology&nbsp;cleaners,&nbsp;more&nbsp;robust&nbsp;intersections&nbsp;and&nbsp;unions,&nbsp;et).&nbsp;&nbsp;&nbsp;I&nbsp;won't&nbsp;be&nbsp;using&nbsp;any&nbsp;of&nbsp;the&nbsp;ThinkGeo&nbsp;components&nbsp;for&nbsp;geometry&nbsp;processing,&nbsp;per&nbsp;se...&nbsp;just&nbsp;presentation.

So....&nbsp;let&nbsp;me&nbsp;see&nbsp;what&nbsp;I've&nbsp;missed&nbsp;on&nbsp;your&nbsp;questions:&nbsp;&nbsp;&nbsp;I&nbsp;think&nbsp;I&nbsp;covered&nbsp;the&nbsp;first&nbsp;4.

I&nbsp;am&nbsp;somewhat&nbsp;familiar&nbsp;with&nbsp;a&nbsp;Grid.&nbsp;&nbsp;&nbsp;But,&nbsp;we&nbsp;do&nbsp;have&nbsp;a&nbsp;need&nbsp;to&nbsp;display&nbsp;the&nbsp;original&nbsp;raw&nbsp;GPS&nbsp;sites&nbsp;in&nbsp;some&nbsp;instances,&nbsp;and&nbsp;the&nbsp;grid&nbsp;is&nbsp;not&nbsp;applicable&nbsp;there.&nbsp;&nbsp;&nbsp;And,&nbsp;when&nbsp;we&nbsp;do&nbsp;build&nbsp;surfaces,&nbsp;we&nbsp;build&nbsp;them&nbsp;square&nbsp;to&nbsp;the&nbsp;geographic&nbsp;coordinate&nbsp;system,&nbsp;but&nbsp;want&nbsp;to&nbsp;display&nbsp;them&nbsp;in&nbsp;a&nbsp;projected&nbsp;coordinate&nbsp;system.&nbsp;&nbsp;&nbsp;Is&nbsp;that&nbsp;an&nbsp;option?&nbsp;&nbsp;&nbsp;&nbsp;And,&nbsp;then&nbsp;there&nbsp;is&nbsp;the&nbsp;issue&nbsp;of&nbsp;the&nbsp;"edge"&nbsp;cells&nbsp;of&nbsp;the&nbsp;grid&nbsp;needing&nbsp;to&nbsp;be&nbsp;clipped&nbsp;to&nbsp;a&nbsp;overlaying&nbsp;field&nbsp;boundary.&nbsp;&nbsp;&nbsp;That's&nbsp;not&nbsp;an&nbsp;option,&nbsp;is&nbsp;it?&nbsp;&nbsp;&nbsp;&nbsp;These&nbsp;are&nbsp;the&nbsp;issues&nbsp;that&nbsp;have&nbsp;kept&nbsp;us&nbsp;from&nbsp;pursuing&nbsp;the&nbsp;Grid&nbsp;approach&nbsp;in&nbsp;the&nbsp;past.

My&nbsp;personal&nbsp;preference&nbsp;is&nbsp;to&nbsp;theme&nbsp;surfaces&nbsp;and&nbsp;sites&nbsp;with&nbsp;a&nbsp;smooth&nbsp;gradiant&nbsp;legend,&nbsp;and&nbsp;yes...&nbsp;if&nbsp;it&nbsp;were&nbsp;known&nbsp;that&nbsp;this&nbsp;was&nbsp;happening,&nbsp;then&nbsp;we&nbsp;could&nbsp;calculate&nbsp;the&nbsp;index&nbsp;prorated&nbsp;between&nbsp;min&nbsp;and&nbsp;max&nbsp;values,&nbsp;and&nbsp;dive&nbsp;into&nbsp;the&nbsp;correct&nbsp;break.&nbsp;&nbsp;&nbsp;We&nbsp;also&nbsp;have&nbsp;the&nbsp;option&nbsp;for&nbsp;"custom"&nbsp;breaks,&nbsp;though,&nbsp;and&nbsp;many&nbsp;of&nbsp;our&nbsp;customers&nbsp;want&nbsp;to&nbsp;define&nbsp;that&nbsp;pH&nbsp;values&nbsp;between&nbsp;5.5&nbsp;and&nbsp;5.8&nbsp;are&nbsp;Red,&nbsp;5.8&nbsp;and&nbsp;6.1&nbsp;are&nbsp;yellow,&nbsp;etc,.&nbsp;&nbsp;&nbsp;So,&nbsp;we&nbsp;could&nbsp;optimize&nbsp;the&nbsp;renderer&nbsp;for&nbsp;indexing&nbsp;in&nbsp;a&nbsp;gradiant&nbsp;theme,&nbsp;but&nbsp;we&nbsp;cannot&nbsp;assume&nbsp;that&nbsp;is&nbsp;always&nbsp;what&nbsp;the&nbsp;user&nbsp;will&nbsp;want&nbsp;to&nbsp;use.

I&nbsp;do&nbsp;think&nbsp;the&nbsp;option&nbsp;of&nbsp;having&nbsp;all&nbsp;cells&nbsp;that&nbsp;are&nbsp;between&nbsp;5.5&nbsp;and&nbsp;5.8&nbsp;be&nbsp;in&nbsp;one&nbsp;layer,&nbsp;5.8&nbsp;to&nbsp;6.1&nbsp;in&nbsp;another&nbsp;layer,&nbsp;etc&nbsp;is&nbsp;quite&nbsp;intriguing.&nbsp;&nbsp;&nbsp;&nbsp;My&nbsp;datasource&nbsp;is&nbsp;always&nbsp;going&nbsp;to&nbsp;be&nbsp;all&nbsp;50,000&nbsp;points,&nbsp;but&nbsp;each&nbsp;layer&nbsp;could&nbsp;filter&nbsp;for&nbsp;only&nbsp;the&nbsp;appropriate&nbsp;cells.&nbsp;&nbsp;&nbsp;I&nbsp;need&nbsp;to&nbsp;understand&nbsp;more&nbsp;about&nbsp;how&nbsp;to&nbsp;implement&nbsp;a&nbsp;Layer&nbsp;object&nbsp;that&nbsp;is&nbsp;a&nbsp;collection&nbsp;of&nbsp;layers,&nbsp;and&nbsp;get&nbsp;them&nbsp;all&nbsp;drawn.&nbsp;&nbsp;&nbsp;&nbsp;I&nbsp;think&nbsp;this&nbsp;could&nbsp;be&nbsp;very&nbsp;promising.

My&nbsp;only&nbsp;connection&nbsp;to&nbsp;a&nbsp;database&nbsp;(of&nbsp;file&nbsp;system)&nbsp;is&nbsp;to&nbsp;get&nbsp;the&nbsp;data&nbsp;the&nbsp;first&nbsp;time&nbsp;the&nbsp;grower&nbsp;requests&nbsp;it,&nbsp;and&nbsp;to&nbsp;the&nbsp;extent&nbsp;possible,&nbsp;keep&nbsp;it&nbsp;cached&nbsp;in&nbsp;our&nbsp;in-memory&nbsp;.Net&nbsp;typed&nbsp;datasets.

Does&nbsp;the&nbsp;searching&nbsp;for&nbsp;the&nbsp;class&nbsp;break&nbsp;really&nbsp;take&nbsp;enough&nbsp;time&nbsp;to&nbsp;warrant&nbsp;this&nbsp;discussion?&nbsp;&nbsp;&nbsp;Very&nbsp;good&nbsp;point.&nbsp;&nbsp;&nbsp;All&nbsp;I&nbsp;know&nbsp;is&nbsp;that&nbsp;using&nbsp;other&nbsp;packages&nbsp;in&nbsp;the&nbsp;past,&nbsp;the&nbsp;rendering&nbsp;was&nbsp;extremely&nbsp;slow&nbsp;compared&nbsp;to&nbsp;what&nbsp;we&nbsp;could&nbsp;do.&nbsp;&nbsp;&nbsp;I'm&nbsp;still&nbsp;testing&nbsp;some&nbsp;of&nbsp;this&nbsp;stuff&nbsp;in&nbsp;MapSuite.&nbsp;&nbsp;&nbsp;15,000&nbsp;points&nbsp;is&nbsp;not&nbsp;an&nbsp;issue.&nbsp;&nbsp;&nbsp;&nbsp;75,000&nbsp;points&nbsp;hung&nbsp;my&nbsp;box.&nbsp;&nbsp;&nbsp;&nbsp;And&nbsp;then&nbsp;I&nbsp;had&nbsp;to&nbsp;get&nbsp;back&nbsp;to&nbsp;my&nbsp;day&nbsp;job.&nbsp;&nbsp;&nbsp;But&nbsp;I'll&nbsp;be&nbsp;exploring&nbsp;more&nbsp;this&nbsp;weekend,&nbsp;and&nbsp;was&nbsp;asking&nbsp;questions&nbsp;based&nbsp;upon&nbsp;lots&nbsp;of&nbsp;experience&nbsp;with&nbsp;other&nbsp;packages,&nbsp;and&nbsp;a&nbsp;little&nbsp;with&nbsp;MapSuite.

Sharing&nbsp;the&nbsp;code&nbsp;for&nbsp;the&nbsp;class&nbsp;break&nbsp;style&nbsp;would&nbsp;let&nbsp;me&nbsp;see&nbsp;how&nbsp;you&nbsp;are&nbsp;doing&nbsp;it,&nbsp;and&nbsp;I&nbsp;really&nbsp;think&nbsp;you&nbsp;will&nbsp;find&nbsp;that&nbsp;caching&nbsp;the&nbsp;last&nbsp;value&nbsp;found&nbsp;and&nbsp;testing&nbsp;it&nbsp;first&nbsp;on&nbsp;the&nbsp;next&nbsp;point&nbsp;could&nbsp;be&nbsp;a&nbsp;big&nbsp;help,&nbsp;if&nbsp;you&nbsp;are&nbsp;not&nbsp;doing&nbsp;that.&nbsp;&nbsp;&nbsp;But,&nbsp;I'm&nbsp;not&nbsp;clear&nbsp;if&nbsp;I&nbsp;would&nbsp;have&nbsp;the&nbsp;opportunity&nbsp;to&nbsp;write&nbsp;my&nbsp;own&nbsp;alternative&nbsp;class&nbsp;break&nbsp;style&nbsp;guy&nbsp;by&nbsp;deriving&nbsp;from&nbsp;one&nbsp;of&nbsp;your&nbsp;classes&nbsp;or&nbsp;not.&nbsp;&nbsp;&nbsp;It&nbsp;appears&nbsp;your&nbsp;compoennts&nbsp;are&nbsp;very&nbsp;extensible&nbsp;in&nbsp;many&nbsp;areas,&nbsp;but&nbsp;I&nbsp;don't&nbsp;really&nbsp;find&nbsp;that&nbsp;magic&nbsp;document&nbsp;that&nbsp;defines&nbsp;the&nbsp;full&nbsp;scope&nbsp;of&nbsp;your&nbsp;extensibility&nbsp;:)&nbsp;&nbsp;&nbsp;&nbsp;That's&nbsp;not&nbsp;a&nbsp;complaint.&nbsp;&nbsp;I&nbsp;hear&nbsp;the&nbsp;same&nbsp;thing&nbsp;from&nbsp;people&nbsp;that&nbsp;integrate&nbsp;my&nbsp;stuff&nbsp;into&nbsp;their&nbsp;applications,&nbsp;too&nbsp;:)

I'm&nbsp;not&nbsp;ready&nbsp;to&nbsp;explore&nbsp;tile&nbsp;caching.&nbsp;&nbsp;&nbsp;I&nbsp;think&nbsp;we&nbsp;have&nbsp;lots&nbsp;of&nbsp;other&nbsp;options,&nbsp;first.

Thanks,&nbsp;David.&nbsp;&nbsp;&nbsp;I&nbsp;appreciate&nbsp;the&nbsp;design&nbsp;brainstorming.&nbsp;&nbsp;&nbsp;I&nbsp;hope&nbsp;I&nbsp;have&nbsp;provided&nbsp;some&nbsp;useful&nbsp;information&nbsp;to&nbsp;help&nbsp;flush&nbsp;out&nbsp;the&nbsp;discussion.&nbsp;&nbsp;&nbsp;I'll&nbsp;be&nbsp;happy&nbsp;to&nbsp;visit&nbsp;by&nbsp;phone,&nbsp;but&nbsp;the&nbsp;background&nbsp;I've&nbsp;provided&nbsp;here&nbsp;should&nbsp;help&nbsp;that&nbsp;conversation&nbsp;if&nbsp;we&nbsp;need&nbsp;it.

That&nbsp;document&nbsp;that&nbsp;you&nbsp;have&nbsp;someone&nbsp;starting&nbsp;on&nbsp;the&nbsp;rendering&nbsp;workflow&nbsp;is&nbsp;really&nbsp;the&nbsp;most&nbsp;significant&nbsp;peice&nbsp;of&nbsp;documentation&nbsp;that&nbsp;would&nbsp;help&nbsp;me&nbsp;on&nbsp;knowing&nbsp;where&nbsp;to&nbsp;spend&nbsp;optimization&nbsp;resources.&nbsp;&nbsp;If&nbsp;that&nbsp;document&nbsp;can&nbsp;highlight&nbsp;the&nbsp;workflow&nbsp;steps&nbsp;as&nbsp;"overridable",&nbsp;that&nbsp;would&nbsp;be&nbsp;perfect.&nbsp;&nbsp;&nbsp;I&nbsp;guess&nbsp;any&nbsp;method&nbsp;you&nbsp;have&nbsp;called&nbsp;\*Core&nbsp;is&nbsp;overridable?

&nbsp;

&nbsp;

&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:** [March 20, 2009, 10:10am UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294/4 "2009-03-20T10:10:56Z")

</div>

I&nbsp;just&nbsp;reviewed&nbsp;the&nbsp;custom&nbsp;style&nbsp;video&nbsp;again.&nbsp;&nbsp;&nbsp;After&nbsp;some&nbsp;experience&nbsp;with&nbsp;buliding&nbsp;custom&nbsp;layers&nbsp;and&nbsp;data&nbsp;sources,&nbsp;it&nbsp;made&nbsp;a&nbsp;lot&nbsp;more&nbsp;sense,&nbsp;and&nbsp;I&nbsp;think&nbsp;it&nbsp;addresses&nbsp;many&nbsp;of&nbsp;the&nbsp;questions&nbsp;that&nbsp;I&nbsp;had&nbsp;raised&nbsp;here.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks!

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [March 25, 2009, 1:01pm UTC](https://community.thinkgeo.com/t/best-approach-to-optimized-rendering/294/5 "2009-03-25T13:01:37Z")

</div>

Ted,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;I&nbsp;am&nbsp;glad&nbsp;you&nbsp;found&nbsp;the&nbsp;video&nbsp;helpful.&nbsp;&nbsp;&nbsp;Just&nbsp;let&nbsp;me&nbsp;know&nbsp;any&nbsp;of&nbsp;the&nbsp;above&nbsp;issues&nbsp;it&nbsp;did&nbsp;not&nbsp;address&nbsp;and&nbsp;I&nbsp;would&nbsp;be&nbsp;happy&nbsp;to&nbsp;give&nbsp;you&nbsp;any&nbsp;insight&nbsp;&nbsp;or&nbsp;suggestions&nbsp;I&nbsp;have.&nbsp;  
&nbsp;&nbsp;  
&nbsp;David
