/// <summary> /// If the IDX file does not exists, we create it. /// </summary> /// <param name="layer"></param> public static void RebuildIndexFile(ShapeFileFeatureLayer layer) { try { ShapeFileFeatureSource.BuildIndexFile(layer.ShapePathFileName, BuildIndexMode.Rebuild); } catch (IOException ioException) { } }
public static void CheckIndexFile(FileInfo shapefileInfo) { try { string indexFileName = shapefileInfo.FullName.Replace(".shp", ".idx"); if (!File.Exists(indexFileName)) { ShapeFileFeatureSource.BuildIndexFile(shapefileInfo.FullName, BuildIndexMode.Rebuild); } } catch (Exception) { } }
private async Task GenerateTiles() { if (cancellationTokenSource != null) { cancellationTokenSource.Cancel(); cancellationTokenSource.Dispose(); } cancellationTokenSource = new System.Threading.CancellationTokenSource(); List <string> attributes = new List <string>(); for (int i = 0; i < clbSelectedAttributes.CheckedItems.Count; ++i) { attributes.Add(clbSelectedAttributes.CheckedItems[i].ToString()); } OutputMessage("Processing Vector tiles..\n"); DateTime tick = DateTime.Now; ShapeFileFeatureSource.BuildIndexFile(this.txtInputShapeFile.Text, BuildIndexMode.DoNotRebuild); await MBTilesGenerator.Process(this.txtInputShapeFile.Text, this.txtMbtilesFilePathname.Text, cancellationTokenSource.Token, (int)(nudStartZoom.Value), (int)(nudEndZoom.Value), 512, attributes); OutputMessage("Processing Vector tiles complete. Elapsed time:" + DateTime.Now.Subtract(tick) + "\n"); }