A kind of angle stamp information extracting method
Technical field
The present invention relates to a kind of angle stamp information extracting method.
Background technology
Key message in map file is all kept in the seal of angle, and angle seal includes the information such as designing unit, project name, file number, specialty, designer.Designer and archive office personnel, when submitting to drawing and filing, need manual examination (check) designing unit, project name, bullets, file number whether to fill out mistake.If do not made mistakes, archive office personnel also need the information such as specialty, designer to be manually input in system, greatly and easily make mistakes, whether size and the putting position of depositing text unit lattice meet normal place to workload simultaneously, be difficult to artificial visual check out.
Prior art mainly through the keyword search place cell location of template sets and region, then reads the data in this cell, although can get data, this mode still exists a lot of problem in actual use:
(1) cell of store data is not intended to be elongated or widen, although can obtain data content, whether cannot meet relevant criterion requirement by judging unit lattice putting position;
(2) if cell does not have the key word of key word or repetition just to there will be identification error, the data of designating unit lattice cannot absolutely successfully be obtained;
(3) complicated operation and need to make multiple template.
Summary of the invention
In order to overcome the shortcoming of prior art, the invention provides a kind of angle stamp information extracting method, not only can information in the seal of Obtaining Accurate angle, can also ensure that map sheet meets Specification requirement, with the workload reducing designer, archive office file personnel proofread drawing, increase work efficiency and effectively reach related request standard.
The technical solution adopted in the present invention is: a kind of angle stamp information extracting method, comprises the steps:
The template file of the first step, choice criteria, obtains the relevant information and data that will identify;
Second step, the DWG drawing file selecting needs to verify;
Entity object in 3rd step, traversal drawing file;
4th step, judge whether entity object comprises the unique identification object of template sets: if contained, then enter next step, otherwise return the 3rd step;
5th step, the length calculating the rectangular area at the word content place of this unique identification object and width;
6th step, tentatively judge whether this entity object has carried out qualified synchronous convergent-divergent:
If the width that the length of this unique identification region outer rim and the ratio of the outer figure frame length of the distinguished name of template sets equal this unique identification region outer rim is equal with the ratio of the outer figure width of frame of the distinguished name of template sets, then this entity object of preliminary proof has carried out qualified synchronous convergent-divergent, and this ratio is defined as preliminary scaling M1, then enter next step; Otherwise return the 3rd step;
7th step, the length L1 calculating the interior frame of this entity object and width H1;
8th step, judge that whether the interior frame of this entity object is effective:
Judge whether to meet L1=L2*M1 and H1=H2*M1 simultaneously, wherein: L2 is the interior figure frame length of template sets, outer figure frame length-n-m, the n of L2=template sets be template sets inside and outside picture frame on the left of distance; The inside and outside picture frame of template sets is right, upper and lower lateral extent is equal, is m; H2 is the outer figure width of frame of template sets, the outer figure width of frame-2m of H2=template sets; If so, then illustrate that this rectangular area, entity object place inner edge frame meets the requirements, then enter next step, otherwise return the 3rd step;
In 9th step, this entity object of being calculated by the 7th step, frame calculates the length L3 of outer rim;
Inside and outside tenth step, this entity object of calculating according to the 7th step and the 9th step, frame length calculates the scaling M2 of this entity object:
M2=(L3-L1-m)/n
11 step, judge that whether the scaling M2 that preliminary scaling M1 and the tenth step calculate is equal:
If equal, then illustrate that this entity object has carried out qualified convergent-divergent, and determine that scaling is M2, then enter next step; Otherwise return the 3rd step;
12 step, acquisition angle stamp information;
13 step, judge whether the process completing all entity objects, if completed, then enter the 13 step, otherwise return the 3rd step;
14 step, complete the verifying function of DWG file, generate directoryof.
Compared with prior art, good effect of the present invention is: by calculating the scaling of map sheet, read by the method diagonal angle stamp information of coordinate setting again, pass through the inventive method, not only can guarantee information obtain correctness, can also ensure that map sheet can meet standard criterion requirement, main efficacy results have following some:
1, the efficiency of drawing verification is improved: originally verifying 10 width drawings by manual type needs cost about 120 minutes, only needs 10 seconds now;
2, improve the accuracy of drawing verification: contrast desk checking mode, can human negligence be avoided, the fault rate of check and correction can be reduced; Contrast other computer check technology, the present invention, by coordinate setting mode, obtains the key message in the seal of angle, can further improve the accuracy obtaining angle stamp information.
Accompanying drawing explanation
Examples of the present invention will be described by way of reference to the accompanying drawings, wherein:
Fig. 1 is the process flow diagram of the inventive method.
Embodiment
A kind of angle stamp information extracting method, comprises the steps:
The template file of the first step, choice criteria, obtains the relevant information and data that will identify;
Second step, the DWG drawing file selecting needs to verify;
Entity object in 3rd step, traversal drawing file;
4th step, judge whether entity object comprises the unique identification object of template sets:
The entity type of the unique identification object of template sets can be single file text, multiline text or block, if entity object contains the word content of this unique identification object, then enters next step, otherwise returns the 3rd step;
5th step, calculate the rectangular area at the word content place of this unique identification object:
Search lower-left point A and the upper right point B of this rectangular area, uniquely identified word place outer rim, obtain the coordinate (Xa, Ya) of lower-left point and the coordinate (Xb, Yb) of upper right point; Then by calculating length and the width of this entity object outer rim, concrete computing method are as follows:
Length=the Xb-Xa of rectangular area outer rim;
Width=Y the b-Ya of rectangular area outer rim;
6th step, tentatively judge whether this entity object has carried out qualified synchronous convergent-divergent:
If the width that the length of this unique identification region outer rim and the ratio of the outer figure frame length of the distinguished name of template sets equal this unique identification region outer rim is equal with the ratio of the outer figure width of frame of the distinguished name of template sets, then this entity object of preliminary proof has carried out qualified synchronous convergent-divergent, and this ratio is defined as preliminary scaling M1, then enter next step; Otherwise return the 3rd step;
7th step, calculate the size of the interior frame of this entity object:
Search lower-left point C and the upper right point D of the interior frame of this entity object, obtain the coordinate (Xc, Yc) of lower-left point and the coordinate (Xd, Yd) of upper right point; Then by calculating length and the width of frame in this entity object, concrete computing method are as follows:
The length L1=Xd-Xc of interior frame;
The width H1=Y d-Yc of interior frame;
8th step, judge that whether the interior frame of this entity object is effective:
Judge whether to meet L1=L2*M1 and H1=H2*M1 simultaneously, wherein: L2 is the interior figure frame length of template, the outer figure frame length-n-m of L2=template sets, wherein: n be template sets inside and outside picture frame on the left of distance; The inside and outside picture frame of template sets is right, upper and lower lateral extent is equal, is m; H2 is the outer figure width of frame of template sets, the outer figure width of frame-2m of H2=template sets;
If so, then illustrate that this rectangular area, entity object place inner edge frame meets the requirements, then enter next step, otherwise return the 3rd step.
9th step, calculate the size of outer rim by obtaining frame in this entity object:
Search lower-left point E and the upper right point F of the outer rim of this entity object, obtain the lower-left point coordinate of outer rim for (Xe, Ye), the upper right point coordinate of outer rim is (Xf, Yf), then the length L3=Xf-Xe of outer rim, the width H3=Yf-Ye of outer rim.Then;
Tenth step, calculate the scaling M2 of this entity object according to housing in this entity object:
M2=(L3-L1-m)/n, wherein: L3 is the length of the outer rim of this entity object that the 9th step obtains, L1 is the length of the interior frame of this entity object that step 7 obtains, m be template sets distinguished name inside and outside distance on the right side of picture frame; N be template sets distinguished name inside and outside distance on the left of picture frame.
11 step, judge that whether preliminary scaling M1 is equal with the tenth step scaling M2:
If equal, then illustrate that this entity object has carried out qualified convergent-divergent, and determine that scaling is M2, then enter next step; Otherwise return the 3rd step;
12 step, acquisition angle stamp information, first read identified region lower-left point and the upper right point of template sets, coordinate figure of each point is multiplied with map sheet scaling M2, obtains new identified region lower-left point and upper right point.Just can obtain the value in this region of angle seal according to new identified region, then intercept word (comprise prefix, suffix, the comprise) value of setting, obtain the value that finally will obtain.
13 step, judge whether the process completing all entity objects, if completed, enter the 13 step, otherwise return the 3rd step.
14 step, complete the verifying function of DWG file, generate directoryof.