ThinkGeo.com    |     Documentation    |     Premium Support

Why does the new ShapeFileFeatureLayer class need .IDS and .IDX files?

Hi,


I downloaded the new beta version this morning and have been trying to re-write my application but have not gotten very far as I couldn't get my shape files to display.  The Google Map functionality works, but if I try to overlay the Google Map with a shape file, OR try to display a shape file by itself, I get a pink screen with the outlines where the "tile" images are missing.  I finally went back to your "DisplayASimpleMap" sample and copied my 3 shape file components into the directory where your shape files are and then changed the code to reflect my shape file and the same thing happens: mine do not display.


I noticed that you have 5 components to your shape files: a .DBF file, a .SHP file, .SHX file, a .IDS file and a .IDX file.  The shape files I am working with only have the 3 (.DBF, .SHP, .SHX) components.  They have worked with your previous beta versions as well as version 2.  When I removed your cntry02.ids and cntry02.idx files from the SampleData\World directory and ran the DisplayASimpleMap application, the same thing happens...pink screen and missing images.  I'm dead in the water as we don't have these .IDS and .IDX files!  Is there a way to use the ShapeFileFeatureLayer class without the .IDS and .IDX files?


Thanks,


Tom



Tom, 
  
 Thanks for the post, I think may be some problem with the new Beta and the old index files because I’m seeing a similar issue.  As a work around what I did was delete the *.idx &*.ids files and then go to Map Suite Explorer (Installed with the Evaluation Edition under Start/Programs/ThinkGeo) and open up the layer. Map Suite Explorer will notice that no index file is present and will ask if you want to build one.  If you say yes it will rebuilt it and that seemed to work for my file.  I know rebuilding the index file doesn’t sound like fun, but it’s a work temporary around while we find out what’s going on with it reading the index files. 


Thanks much!  That worked!  it would just be difficult to have to do that with production data, but sounds like you are working on it.  Also, since my shape files are relatively small (I guess?) it took no time at all to generate the index files.


Two minor issues with Map Suite Explorer:  After I installed it and ran it, it couldn't find the GeoAPI.dll file and just locked up when I clicked the 'Continue' button.  After I killed it, I copied that DLL into the Map Suite Explorer directory.  Then it worked just fine.  The other thing is that the message box that popped up altering me to the fact that there were no index files appears to be wanting the name of the shape file that I selected.  See the attached picture.


One final (for now...) question: Is there an easy way to determine what a CurrentExtent should be?  In the ShapeFilesOverGoogleMap sample, it gives a CurrentExtent (in meters) for the US.  I need it for the world.  The numbers are huge, but when I try and modify them (by just guessing) I sometimes get an exception stating that the value is out of range.  How can I figure out what the CurrentExtent should be without lots of trial and error?


Thanks,


Tom


 




Oh yeah…thanks for the quick reply!!

Hi,


I'm also having a problem displaying a zip code shapefile (from ThinkGeo) with an old index file in the new Web Edtion Beta 2.  To recreate the issue you can download the zip code file from the link below and try to use this file instead of the cntry02.shp file in the "Display a Simple Map" sample application that comes with the evaluation edition.


thinkgeo.com/download/zip_poly.zip


Please let me know if there is any work around besides rebuilding the indexes as I have a lot of  shapefiels and this will take a lot of time.


Thanks



Tom,


The Map Suite Explorer issue will be corrected in the next version, thanks for pointing it out. 


For now we cannot get GoogleMap’s FullExtent without trials. Maybe in the next version we will provide a property like GoogleMapFullExtent or something which will help you easy to get. Here is a trick how to get the FullExtent through trial. Enable the Mouse Coordinate with the following code and you will get the current coordinate while moving the mouse. Move the mouse to the border you want and write down the easting/nothing, you get it.
 
Map1.MapTools.MouseCoordinate.Enabled = true;
 
Here is one I got, may not be proper for your map as the final extent will be modified according to the ratio of Map.Width and Map.Height.
 
RectangleShape(-15262945, 12797393, 15889117, -5126784)


Ben.



Thanks Ben, 
  
 Your coordinates gave me a good starting point and your “trick” was a big help!  I know you guys are busting your tails in getting the new version out and watching for, and answering feedback.  Keep up the good work (…'cause I’ll probably have more questions… ;-) )! 
  
 Tom

Tom, very happy that helps. Just let us know for more queries.  
 Ben.