# SQLite Layer

**URL:** <https://community.thinkgeo.com/t/sqlite-layer/2319>\
**Category:** WinForms\
**Created:** [November 15, 2013, 6:26am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319 "2013-11-15T06:26:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@Jonathan3](https://community.thinkgeo.com/u/Jonathan3)\
**Post date:** [November 15, 2013, 6:26am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/1 "2013-11-15T06:26:17Z")

</div>

Following&nbsp;on&nbsp;from&nbsp;an&nbsp;earlier&nbsp;discussion&nbsp;I&nbsp;have&nbsp;been&nbsp;trying&nbsp;out&nbsp;using&nbsp;SQLite&nbsp;for&nbsp;a&nbsp;custom&nbsp;layer&nbsp;(just&nbsp;lines&nbsp;and&nbsp;polygons&nbsp;at&nbsp;the&nbsp;moment).&nbsp;&nbsp;I&nbsp;based&nbsp;my&nbsp;new&nbsp;layer&nbsp;on&nbsp;the&nbsp;example&nbsp;_ExtendingMapSuiteFeatureSource&nbsp;_and&nbsp;it&nbsp;works&nbsp;really&nbsp;well&nbsp;however&nbsp;my&nbsp;new&nbsp;layer&nbsp;does&nbsp;not&nbsp;appear&nbsp;to&nbsp;have&nbsp;a&nbsp;bounding&nbsp;box.&nbsp;&nbsp;As&nbsp;a&nbsp;guess&nbsp;I&nbsp;tried&nbsp;overriding&nbsp;_GetBoundingBoxCore&nbsp;_in&nbsp;the&nbsp;new&nbsp;feature&nbsp;source&nbsp;class&nbsp;but&nbsp;that&nbsp;didn’t&nbsp;help&nbsp;as&nbsp;it&nbsp;doesn’t&nbsp;seem&nbsp;to&nbsp;get&nbsp;called&nbsp;from&nbsp;anywhere.  
  
  
  
Could&nbsp;you&nbsp;help&nbsp;me&nbsp;with&nbsp;setting&nbsp;the&nbsp;bounding&nbsp;box&nbsp;for&nbsp;my&nbsp;new&nbsp;layer?  
  
  
  
Regards,  
  
Jonathan

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 18, 2013, 1:09am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/2 "2013-11-18T01:09:59Z")

</div>

Hi&nbsp;Jonathan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;I&nbsp;haven’t&nbsp;find&nbsp;original&nbsp;post,&nbsp;and&nbsp;if&nbsp;I&nbsp;misunderstand&nbsp;your&nbsp;question&nbsp;please&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Do&nbsp;you&nbsp;meant&nbsp;you&nbsp;modify&nbsp;our&nbsp;sample&nbsp;ExtendingMapSuiteFeatureSource&nbsp;to&nbsp;render&nbsp;your&nbsp;layer,&nbsp;and&nbsp;your&nbsp;layer&nbsp;data&nbsp;is&nbsp;saved&nbsp;in&nbsp;SQLite.&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;layer&nbsp;can&nbsp;be&nbsp;render&nbsp;well,&nbsp;but&nbsp;GetBoundingBox&nbsp;function&nbsp;don’t&nbsp;works,&nbsp;is&nbsp;that&nbsp;right?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;sample&nbsp;or&nbsp;more&nbsp;exactly&nbsp;information&nbsp;should&nbsp;be&nbsp;helpful.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Jonathan3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@Jonathan3](https://community.thinkgeo.com/u/Jonathan3)\
**Post date:** [November 18, 2013, 8:49am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/3 "2013-11-18T08:49:34Z")

</div>

Don,  
  
  
  
Your&nbsp;description&nbsp;is&nbsp;exactly&nbsp;right.&nbsp;&nbsp;The&nbsp;layer&nbsp;renders&nbsp;well&nbsp;but&nbsp;get&nbsp;bounding&nbsp;box&nbsp;for&nbsp;the&nbsp;layer&nbsp;returns&nbsp;an&nbsp;error&nbsp;as&nbsp;the&nbsp;bounding&nbsp;box&nbsp;is&nbsp;not&nbsp;defined.  
  
  
  
The&nbsp;code&nbsp;for&nbsp;the&nbsp;feature&nbsp;source&nbsp;layer&nbsp;is:  
  
(Not&nbsp;I&nbsp;added&nbsp;the&nbsp;override&nbsp;to&nbsp;GetBoundingBoxCore&nbsp;as&nbsp;an&nbsp;attempt&nbsp;to&nbsp;fix&nbsp;the&nbsp;getBoundingBox&nbsp;error.

> `using`&nbsp;`System;`  
> `using`&nbsp;`System.Collections.Generic;`  
> `using`&nbsp;`System.Collections.ObjectModel;`  
> `using`&nbsp;`System.Linq;`  
> `using`&nbsp;`System.Text;`  
> `using`&nbsp;`System.Data.SQLite;`  
> `using`&nbsp;`ThinkGeo.MapSuite.Core;`  
> &nbsp;  
> `namespace`&nbsp;`PTSimpleMapper`  
> `{`  
> `    ``class`&nbsp;`clsPearFeatureSource : FeatureSource`  
> `    ``{`  
> &nbsp;  
> `        ``private`&nbsp;`SQLiteConnection pearConnection = ``new`&nbsp;`SQLiteConnection();`  
> &nbsp;  
> `        ``// Default constructor`  
> `        ``// Should chain to a more complex constructor when add more functionality`  
> `        ``public`&nbsp;`clsPearFeatureSource() { }`  
> &nbsp;  
> `        ``// OVERRIDE STANDARD FUNCTIONS`  
> &nbsp;  
> `        ``// Open core `  
> `        ``protected`&nbsp;`override`&nbsp;`void`&nbsp;`OpenCore()`  
> `        ``{`  
> `            ``pearConnection = ``new`&nbsp;`SQLiteConnection(@``"Data Source=C:\Users\Jonathan\Documents\Visual Studio 2008\Projects\TestSQLite\TestSQLite\bin\Debug\myTestDB.db"``);`  
> `            ``pearConnection.Open();`  
> `        ``}`  
> &nbsp;  
> `        ``// Close core`  
> `        ``protected`&nbsp;`override`&nbsp;`void`&nbsp;`CloseCore()`  
> `        ``{`  
> `            ``pearConnection.Close();`  
> `        ``}`  
> &nbsp;  
> `        ``protected`&nbsp;`override`&nbsp;`Collection<Feature> GetAllFeaturesCore(IEnumerable<``string``> returningColumnNames)`  
> `        ``{`  
> &nbsp;  
> `            ``Collection<Feature> rtn = ``new`&nbsp;`Collection<Feature>();`  
> `            ``string`&nbsp;`theSQL = ``"SELECT Key, Value FROM Setting"``;`  
> `            ``SQLiteCommand getAllFeatures = ``new`&nbsp;`SQLiteCommand(theSQL, pearConnection);`  
> &nbsp;  
> `            ``try`  
> `            ``{`  
> `                ``using`&nbsp;`(SQLiteDataReader reader = getAllFeatures.ExecuteReader())`  
> `                ``{`  
> `                    ``while`&nbsp;`(reader.Read())`  
> `                    ``{ rtn.Add(``new`&nbsp;`Feature(reader[``"Value"``].ToString())); }`  
> `                ``}`  
> `            ``}`  
> `            ``finally`  
> `            ``{`  
> `                ``if`&nbsp;`(!getAllFeatures.Equals(``null``)) { getAllFeatures.Dispose(); }`  
> `            ``}`  
> &nbsp;  
> `            ``return`&nbsp;`rtn;`  
> `        ``}`  
> &nbsp;  
> `        ``protected`&nbsp;`override`&nbsp;`Collection<Feature> GetFeaturesInsideBoundingBoxCore(RectangleShape boundingBox, IEnumerable<``string``> returningColumnNames)`  
> `        ``{`  
> &nbsp;  
> `            ``Collection<Feature> rtn = ``new`&nbsp;`Collection<Feature>();`  
> `            ``string`&nbsp;`theSQL = ``string``.Format(``"SELECT Key, Value FROM Setting WHERE"`  
> `                ``+ ``" NOT (LR_Y >= {0}) AND NOT (UL_Y <= {1}) AND NOT (LR_X <= {2}) AND NOT (UL_X >= {3})"``,`  
> `                ``boundingBox.UpperLeftPoint.Y,`  
> `                ``boundingBox.LowerRightPoint.Y,`  
> `                ``boundingBox.UpperLeftPoint.X,`  
> `                ``boundingBox.LowerRightPoint.X);`  
> &nbsp;  
> `            ``SQLiteCommand getAllFeatures = ``new`&nbsp;`SQLiteCommand(theSQL, pearConnection);`  
> &nbsp;  
> `            ``try`  
> `            ``{`  
> `                ``using`&nbsp;`(SQLiteDataReader reader = getAllFeatures.ExecuteReader())`  
> `                ``{`  
> `                    ``while`&nbsp;`(reader.Read())`  
> `                    ``{ rtn.Add(``new`&nbsp;`Feature(reader[``"Value"``].ToString())); }`  
> `                ``}`  
> `            ``}`  
> `            ``finally`  
> `            ``{`  
> `                ``if`&nbsp;`(!getAllFeatures.Equals(``null``)) { getAllFeatures.Dispose(); }`  
> `            ``}`  
> &nbsp;  
> `            ``return`&nbsp;`rtn;`  
> `        ``}`  
> &nbsp;  
> `        ``protected`&nbsp;`override`&nbsp;`RectangleShape GetBoundingBoxCore()`  
> `        ``{`  
> &nbsp;  
> `            ``RectangleShape rtn = ``new`&nbsp;`RectangleShape();`  
> &nbsp;  
> `            ``string``[] theSQL = ``new`&nbsp;`string``[4] {`  
> `                ``"SELECT MAX(UL_Y) FROM Settings"``,`  
> `                ``"SELECT MIN(LR_Y) FROM Settings"``,`  
> `                ``"SELECT MAX(LR_X) FROM Settings"``,`  
> `                ``"SELECT MIN(UL_X) FROM Settings"``};`  
> &nbsp;  
> `            ``double``[] theLimits = ``new`&nbsp;`double``[4] { 0, 0, 0, 0 };`  
> &nbsp;  
> `            ``try`  
> `            ``{`  
> `                ``theLimits[0] = Convert.ToInt32(``new`&nbsp;`SQLiteCommand(theSQL[0], pearConnection).ExecuteScalar());`  
> `                ``theLimits[1] = Convert.ToInt32(``new`&nbsp;`SQLiteCommand(theSQL[1], pearConnection).ExecuteScalar());`  
> `                ``theLimits[2] = Convert.ToInt32(``new`&nbsp;`SQLiteCommand(theSQL[2], pearConnection).ExecuteScalar());`  
> `                ``theLimits[3] = Convert.ToInt32(``new`&nbsp;`SQLiteCommand(theSQL[3], pearConnection).ExecuteScalar());`  
> &nbsp;  
> `                ``PointShape ul = ``new`&nbsp;`PointShape(theLimits[4], theLimits[1]);`  
> `                ``PointShape lr = ``new`&nbsp;`PointShape(theLimits[3], theLimits[2]);`  
> &nbsp;  
> `                ``rtn = ``new`&nbsp;`RectangleShape(ul, lr);`  
> &nbsp;  
> `            ``}`  
> `            ``finally`  
> `            ``{`  
> `            ``}`  
> &nbsp;  
> `            ``return`&nbsp;`rtn;`  
> `        ``}`  
> &nbsp;  
> `        ``protected`&nbsp;`override`&nbsp;`int`&nbsp;`GetCountCore()`  
> `        ``{`  
> `            ``int`&nbsp;`rtn = 0;`  
> `            ``string`&nbsp;`theSQL = ``"SELECT COUNT(*) FROM Setting"``;`  
> `            ``SQLiteCommand getCount = ``new`&nbsp;`SQLiteCommand(theSQL, pearConnection);`  
> &nbsp;  
> `            ``try`  
> `            ``{ `  
> `                ``rtn = Convert.ToInt32(getCount.ExecuteScalar()); `  
> `            ``}`  
> `            ``finally`  
> `            ``{`  
> `                ``if`&nbsp;`(!getCount.Equals(``null``)) { getCount.Dispose(); }`  
> `            ``}`  
> &nbsp;  
> `            ``return`&nbsp;`rtn;`  
> `        ``}`  
> &nbsp;  
> `    ``}`  
> `}`

  
The&nbsp;error&nbsp;I&nbsp;get&nbsp;when&nbsp;trying&nbsp;"theMap.CurrentExtent&nbsp;=&nbsp;theOverlay.Layers.First().GetBoundingBox();"&nbsp;is:  
  
  
  
System.NotSupportedException&nbsp;was&nbsp;unhandled  
&nbsp;&nbsp;Message="This&nbsp;Layer&nbsp;doesn’t&nbsp;have&nbsp;a&nbsp;boundingBox."  
&nbsp;&nbsp;Source="MapSuiteCore"  
&nbsp;&nbsp;StackTrace:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ohM=.TFA=.ZVE=(Boolean&nbsp;ZlE=)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.Core.Layer.GetBoundingBox()  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;PTSimpleMapper.clsProjectSupport.findFirstBoundingBox(WinformsMap&&nbsp;theMap,&nbsp;LayerOverlay&&nbsp;theOverlay)&nbsp;in&nbsp;C:\Users\Jonathan\Documents\Visual&nbsp;Studio&nbsp;2008\Projects\simpleMapper\simpleMapper\MapProject\clsProjectSupport.cs:line&nbsp;383  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;PTSimpleMapper.clsProjectSupport.showFullExtent(WinformsMap&&nbsp;theMap,&nbsp;LayerOverlay&&nbsp;theOverlay)&nbsp;in&nbsp;C:\Users\Jonathan\Documents\Visual&nbsp;Studio&nbsp;2008\Projects\simpleMapper\simpleMapper\MapProject\clsProjectSupport.cs:line&nbsp;368  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;PTSimpleMapper.clsProjectSupport.showFullExtent(WinformsMap&&nbsp;theMap)&nbsp;in&nbsp;C:\Users\Jonathan\Documents\Visual&nbsp;Studio&nbsp;2008\Projects\simpleMapper\simpleMapper\MapProject\clsProjectSupport.cs:line&nbsp;478  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;PTSimpleMapper.frmMap.anyNavigationButton\_Click(Object&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;in&nbsp;C:\Users\Jonathan\Documents\Visual&nbsp;Studio&nbsp;2008\Projects\simpleMapper\simpleMapper\Forms&nbsp;and&nbsp;Dialogs\frmMap.cs:line&nbsp;1103  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.OnClick(EventArgs&nbsp;e)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Button.OnClick(EventArgs&nbsp;e)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Button.OnMouseUp(MouseEventArgs&nbsp;mevent)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.WmMouseUp(Message&&nbsp;m,&nbsp;MouseButtons&nbsp;button,&nbsp;Int32&nbsp;clicks)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.WndProc(Message&&nbsp;m)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.ButtonBase.WndProc(Message&&nbsp;m)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Button.WndProc(Message&&nbsp;m)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&&nbsp;m)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&&nbsp;m)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr&nbsp;hWnd,&nbsp;Int32&nbsp;msg,&nbsp;IntPtr&nbsp;wparam,&nbsp;IntPtr&nbsp;lparam)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&&nbsp;msg)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32&nbsp;dwComponentID,&nbsp;Int32&nbsp;reason,&nbsp;Int32&nbsp;pvLoopData)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32&nbsp;reason,&nbsp;ApplicationContext&nbsp;context)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Windows.Forms.Application.Run(Form&nbsp;mainForm)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;PTSimpleMapper.Program.Main()&nbsp;in&nbsp;C:\Users\Jonathan\Documents\Visual&nbsp;Studio&nbsp;2008\Projects\simpleMapper\simpleMapper\Program.cs:line&nbsp;18  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.\_nExecuteAssembly(Assembly&nbsp;assembly,&nbsp;String[]&nbsp;args)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.AppDomain.ExecuteAssembly(String&nbsp;assemblyFile,&nbsp;Evidence&nbsp;assemblySecurity,&nbsp;String[]&nbsp;args)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart\_Context(Object&nbsp;state)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ThreadHelper.ThreadStart()  
&nbsp;&nbsp;InnerException:&nbsp;  
  
  
  
Regards,  
  
Jonathan

---

<div class="post-metadata">

**Author:** ![Jonathan3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@Jonathan3](https://community.thinkgeo.com/u/Jonathan3)\
**Post date:** [November 18, 2013, 9:22am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/4 "2013-11-18T09:22:13Z")

</div>

I&nbsp;may&nbsp;have&nbsp;solved&nbsp;this&nbsp;one,&nbsp;but&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;know&nbsp;if&nbsp;I’m&nbsp;going&nbsp;about&nbsp;it&nbsp;the&nbsp;right&nbsp;way?&nbsp;  
&nbsp;&nbsp;  
&nbsp;In&nbsp;the&nbsp;featureLayer&nbsp;I&nbsp;did&nbsp;a&nbsp;simple&nbsp;override&nbsp;of&nbsp;HasBoundingBox&nbsp;to&nbsp;return&nbsp;TRUE.&nbsp;&nbsp;This&nbsp;resulted&nbsp;in&nbsp;the&nbsp;FeatureSource&nbsp;function&nbsp;GetBoundingBoxCore&nbsp;being&nbsp;called.&nbsp;&nbsp;There&nbsp;were&nbsp;a&nbsp;few&nbsp;errors&nbsp;in&nbsp;my&nbsp;code&nbsp;for&nbsp;this&nbsp;function&nbsp;but&nbsp;they&nbsp;were&nbsp;quite&nbsp;easy&nbsp;to&nbsp;fix.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Is&nbsp;it&nbsp;OK&nbsp;to&nbsp;simply&nbsp;return&nbsp;TRUS?&nbsp;or&nbsp;should&nbsp;I&nbsp;be&nbsp;doing&nbsp;some&nbsp;sort&nbsp;of&nbsp;check&nbsp;or&nbsp;something&nbsp;for&nbsp;HasBoundingBox?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Jonathan

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 19, 2013, 3:12am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/5 "2013-11-19T03:12:54Z")

</div>

Hi&nbsp;Jonathan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;you&nbsp;are&nbsp;right,&nbsp;as&nbsp;below&nbsp;is&nbsp;the&nbsp;description&nbsp;about&nbsp;HasBoundingBox:&nbsp;  
&nbsp;&nbsp;  
&nbsp;This&nbsp;property&nbsp;indicates&nbsp;whether&nbsp;a&nbsp;Layer&nbsp;has&nbsp;a&nbsp;BoundingBox&nbsp;or&nbsp;not.&nbsp;If&nbsp;it&nbsp;has&nbsp;no&nbsp;BoundingBox,&nbsp;it&nbsp;will&nbsp;throw&nbsp;an&nbsp;exception&nbsp;when&nbsp;you&nbsp;call&nbsp;the&nbsp;GetBoundingBox()&nbsp;and&nbsp;GetFullExtent()&nbsp;APIs.&nbsp;  
&nbsp;&nbsp;  
&nbsp;So&nbsp;just&nbsp;override&nbsp;HasBoundingBox&nbsp;is&nbsp;OK.&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;&nbsp;public&nbsp;override&nbsp;bool&nbsp;HasBoundingBox&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get&nbsp;{&nbsp;return&nbsp;true;&nbsp;}&nbsp;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don&nbsp;

---

<div class="post-metadata">

**Author:** ![Jonathan3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@Jonathan3](https://community.thinkgeo.com/u/Jonathan3)\
**Post date:** [November 19, 2013, 5:32am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/6 "2013-11-19T05:32:45Z")

</div>

Don,&nbsp;  
&nbsp;&nbsp;  
&nbsp;OK,&nbsp;thanks.&nbsp;&nbsp;I&nbsp;did&nbsp;think&nbsp;I&nbsp;might&nbsp;put&nbsp;in&nbsp;one&nbsp;simple&nbsp;check&nbsp;and&nbsp;only&nbsp;return&nbsp;true&nbsp;for&nbsp;HasBoundingBox&nbsp;if&nbsp;the&nbsp;count&nbsp;of&nbsp;features&nbsp;is&nbsp;not&nbsp;zero.&nbsp;  
&nbsp;&nbsp;  
&nbsp;All&nbsp;the&nbsp;best,&nbsp;  
&nbsp;Jonathan

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 20, 2013, 12:15am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/7 "2013-11-20T00:15:46Z")

</div>

Jonathan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;can&nbsp;just&nbsp;return&nbsp;a&nbsp;new&nbsp;RectangleShape&nbsp;if&nbsp;the&nbsp;feature&nbsp;number&nbsp;is&nbsp;zero&nbsp;in&nbsp;GetBoundingBoxCore.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don

---

<div class="post-metadata">

**Author:** ![Jonathan3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/j/c68b51/32.png) [@Jonathan3](https://community.thinkgeo.com/u/Jonathan3)\
**Post date:** [November 20, 2013, 4:59am UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/8 "2013-11-20T04:59:01Z")

</div>

Don,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thank&nbsp;you,&nbsp;that&nbsp;makes&nbsp;good&nbsp;sense.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;Jonathan

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [November 20, 2013, 8:45pm UTC](https://community.thinkgeo.com/t/sqlite-layer/2319/9 "2013-11-20T20:45:08Z")

</div>

Jonathan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;am&nbsp;glad&nbsp;to&nbsp;know&nbsp;my&nbsp;reply&nbsp;helpful,&nbsp;any&nbsp;question&nbsp;please&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Reagards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
