www.as-se.org/ssms
Studies in Surveying and Mapping Science (SSMS) Volume 3, 2015
Conversion Algorithm of Data Formats from VCT to GDB Jingli Wang*, Xiaofeng Wang, Yuntao Ma School of Traffic Engineering, Shenyang Jianzhu University, Shenyang, China, 110168 13898803180@163.com; 2wxf_sy@126.com; 3mayuntao7@163.com
*1
Abstract Geospatial data is usually organized and managed by Geodatabase(GDB) Technology. But GDB is not compatible with diversified forms of geographic data, a spatial data transfer standard is necessary. VCT is the vector of the geospatial data transfer format. Incompatible data formats can be converted to GDB by VCT which is transition data format. The conversion of data formats from VCT to GDB is the key to land resource database construction and resource sharing. The Data Format Conversion Optimization(DFCO) algorithm was proposed through dynamic index file based on secondary development platform of AE and C# by comparing the VCT and GDB data model. The DFCO algorithm realized the conversion of data formats from VCT to GDB so that more geospatial data formats can be compatible with land resource database. By using DFCO algorithm, cost of land resource database construction will be reduced and conversion efficiency of data formats will be improved. Keywords VCT; GDB; ArcGIS Engine; Geodatabase; CNSDTF; Dynamic Index
Introduction With the development of geographic information system, the ways of geographic data storage gradually change from paper to digital storage. Geographic data formats are diversified in land resource database construction. Because there is no standard storage format, the cost of database construction of GIS limits the development of GIS without data resource sharing[1-8]. As vector format of the spatial data transfer standard, VCT has not been fully utilized because of no unified standard of data transfer format[9-11]. By now many database management systems are based on the secondary development platform of AE which are incompatible with VCT. Therefore, the study on conversion of data formats from VCT to GDB is necessary and can improve the compatibility of GDB with more data formats through VCT[1213]. This paper analysed the model of data structure of VCT and GDB by contrast, indicated the method of the storage of geometrical data and attribute data by creating dynamic index file, showed how to check the reliability of DFCO algorithm and discussed the shortage of DFCO algorithm. Contrast of VCT and GDB Data Model VCT, vector of national data transfer format, consists of 6 parts which are header file, feature type, attribute structure, geometrical data, annotation and attribute data. GDB is a unified and relational database of AreGIS which is used for managing GIS data, makes unified description of geospatial data such as vector, raster, TIN, network, locates under common frame and stores attribute data and geometrical data in the unique system. Point, line and polygon of VCT should be created in GDB. Geospatial data of VCT is stored in field called Shape whose type is OLE object in GDB and attribute data of VCT is stored in other fields. Map symbols are not defined in VCT which should be redefined in GDB. The differences of structure between VCT and GDB are shown in Table 1. DFCO Algorithm Geometrical data and attribute data are stored separately in VCT, which stores in the same table in GDB. The 20
Studies in Surveying and Mapping Science (SSMS) Volume 3, 2015
www.as-se.org/ssms
results of table 1 illustrate the two kinds of data of VCT can be converted to GDB separately because they are related to each other by the field called BSM. Therefore, the position where DFCO stopped reading VCT to carry on data formats conversion was recorded in dynamic index file which was created based on the size of point, line, polygon data in VCT. The flow chart of DFCO algorithm was shown in Figure 1. The key steps of DFCO algorithm are shown in the following: TABLE 1 THE DIFFERENCE OF STRUCTURE BETWEEN VCT AND GDB
Data Types
Geometrical Data
Attribute Data
Other
VCT
Geometrical data of point, line, polygon are recorded with coordinates of point which are related to attribute data by feature ID code and layer name.
The part called Attribute records all of attribute data of VCT and geometrical data records a part of attribute data to be related to Attribute data.
Default colors are defined, while map symbols are not.
GDB
Point, line, polygon are recorded with IPoint、IPolyline、IPolygon in the filed called Shape whose type is OLE object.
Attribute data are stored in fields called object ID code, feature type code, layer name and so on.
Colors of feature and map symbols have been defined in GDB.
ISpatialReferencesr=this.axMapControl.SpatialReference;
IProjectedCoordinateSystem PCS=sr as IProjectedCoordinateSystem;
stringsysProjection=PCS.Projection.Name;
stringsysSpheroid=PCS.GeographicCoordinateSystem.Datum.Spheroid.Name; Open VCT Traverse VCT file Create a file pyramid Read the part of file header of VCT and check the consistency on projected coordinate system between VCT and GDB Read the part called TableStructure in VCT and check the consistency on fields between VCT and GDB Read geometrical data of VCT and stop the procedure while BreakPosition is read.
N
Create new features in GDB and store geometrical data in the field called SHAPE Release memory space Judge if point data are over Y Store coordinates while reading geometrical data of line of VCT and stop the procedure while BreakPosition is read. Create new features in GDB and store geometrical N data in the field called SHAPE Release memory space
End Y Judge if attribute data are over Release memory space Convert attribute data of VCT to GDB by values of the fields called layer name and feature ID code
N
Read attribute data Of VCT and stop the procedure while BreakPosition is read. Y Judge if annotation are over Release memory space Create new features in GDB and store attribute data in field
N
Read data of annotation of VCT and stop the procedure while BreakPosition is read. The method of data formats conversion of polygon features is the same with the method of line Y features Judge if line data are over
FIG 1 THE FLOW CHART OF DFCO
21
www.as-se.org/ssms
Studies in Surveying and Mapping Science (SSMS) Volume 3, 2015
The Check of Consistency before Data Formats Conversion Projected coordinate system and attribute fields of VCT and GDB must be checked for comparative analysis before data formats conversion. The part of "TableStructure" and head file of VCT respectively records attribute fields and information of projected coordinate system. Attribute fields can be searched in GDB by using SQL statement. The key codes of the acquisition of projected coordinate system of GDB are shown in the following:
ISpatialReferencesr=this.axMapControl.SpatialReference;
IProjectedCoordinateSystem PCS=sr as IProjectedCoordinateSystem;
stringsysProjection=PCS.Projection.Name;
stringsysSpheroid=PCS.GeographicCoordinateSystem.Datum.Spheroid.Name;
Create Dynamic Index File Dynamic index file was created by traversing VCT file to record the position of PointBegin, BreakPoint(i), PointEnd, BreakLine(i), PolylineBegin, PolylineEnd, PolygonBegin, BreakPolygon(i), PolygonEnd, AnnotationBegin, BreakAnnotation(i), AnnotationEnd, AttributeBegin, BreakAttribute(i), AttributeEnd which were called BreakPosition in the following. BreakPoint(i), BreakLine(i), BreakPolygon(i), BreakAnnotation(i), BreakAttribute(i) were recorded with the number of rows where DFCO algorithm stopped reading VCT to carry on data formats conversion at i-th time after each 100 points had been read. The cycle process would continue until "PointEnd" was read. The formulas of BreakPoint(i) are shown in the following:
BreakPoint(i)=i×500+(((PointLine))⁄(500)),PointLine>500
BreakPoint(i)=null,PointLine<500
PointLine=PointEnd-PointBegin+1
Geometrical data of line features recorded with coordinates of point could be directly converted to GDB with more than 100 points in VCT. Dynamic index file recorded the number of rows of the last point of the line feature in BreakLine(i). While, geometrical data of line features could not be directly converted to GDB with less than 100 points until the sum of points of the line feature and the next line features was more than 100. Dynamic index file recorded the number of rows of the last point of the last line feature in BreakLine(i). As the above-mentioned method, BreakPolygon(i) and BreakAttribute(i) were respectively decided by the number of boundary points of polygon features and the number of rows of attribute data in VCT. The Storage of Geometrical Data and Attribute Data Data dictionary stored point, line, polygon and annotation of VCT with Dictionary<string,List<string>> which recorded layer name, attribute data and ID code. Attribute data was associated with geometrical data in VCT by layer name and ID code of features in data dictionary. Coordinates of point, line, polygon of VCT were stored in generic types which were List<pPoint>, List<pPolyline>, List<pPolygon>. Members of custom classes which called pPoint, pPolyline and pPolygon respectively stored, object ID code, feature type code, layer name, the value of ID and the different geometrical data types which respectively stored IPoint, IPolyline and IRing which were interface of AE. Data Formats Conversion Because geometrical data and attribute data are stored separately in VCT, geometrical data should be firstly converted from VCT to GDB, then attribute data. Steps of data formats conversion are shown in the following: Geometrical data of point of VCT was stored in List<pPoint> when point data of VCT was being traversed. The geometrical data of point of VCT was stopped to store and The workspace of GDB was opened when BreakPoint(i) was read. The fields called BSM, YSDM, TCM respectively stored the attribute data of object ID code, feature type code, layer name and field called Shape stored geometrical data. Memory was released and the workspace of GDB was closed after the features were converted from VCT to GDB. The procedure would be repeated until geometrical data of point, line, polygon and attribute data of annotation of VCT had been converted to GDB. As the above-mentioned method, attribute data of VCT was converted to GDB by dynamic index file based on values of the fields called layer name and feature ID code. The key codes of geometrical data and attribute data of
22
Studies in Surveying and Mapping Science (SSMS) Volume 3, 2015
www.as-se.org/ssms
point are shown in the following:
pFeature = fcls.CreateFeature();//Create an empty feature
pFeature.set_Value(pFeature.Fields.FindField("SHAPE"), point);// Store geometrical data in the field called SHAPE
pFeature.set_Value(pFeature.Fields.FindField(tield), frvalue);// Store attribute data in the field called frvalue
pFeature.Shape = point;//Create the shape of the feature
Test in Experimental Data The experimental data, the land-use data of VCT in a city of Liaoning province, were converted from VCT to GDB by program. The VCT that consisted of 27 layers including point, line, face and annotation with the size of file 140M could be used to improve the reliability of DFCO algorithm. Program took 10 minutes to convert VCT into GDB without the lost of geometrical data and attribute data which met the requirements of actual project. Conclusions DFCO algorithm successfully converted VCT to GDB with less memory space based on dynamic index file avoiding the lost of data information in the procedure. Logical errors were avoided wiht the check of consistency on projected coordinate system and attribute fields between VCT and GDB before data formats conversion. VCT could be converted to GDB of ArcGIS by DFCO algorithm and incompatible geospatial data could be shared with GDB by VCT which improved the circular utilization of original data. The map symbols of features needed to be redefined after VCT data had been converted to GDB because of the lack of definition of map symbols in VCT. REFERENCES
[1]
Wang Yandong, Gong Jianya, Huang Juntao, Deng Yuejin. “The Data Transfer Method Based on Geo-spatial data transfer format.“ Acta Geodaetica et Cartographica Sinica, Vol. 5, No. 2, 142-148, 2000.
[2]
Wu Jianting, Shi Zhaoliang. “The Realization of Using ArcGIS to Manage CNSDTF Vector Data. “ Bulletin of Surveying and Mapping,Vol. 11, 21-24, 2005.
[3]
Bai Haili. “The Study and Realization of Translation Between Len Landuse Vector Data Exchange File(VCT) and GIS Data Format.“ Liaoning province, China: Liaoning Technical University,2005.
[4]
Gong Jianya, Deng Yuejin. GBT 17798-2007 “Geospatial Data Transfer Format.“ Peking:Standards Press of China, 2007.
[5]
Liu Zeming, Zhao Li. “The Design and Realization of The Data Format Conversion Methods from VCT to Mapinfo Data.“ Journal of Shandong University of Technology(Sci&Tech), Vol. 11, 26-29, 2006.
[6]
BaoWendong, ShaoZhouyue, ZouJie. “The Study and Realization of Translation Between Len Landuse Vector Data Exchange File(VCT) and Mapinfo Data Format.“ Journal of Shandong Agricultural University(Natural Science Edition), Vol. 38, No. 1, 103-110, 2007.
[7]
Xu Jianhui, Xu Bing. “Mapinfo Data Format And Geo-Spatial Data Conversion Format.“ Chinese Journal of Engineering Geophysics, Vol 2, No. 1, 44-49, 2005.
[8]
Yu Hua. “A Study of ArcInfo's Standard Exchange File Format. “ Bulletin of Surveying and Mapping, No. 1, 51-52, 2003.
[9]
Chen Xianwei, Guo Renzhong, Feng Xiaolin. “Data Translation Between Landuse Vector Data Exchange File and GeoMedia.“ Engineering of Surveying and Mapping, Vol. 14, No. 3, 26-40, 2005.
[10] Han Xuepei, Zhao Jie. “A Analysis of Reference Frame Variance in Data Format Conversion.“ Science of Surveying and Mapping,Vol 33 No. S1, 156-158, 2008. [11] Wang Haiqin. “Study on Danamic Integration of Land Multiplicate Spatial Data—Application to MapGIS and ArcGIS.“ Peking: China Agricultural University,2005.
23
www.as-se.org/ssms
Studies in Surveying and Mapping Science (SSMS) Volume 3, 2015
[12] Nyerges,T.L. “Schema Integration Analysis for the Development of GIS Database“. International Journal of Geographical Information Science,Vol. 3, 153-183, 1989. [13] Pan Nongfei. “The Spatial Data Access Technology and Application Development of GIS Based on Oracle Spatial.“ Computer Engineering,Vol. 28, No. 2, 278-280, 2002. doi: 10.3969/j.issn.1000-3428.2002.02.110. Jingli Wang was born in Hei Longjiang, China, in 1971. He received the B.S. degrees in surveying and mapping engineering from Fuxin Mining Institute, Fuxin, China in 1994 and the M.S. degrees in structural engineering from Northeastern University, Shenyang, China in 2003. He is studying for a PhD degree in Northeastern University by now. His research interests include precise engineering survey, the application of geographic information system and remote sensing. He is a participating scientist of the major water project of China. Mr. Jingli Wang has been teaching in department of survering and maping engineering of Shenyang Jianzhu University since 1994 .He is currently the associate professor in School of Traffic Engineering of Shenyang Jianzhu University. Xiaofeng Wang: Male, Date of birth: Dec 03, 1988, Postgraduate, Affiliation: School of Traffic Engineering, Shenyang Jianzhu University, Shenyang,China. Yuntao Ma: Male, Date of birth: Dec 26, 1979, Master, Lecturer. Affiliation: School of Traffic Engineering, Shenyang Jianzhu University, Shenyang,China.
24