Exemplo n.º 1
0
        public ShapefileReader(string pathToShapefile)
        {
            //Ternary operation to get just the full path to the shapefile WITHOUT an extension.
            this.Path = System.IO.Path.HasExtension(pathToShapefile) ? pathToShapefile.Substring(0, pathToShapefile.Length - (System.IO.Path.GetExtension(pathToShapefile).Length)) : pathToShapefile;

            this.HasMainFiles = ShapefileReaderManager.ValidShapefileParts(this.Path);

            this.Shpfile = new ShapefileMain();

            this.CurrentRecord = 0;

            this.isDisposed = false;
        }
Exemplo n.º 2
0
 public bool ParseIndexFile()
 {
     this.OpenFileStream(this.Path + ".shx");
     if (IsStreamReadable())
     {
         this.Index = (ShapefileReaderManager.GetAllIndexRecords(this.readStream));
         this.CloseFileStream();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 3
0
 public bool ParseMainFile()
 {
     this.OpenFileStream(this.Path + ".shp");
     if (IsStreamReadable())
     {
         this.Shpfile.SetHeader(ShapefileReaderManager.GetHeader(this.readStream));
         this.Shpfile.SetRecords(ShapefileReaderManager.GetAllMainRecords(this.readStream));
         this.CloseFileStream();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public bool ReadMainHeader(bool keepOpen)
 {
     this.OpenFileStream(this.Path + ".shp");
     if (IsStreamReadable())
     {
         this.Shpfile.SetHeader(ShapefileReaderManager.GetHeader(this.readStream));
         if (!keepOpen)
         {
             this.CloseFileStream();
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }