ThinkGeo.com    |     Documentation    |     Premium Support

BuildIndex() error

I am trying to build and index on a shape file created from ArcMap. Any thoughts? 


 I receive the following error:


 "The input double value is out of range.\r\nParameter name: maxX"


and stack trace:


"   at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.x12e7df23649722cf(Double x86d4512e4c7d8814, String x34decc57f0820440, Double xaee3bf422e2fd725, x1acec04cd58c1af5 xa798986acdb65a29, Double xe21f77686f8b957e, x1acec04cd58c1af5 x495f4164830ffad5)\r\n   at ThinkGeo.MapSuite.Core.x6d719af406ea4c2c.xb86d8097d383be05(Double x86d4512e4c7d8814, String x34decc57f0820440, Double xaee3bf422e2fd725, x1acec04cd58c1af5 xa798986acdb65a29)\r\n   at ThinkGeo.MapSuite.Core.RectangleShape..ctor(Double minX, Double maxY, Double maxX, Double minY)\r\n   at ThinkGeo.MapSuite.Core.xdad12102199d8695.GetBoundingBoxById(Int32 recordIndex)\r\n   at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.BuildIndexFile(String shapePathFilename, String indexPathFilename, Projection projection, String columnName, String regularExpression, BuildIndexMode buildIndexMode, Encoding encoding)\r\n   at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.BuildIndexFile(String shapePathFilename, String indexPathFilename, Projection projection, String columnName, String regularExpression, BuildIndexMode buildIndexMode)\r\n   at ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.BuildIndexFile(String shapePathFilename, BuildIndexMode buildIndexMode)\r\n   at ThinkGeo.MapSuite.Core.ShapeFileFeatureLayer.BuildIndexFile(String pathFilename, BuildIndexMode rebuildExistingIndexMode)\r\n   at thinkgeodemo.Form1.InitializeMap() in C:\\tlcprojects\\redistricting\\thinkgeodemo\\thinkgeodemo\\Form1.cs:line 611\r\n   at thinkgeodemo.Form1.Form1_Load(Object sender, EventArgs e) in C:\\tlcprojects\\redistricting\\thinkgeodemo\\thinkgeodemo\\Form1.cs:line 119\r\n   at System.EventHandler.Invoke(Object sender, EventArgs e)\r\n   at System.Windows.Forms.Form.OnLoad(EventArgs e)\r\n   at System.Windows.Forms.Form.OnCreateControl()\r\n   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r\n   at System.Windows.Forms.Control.CreateControl()\r\n   at System.Windows.Forms.Control.WmShowWindow(Message& m)\r\n   at System.Windows.Forms.Control.WndProc(Message& m)\r\n   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)\r\n   at System.Windows.Forms.ContainerControl.WndProc(Message& m)\r\n   at System.Windows.Forms.Form.WmShowWindow(Message& m)\r\n   at System.Windows.Forms.Form.WndProc(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)\r\n   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)\r\n   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)\r\n   at System.Windows.Forms.Control.set_Visible(Boolean value)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n   at System.Windows.Forms.Application.Run(Form mainForm)\r\n   at thinkgeodemo.Program.Main() in C:\\tlcprojects\\redistricting\\thinkgeodemo\\thinkgeodemo\\Program.cs:line 20"



Ed, 
  
   Can you show me the call you made to build the index?  Are you doing a projection on it or anything special?  What unit is the data in feet. meters, decimal degrees?  Of course if you can send us the file that would help also,  if you can send and e-mail to support@thinkgeo.com
  
 David

David,  
 Seting the mapunit to meters and nothing else.  The code is in the email that has been sent with the shape file attached.  The subject is BuildIndex error for David

David, 
 I was able to find a workaround to this problem.  If id did the export from ArcMap and selected the option to export all feature in the active view instead of all features, I was able to build the index in ThinkGeo.   
  
 Im curious if there is some weirdness in my data that has some points way off that are not viewable.  I’m curious what results you come up with, but I am able to continue on. 
  
 Thanks. 
 Ed

Ed,


Sorry for the delay, up to now, I did not get the data from David, I will ask from him after I get back to work after our festival time.
 
From the Call Stack, it seems the the parameters which pass in the constructor of RectangleShape isn’t right. And we read the bounding box of the shape from .shp file. You can use the following codes to check each bounding box of the record is right, if it’s wrong it will throw same exception as the first post, following are the codes.

    ShapeFileFeatureSource source = new ShapeFileFeatureSource("Your ShapeFile Path");
            source.Open();
            int count = source.GetCount();
            for (int i = 1; i <= count; i++)
            {
                RectangleShape boundingBox = source.GetBoundingBoxById(i.ToString());
            }
            source.Close();

 
Any more questions please let me know.
Thanks.
 
Yale