I have a problem with some polygons disappearing from a on a layer created from a quite small shape file. The file initially displays correctly but as it is zoomed in certain polygons disappear but may reappear when the map is panned down.
I have tried recreating the index file (.IDX) using BuildIndexFile but that didn't help.
I also wondered if it had anything to do with projection, however the map units are set to meters and I also have a .PRJ file British National Grid.
I don’t think that related with projection. Because you can view it first but when zoom in it disappear. If it’s projection problem, you shouldn’t see the shape at first.
Could you show me the render code part and let me know whether you set style for each zoom level?
// Get the estate outline from user selected shape file ShapeFileFeatureLayer estateLayer = newShapeFileFeatureLayer(folderPath, ShapeFileReadWriteMode.ReadOnly); ShapeFileFeatureLayer.BuildIndexFile(folderPath, BuildIndexMode.DoNotRebuild);
// Format the estate polygons estateLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(clsBaseFileSupport.theEstateArea); estateLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; estateLayer.Transparency = TRANS; lOverlay.Layers.Add(ESTATE, estateLayer);
// //saveCopy(estateLayer, @"Z:\New PC\Special Data Files - The Estates\Estate Boundaries\Dalton Estate Boundary\TEST ONE.SHP");
// Return success returntrue;
}
TRANS is a constant set to 150. There are no zoom level visibility options set.
You may well notice the commented out line that calls a function to save a copy of the data in a new shape file, interestingly the Think GEO saved copy of the original shape file works fine so it is looking like maybe the contents of the original shape file is at fault?
Thanks for your further ifnroamtion, we tried to recreate your problem with the latest dll pakcag 7.0.115.0 with our own data, but the problem didn’t show up, would you please get the latest dll package and try it again, if it is still there, would you please provide us your data for a further test, and if possible a self-contained sample will be hightly appreciated.
It is difficult for me to update to the latest dll package as we have not yet updated from Visual Studio 2008 - so we are still using version 6. I’m not that surprised that you couldn’t recreate the problem as it definitely looks to be limited to shape files from one particular source - all other sources have been fine. I would quite like to pinpoint what it is about the file that causes a problem, at the moment I suspect minimum bounding rectangles may be set wrong in the file for the polygons that disappear, is that something you can help me check or is that outside of a reasonable help-desk request?
Thanks for your furhter information, would you please send us your data and your dll version we will check if there are any thing we could do for it.You could upload it or send it to forumsupport@thinkgeo.com.
Thanks for your data, we have found the reason, it is the bounding box for the 26th shape(starts from 1 not 0) is not correct, it was "497202.86,440979.350005,498460.12,440979.349995" but actually it should be "497202.86,442563.82,498460.12,440979.35". So, after correct the boundingbox value for the 26th shape and then rebuild the index file, it should work.