CN106557573B - The definition of irregular triangle network data memory format and data processing method based on directory index structure - Google Patents

The definition of irregular triangle network data memory format and data processing method based on directory index structure Download PDF

Info

Publication number
CN106557573B
CN106557573B CN201611044189.XA CN201611044189A CN106557573B CN 106557573 B CN106557573 B CN 106557573B CN 201611044189 A CN201611044189 A CN 201611044189A CN 106557573 B CN106557573 B CN 106557573B
Authority
CN
China
Prior art keywords
data
index
triangle
point
asked
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611044189.XA
Other languages
Chinese (zh)
Other versions
CN106557573A (en
Inventor
曹刚
刘义勤
杨岳勤
杨永强
郭绍影
张宝恒
孔德立
杨帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Railway Fifth Survey and Design Institute Group Co Ltd
Original Assignee
China Railway Fifth Survey and Design Institute Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Railway Fifth Survey and Design Institute Group Co Ltd filed Critical China Railway Fifth Survey and Design Institute Group Co Ltd
Priority to CN201611044189.XA priority Critical patent/CN106557573B/en
Publication of CN106557573A publication Critical patent/CN106557573A/en
Application granted granted Critical
Publication of CN106557573B publication Critical patent/CN106557573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of definition of irregular triangle network data memory format and data processing method based on directory index structure, initially set up index triangle data chained list and directory index data;Point set is traversed later, is terminated if completing;Judge point P whether in the index triangle data chained list if not completing, if the Data Position for searching point P from the directory index data not if, it is loaded into memory, and be added in the index triangle data chained list, point P is rejudged later whether in the index triangle data chained list;If, using point P as node, searching the triangle position where point P if, the altitude data of point P is calculated later, and re-start traversal point set.Irregular triangle network data are stored and established, and carry out data processing on this storage organization, the time efficiency of altitude data analysis can be effectively improved, reduce calculator memory usage quantity.

Description

The definition of irregular triangle network data memory format and data based on directory index structure Processing method
Technical field
The present invention relates to one kind for railway CAD more particularly to it is a kind of based on directory index structure not The definition of regular triangular network data storage format and data processing method.
Background technique
With computer cad technique being widely used in Survey & Design of Railways industry, although final result of design is paper The result of design in product but Railway Design intermediate stage is entirely electronic file.The mapping specialty in Railway Design stage to its The plane topographic map that his downstream profession provides is the contour dwg file with certain plan-position and elevation information, other are specially Industry is wanted effectively extremely difficult using this file.
Method used at present is: carrying out that friendship is asked to calculate to contour using Autocad development interface, intersection point can have Specific elevation information can only use its elevation numerical value of interpolation calculation if query point is not located on contour.But such side The problems such as method is there are low efficiency, applicable surface is small and low precision is unable to satisfy and is detached from Autocad system and situation with high accuracy, because This needs to be converted to dwg contour map a kind of irregular triangle network data file with specific format.
Summary of the invention
The object of the present invention is to provide a kind of time efficiency height, calculator memory usage quantity are low based on directory index knot The irregular triangle network data memory format of structure defines and data processing method.
The purpose of the present invention is what is be achieved through the following technical solutions:
The definition of irregular triangle network data memory format and data processing method based on directory index structure of the invention, Comprising steps of
A, index triangle data chained list and directory index data are established, carry out step B later;
B, elevation point set to be asked is traversed, is terminated if completing, carries out step C if not completing;
C, point P is judged whether in the index triangle data chained list, if carrying out step D if, if not from institute The Data Position for searching point P in directory index data is stated, is loaded into memory, and be added to the index triangle data chained list In, point P is rejudged later whether in the index triangle data chained list;
D, using point P as node, the triangle position where point P is searched, carries out step E later;
E, the altitude data for calculating point P, re-starts step B later.
As seen from the above technical solution provided by the invention, provided in an embodiment of the present invention to be based on directory index structure Irregular triangle network data memory format definition and data processing method, irregular triangle network data are stored and are established, and Data processing is carried out on this storage organization, can effectively be improved the time efficiency of altitude data analysis, be reduced in computer Deposit usage quantity.
Detailed description of the invention
Fig. 1 is the schematic diagram of header format in the embodiment of the present invention.
Fig. 2 is the schematic diagram of single catalogue format in the embodiment of the present invention.
Fig. 3 is the schematic diagram of intermediate cam of embodiment of the present invention graphic data storage organization.
Fig. 4 is the schematic diagram that file format defines in the embodiment of the present invention.
Fig. 5 is grid dividing and the schematic diagram of sequence in the embodiment of the present invention.
Fig. 6 is the schematic diagram that grid intermediate cam shape is divided and sorted in the embodiment of the present invention.
Fig. 7 is the schematic diagram of search algorithm process in the embodiment of the present invention.
Specific embodiment
With reference to the attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Based on this The embodiment of invention, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, belongs to protection scope of the present invention.
Of the invention, preferable specific embodiment is:
The definition of irregular triangle network data memory format and data processing method, feature based on directory index structure exist In, comprising steps of
A, index triangle data chained list and directory index data are established, carry out step B later;
B, elevation point set to be asked is traversed, is terminated if completing, carries out step C if not completing;
C, point P is judged whether in the index triangle data chained list, if carrying out step D if, if not from institute The Data Position for searching point P in directory index data is stated, is loaded into memory, and be added to the index triangle data chained list In, point P is rejudged later whether in the index triangle data chained list;
D, using point P as node, the triangle position where point P is searched, carries out step E later;
E, the altitude data for calculating point P, re-starts step B later.
The characteristics of rail track banded structure, if the plane elevation of railway all fronts range is all converted to irregular three Angle net, this data volume will be magnanimity ranks, and a large amount of computer resource will be expended when software systems directly handle these data. The present invention overcomes the big defects of the space hold occurred when above-mentioned mass data processing and time complexity, are based on this method number Both the above defect can be effectively overcome according to file organization format and processing method.
The present invention never start with by regular triangular network data file memory format, establishes subregion index file storage format, will Data area is stored separately with real data, does not have to disposably only need to read by all data reading memory when software handles this file Enter bibliographic structure, data portion is being loaded by directory index data delay when needed.Therefore software systems can be in this machine System is lower to be reduced the time complexity of data processing by certain algorithm design, improves memory service efficiency.
Specific embodiment:
File memory format definition: file is made of three parts, file header, file directory index and data.
File header: as shown in Figure 1,30 Byte of regular length, first four byte is file version information (short class Type), behind 26 Byte be 26 characters (char type), be used for direction memory text.
File directory index: as shown in Fig. 2, bibliographic structure is integrally variable-size, but each catalogue is fixed size. One catalogue regular length is 44Byte.0~3 is call number (int type), and 4~11 and 12~19 be two double types The lower-left angle point two-dimensional coordinate of range thus, it is the upper right angle point of this range that 20~27 and 28~35, which be two double types, Two-dimensional coordinate, 36~39 be offset (int class of this catalogue initial position to this catalogue real data position starting point Type), the triangle number (int type) of 40~43 catalogue corresponding data sections thus.Entire catalogue has 1~n catalogue continuous Address in store.
Data: as shown in figure 3, by data chunk identical with directory index number of entries at being deposited in each data block Storage is multiple triangular apex data, is stored between data block by sequence of addresses.The shared size stored of each triangle It is fixed, 8 (byte double type) * 3 (X Y Z) * 3 (three points) total 72Byte.
In conclusion the irregular triangle network document format data definition based on directory index structure is as shown in Figure 4.
Data organization and use:
Directory index content should be a kind of orderly structure, when whether inquiry is a little located at what which index list was specified When range, the search efficiency less than zero (N) (N catalogue entry) can be used.Similarly, the corresponding data item of each directory index Mesh also must be a kind of ordered structure, thus can efficiently locating query point be located in which triangle, to calculate This point height.
So-called is orderly the logical relation between each element, is arranged when meeting fn (A1) < fn (A2) for ascending order, no Then arranged for descending.Wherein fn is logical method, and A1, A2 are basic input item.When the sequence for requiring to look up operation is orderly to tie When structure, binary search can be used to improve search efficiency, to be that zero (N) (N number of triangles) is reduced to zero (log (n1))+zero (log (n2)) (n1 directory entry quantity, n2 be each directory entry number of triangles), wherein N=n1 × n2;
By taking the related notion of C++ programming language and Autocad drawing environment as an example, it is elaborated based on directory index The irregular triangle network data memory format of structure defines the implementation steps with data processing method.
The file data tissue stage:
By in Dwg drawing contour and spot elevation be converted to irregular triangle network (TIN), this step has numerous Algorithm and solution, are not described in detail herein.
As shown in figure 5, irregular triangle network, which is pacified certain range, is divided into rectangular mesh, the division of this grid is final Index list structure content is formed, the lower-left angle point and upper right angle point of each grid are range values in index list, to institute Some grids are ranked up, ordering rule are as follows: by the X value sort ascending of each grid lower-left angle point, if X is equal, with Y Value carries out sort ascending.
As shown in fig. 6, all triangles in each rectangular mesh form the data segment of each directory index direction Content, its ordering rule is the centroid of each triangle to the angle sort ascending of this grid lower-left angle point, if angle Unanimously, then according to centroid to lower-left angle point apart from sort ascending.
Data service stage:
After irregular triangle network data are stored as external file according to the above method by peace, any programming language can be used Operation processing is carried out to its data, C++ programming language is used herein as and is described.Safeguard that two data structures are fixed in program Justice, one be it is loaded into memory using grid as the irregular triangle network data of unit for storing, each node Sortord is identical as directory index sortord;Another is directory index data, that is, the data of mesh definition.Therefore Inquire the process of the elevation information of input point are as follows: as shown in fig. 7, program is not loaded with any triangle network data in initial phase, Only load directory index data, program first search whether this location has been added in index triangle data chained list Memory calculates elevation if memory has been added in this back end, this point range is otherwise searched in directory index structure, By the range data comprising this point from reading and being added in index triangle data chained list in file, this point height number is being calculated According to.
Effect of the invention is embodied by following experimental data:
The PC machine CPU used is tested as 4590 3.2GHZ of Intel Core i5 CPU, inside saves as DDR3 type 4.0GB. Experimental data is blue line spices mountain sandhog point in railway, the plane terrain data of wide 1.0km long 20km, in irregular triangle network Number of triangles is 100,000 ranks, and grid dividing is 1 × 1km 20 total.Generating user-defined format file size is 10M left The right side best embodies the time complexity that the method excellent properties index is inquiry operation.
The time complexity of a point is inquired without using the method are as follows: zero (100000)
The time complexity of a point is inquired using the method are as follows: zero (log (20))+zero (log (5000))
From time complexity Indexes Comparison above, had using the program of the method for the present invention in time execution efficiency Very big advantage, the data manipulation of magnanimity can be handled on common computer completely.
From the point of view of memory usage quantity, 100000 × 72Byte is disposably at least needed without using the method memory (100000: number of triangles, byte number occupied by 72: one triangles).If theoretically also at least being needed using the method 100000 × 72Byte+ directory index memory usage amount, but this is built upon the feelings that inquiry point set is distributed in all grids Shape, the general memory usage amount calculation formula of the method are as follows:
M: triangle total amount.
N: number of grid.
P: the quantity of grid where point set.
Memory usage amount=M/N*P*72+ single directory index memory usage amount × N
Wherein " single directory index memory usage amount " defines different memories according to different language, different data format Usage amount.
It can be obtained from above-mentioned calculation formula, at least not use this using the memory usage amount of the method in the case of general The 1/N of method.To effectively raise the service efficiency of calculator memory.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, Within the technical scope of the present disclosure, any changes or substitutions that can be easily thought of by anyone skilled in the art, It should be covered by the protection scope of the present invention.Therefore, protection scope of the present invention should be with the protection model of claims Subject to enclosing.

Claims (1)

1. a kind of definition of irregular triangle network data memory format and data processing method based on directory index structure, feature It is, comprising steps of
A, by Dwg drawing contour and spot elevation be converted to irregular triangle network, irregular triangle network is divided into Rectangular mesh forms index list structure content, establishes index triangle data chained list and directory index data, is walked later Rapid B;
B, each elevation point set to be asked in the contour and spot elevation in Dwg drawing is traversed, is terminated if completing, if not complete At then carrying out step C;
C, currently whether elevational point P to be asked is in the index triangle data chained list for judgement, if carrying out step D if, if not In the Data Position for then searching currently elevational point P to be asked from the directory index data, it is loaded into memory, and be added to institute State index triangle data chained list in, rejudge later currently elevational point P to be asked whether in the index triangle data chain In table;
D, using currently elevational point P to be asked as node, the currently triangle position where elevational point P to be asked is searched, is walked later Rapid E;
E, the altitude data for calculating currently elevational point P to be asked, re-starts step B later.
CN201611044189.XA 2016-11-24 2016-11-24 The definition of irregular triangle network data memory format and data processing method based on directory index structure Active CN106557573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611044189.XA CN106557573B (en) 2016-11-24 2016-11-24 The definition of irregular triangle network data memory format and data processing method based on directory index structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611044189.XA CN106557573B (en) 2016-11-24 2016-11-24 The definition of irregular triangle network data memory format and data processing method based on directory index structure

Publications (2)

Publication Number Publication Date
CN106557573A CN106557573A (en) 2017-04-05
CN106557573B true CN106557573B (en) 2019-11-19

Family

ID=58444438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611044189.XA Active CN106557573B (en) 2016-11-24 2016-11-24 The definition of irregular triangle network data memory format and data processing method based on directory index structure

Country Status (1)

Country Link
CN (1) CN106557573B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344390A (en) * 2008-08-19 2009-01-14 南京师范大学 High-fidelity digital modeling method for landform altitude
CN102496187A (en) * 2011-10-21 2012-06-13 克拉玛依红有软件有限责任公司 Method for tracking contour line to boundary and fault based on triangular mesh
GB2503309A (en) * 2011-03-09 2013-12-25 Imagination Tech Ltd Compressing a list of primitives in a computer graphics system from a tessellated patch of surface data
CN103678657A (en) * 2013-12-24 2014-03-26 北京中科大洋科技发展股份有限公司 Method for storing and reading altitude data of terrain
CN104331928A (en) * 2014-10-28 2015-02-04 中国航空工业集团公司洛阳电光设备研究所 Automatic contour elevation value assignment method based on triangulation network
CN106097450A (en) * 2016-06-21 2016-11-09 武汉瑞得信息工程有限责任公司 A kind of contour lines creation method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101344390A (en) * 2008-08-19 2009-01-14 南京师范大学 High-fidelity digital modeling method for landform altitude
GB2503309A (en) * 2011-03-09 2013-12-25 Imagination Tech Ltd Compressing a list of primitives in a computer graphics system from a tessellated patch of surface data
CN102496187A (en) * 2011-10-21 2012-06-13 克拉玛依红有软件有限责任公司 Method for tracking contour line to boundary and fault based on triangular mesh
CN103678657A (en) * 2013-12-24 2014-03-26 北京中科大洋科技发展股份有限公司 Method for storing and reading altitude data of terrain
CN104331928A (en) * 2014-10-28 2015-02-04 中国航空工业集团公司洛阳电光设备研究所 Automatic contour elevation value assignment method based on triangulation network
CN106097450A (en) * 2016-06-21 2016-11-09 武汉瑞得信息工程有限责任公司 A kind of contour lines creation method and device

Also Published As

Publication number Publication date
CN106557573A (en) 2017-04-05

Similar Documents

Publication Publication Date Title
JP6032467B2 (en) Spatio-temporal data management system, spatio-temporal data management method, and program thereof
Liao et al. Multi-dimensional index on hadoop distributed file system
CN102682103B (en) Three-dimensional space index method aiming at massive laser radar point cloud models
CN103995861B (en) A kind of distributed data device based on space correlation, method and system
CN104794177B (en) A kind of date storage method and device
US10068033B2 (en) Graph data query method and apparatus
CN103455531B (en) A kind of parallel index method supporting high dimensional data to have inquiry partially in real time
Wang et al. Research and implementation on spatial data storage and operation based on Hadoop platform
CN107357846A (en) The methods of exhibiting and device of relation map
CN106649882B (en) Spatial data management middleware applied to telecommunication field and implementation method thereof
CN104699946B (en) A kind of management method and device of scene of game
CN110597935A (en) Space analysis method and device
CN107391502A (en) The data query method, apparatus and index structuring method of time interval, device
CN106055590A (en) Power grid data processing method and system based on big data and graph database
CN104572983A (en) Construction method based on hash table of memory, text searching method and corresponding device
CN104346444A (en) Optimum site selection method based on road network reverse spatial keyword query
CN105359142B (en) Hash connecting method and device
CN103544300B (en) A kind of extensible storage index structure in cloud environment realize method
CN103294799B (en) A kind of data parallel batch imports the method and system of read-only inquiry system
CN106484694B (en) Full-text search method and system based on distributed data base
CN106156049A (en) A kind of method and system of digital independent
US20150293971A1 (en) Distributed queries over geometric objects
CN104571946A (en) Memory device supporting quick query of logical circuit and access method of memory device
Camata et al. Parallel implementation and performance analysis of a linear octree finite element mesh generation scheme
CN114119939A (en) Data lightweight processing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant