ThinkGeo.com    |     Documentation    |     Premium Support

ESRI Map File Error

Hi, i have a problem.


I have many maps in esri format (.shp files), but not open in map suite.


 


Show the error:


 Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código. 



Detalles de la excepción: System.Exception: This file is not index file!



Error de código fuente: 




    
        
            Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
        
    



Seguimiento de la pila: 




    
        
            
            
[Exception: This file is not index file!]
   ThinkGeo.MapSuite.Core.x3b875a655fda308e.Open(String fileName, Boolean isReadOnly, x1a459055ddc267a4 openStreamLoadingEvent) +326
   ThinkGeo.MapSuite.Core.x67b37081fd5eb167.Open(String fileName, RtreeFileAccess fileAccess) +161

[InvalidOperationException: Error on opening.]
   ThinkGeo.MapSuite.Core.x67b37081fd5eb167.Open(String fileName, RtreeFileAccess fileAccess) +352
   ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.OpenCore() +208

[FileLoadException: There was a problem opening the file.]
   ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.OpenCore() +793
   ThinkGeo.MapSuite.Core.FeatureSource.Open() +128
   ThinkGeo.MapSuite.Core.VectorLayer.OpenCore() +27
   ThinkGeo.MapSuite.Core.Layer.Open() +23
   ThinkGeo.MapSuite.Core.MapEngine.OpenAllLayers() +158
   ThinkGeo.MapSuite.WebEdition.Map.SaveViewState() +891
   System.Web.UI.Control.SaveViewStateRecursive() +59
   System.Web.UI.Control.SaveViewStateRecursive() +156
   System.Web.UI.Control.SaveViewStateRecursive() +156
   System.Web.UI.Page.SaveAllState() +466
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2357

            

        
    


Error de servidor en la aplicación '/WebSite1'. 


This file is not index file!


 






 





 


Can you show me the code you called to open the shape file?  My guess is that you incorrectly called the overload where we specify the shape file and the shape file index.  I would suggest you try the API


ShapeFileLayer layer = new ShapeFileLayer(@"C:\MyShapes.shp",ShapeFileReadWriteMode.ReadWrite)


PLEASE KEEP READING AS YOU SHOULD ALSO BUILD AN INDEX



    I believe what you did was to call the API that specifies the shape file name and the index file.  Maybe you passed the .shx file as the index file and it caused this error.  If so then this is our fault for not providing you a better exception message and I should also explain how the index works in Map Suite 3.0.


    ESRI shape files only come by default with a very simple index call the .shx file.  This simply tells you the offset of each record in the .shp file.  In order to get good performance we create an R-Tree index separate from the .shx, .shp, and .dbf.  The R-Tree index allows us to find groups of object very fast inside of very large shape files.  Our R-Tree index is proprietary so you will need to build it for your shape files before you can use it.  The R-Tree index files have an extension of .idx and .ids, we will generate both of them when you build your index.  After you build your indexes you do not need to rebuild them again unless data is changed outside of Map Suite.


    To build the index you need to call a static method on the ShapeFileLayer like below.  Once you call this API it may take some time to build depending on the size of your shape file.  When it is finished it will have created a .idx and .ids file.  When you next open the shape file you will find it loads very fast and has great performance.


ShapeFileLayer.BuildIndexFile("@C:\MyShapes.shp");


    One thing to mention is that you do not need to call the ShapeFileLayer constructor that specifies an index if the .idx and .ids file names match the .shp file name.  We will automatically look for the matching .ids and .idx.  We intended the overload you might have used if you have a custom index file.  It is possible to build sparse index files that do not include all of the records in the shape file.  In this way you can build all kinds of filtered indexes and removes the requirement to cut your shape files.


    I hope this helps and what we will do is to add more intellisense around the overload.  We will also check to see if you pass an .idx into the index parameter of the constructor and then explain that this is not the index file we wanted.  Thanks for the great feedback and in reporting the issues you run into, we will make things better.




David




The code is: 
  
 ShapeFileLayer worldLayer = new ShapeFileLayer(@"C:\Galileo\Maps\Venezuela.shp", ShapeFileReadWriteMode.ReadOnly); 
  
 This shape not is open with Map Suite Explorer. 
  
  
 

Can you open up a ticket at helpdesk.thinkgeo.com and attach the shapefile so we can try and recreate it here and find out the cause of the issue?  
  
 If the shapefile is to large, on of our support personell can setup and FTP account you can FTP it to us. 
  
 I think once we are able to load it and see what is going on we should be able to come up with a fix. 
  
 Thanks!

I also have a problem with the shp files that I have. I cannot open them using sample code (map is not rendered). When I call the validate() function on the layer an exception is thrown stating that the shape has not been implemented. I read in these forums about the index file(s) so I opened the shp file with map suite explorer which did generate the index files but no map is rendered and any attempt to use the map or even resize the map suite explorer crashes the application. I have the 30 trial right now and want desperately for this product to work out well for me.

Dave 


First, thanks for joining the community, hope you enjoy the sharing and learning here.
 
I think maybe your shape file is corrupted, just wonder can you open it with some other GIS viewer other than Map Suite Explorer? Also can you send this file to us so we can have a look here? Please send it to support@thinkgeo.com and ask to forward to Ben, if it is too large, please connect support@thinkgeo.com and we can setup an ftp for you.
 
Thanks,
 
Ben