C # Read properties information for SHP

Source: Internet
Author: User
Tags dbase

A full Esri shape file consists of a master file, an index file, and a dBASE table file. The main file is a direct access, variable record length file in which each record describes a shape consisting of its vertex list. In the index file, each record is the offset in the main file from the header of the main file in the corresponding record. dBASE records the attributes recorded in the corresponding master file, and each master file record corresponds to a property record in dBASE. The one by one correspondence between geometric objects and attributes is based on the record number. Attribute records in a dBASE file must remain in the same order as the records in the master file. If you only need to process dbase files, you can use the operation of the database processing, the first download vfpodbc driver, directly installed.

  1. To establish a connection string
    1string filedir = System.Environment.CurrentDirectory; 2 string relativepath = @ "beijing\ways.dbf" 3 filePath = Path.Combine (Filedir, relativepath); 4 connstr = @ "driver={microsoft Visual FoxPro Driver}; SOURCETYPE=DBF; Sourcedb=5  "; Exclusive=no; Null=no; Collate=machine; Backgroundfetch=no;deleted=no        
  2. query statement
     1  Span style= "color: #0000ff;" >string  selectsql = @ " select * from   + FilePath;  2  DataSet DataSet = Odbchelper.executedatas ET (ConnStr, CommandType.Text, selectsql);  3  datatable datatable = Dataset.tables[0]; 
  3. UPDATE statement
     1  " Span style= "color: #0000ff;" >string  updatesql =  update   " + FilePath + "   SET len=   " + length + "   where ID =   " + "   "  " + ID + "   "  " ;  2  odbchelper.executenonquery (connstr, CommandType.Text, updatesql); 
           

Finally, the ArcGIS software verifies that the property information that is being modified has been updated.

Resources:

http://blog.csdn.net/lee576/article/details/9959357

C # Read properties information for SHP

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.