The TrueType symbol with based on the dot-form map symbol switching method in path
Technical field
The present invention relates to geography information and share the field, be specifically related to a kind of TrueType symbol and dot-form map symbol switching method based on the path.
Background technology
Geography information is shared and is meant that with hardware technologies such as computing machine and spatial data infrastructures be support, under soft environment supports such as standard, policy, law, geography information is used jointly.Map symbol is the visual main tool of spatial data, and its left brain through pictorial stimulus people pictograph, understanding produces imago, transmits the information such as characteristic, the regularity of distribution of geographical entity.
Existing geography information technology of sharing is seldom considered sharing of map symbols information; Even relate to; Effect is also unsatisfactory, because each GIS-Geographic Information System (GIS) software platform all has Symbol Design and the drafting module that oneself seals, realizes that the technology of sharing difficulty of map symbols information is bigger.In addition, spatial data and map symbol data all have two relatively independent unit always in GIS operating system, so when communal space data, seldom consider sharing of map symbols information.Often need in the actual drawing work same geographic object to be made many cover symbols, seriously reduced the efficient of drawing, caused the dialect property problem of map symbol to various GIS platform.
For addressing the above problem, therefore need a kind of new method, can assimilate, exchange in the current main-stream GIS software based on the dot-form map symbol of TrueType, share same symbolic library, reduce the unnecessary duplication of labour, the raising drawing efficiency.
Based on the dot-form map symbol data model in path, be on the basis of drawing traditional C AD and GIS symbolic model, use for reference the pattern description mechanism in PostScript language, SVG standard, the Flash technology, and the map symbol data model that forms.Dot-form map symbol data model based on the path is as shown in Figure 1, and symbolic library comprises symbol and template, and symbol is the set of finite path (Path), and the path is made up of section, and section comprises four types of straight line, arc, Bezier curve and SPLs.Wherein, Straight line comprises straight-line segment and broken line, and arc comprises circle, ellipse, circular arc, elliptic arc, and the Bezier curve comprises secondary and three bezier curve; SPL adopts non-homogeneous B spline curve (nurbs curve), and this curve is the unique method for expressing of free type curve in the STEP standard.Template is meant a kind of symbol construction mode, and common rectangle in the map symbol, star-like, regular polygon etc. all can be defined as the template that makes up Path.Simultaneously, new symbolic construction adopts FlyWeight (enjoying unit) pattern to solve " decoupling zero with " problem of Path and Stroke, Fill operation, makes same Path to be operated by a plurality of Stroke and Fill and quote.Therefore, possess the general graphical descriptive power based on the dot-form map symbol structure in path, and taken into account the composition characteristics of map symbol, can assimilate the map symbol of present main flow.
Name is called " based on the GIS universal symbol system and the construction method thereof of virtual machine "; Application number is 200610018873.0; Publication number is that patent, the name of CN1838073A is called " the integrated cultural symbol of point, line, surface formation method ", and application number is 200710021392.X, publication number CN101075244A, " computer automatic drafting method of complicated map symbol "; Application number is 200710053790.X; Publication number is that patent, the name of CN101159065 is called " a kind of system and method for adaptive electronic map symbolic ", and application number is 200810239848.4, and publication number is the patented claim of CN101458819; Above-mentioned patent all discloses the method that map symbol makes up, but they all do not relate to TrueType symbol and dot-form map symbol switching method based on the path.
Summary of the invention
The object of the invention is to overcome existing map symbol and shares the defective that the aspect exists; Solve map dotted symbol isomery problem; On dot-form map symbol data model basis based on the path; TrueType symbol and dot-form map symbol switching method based on the path are proposed, the TrueType symbol is provided with based on the two-way mapping between the dot-form map symbol (abbreviating the VGE point symbol as) in path, realize the assimilation, shared of dot-form map symbol.
The technical scheme that realizes the object of the invention is: TrueType symbol and dot-form map symbol switching method, this method based on the path comprise the TrueType symbol to based on the dot-form map symbol conversion in path, based on the dot-form map symbol in path to TrueType symbol transition two parts.
Wherein: said TrueType symbol comprises following step to the dot-form map symbol conversion based on the path:
The interpretation of step 1TrueType symbol: the TrueType symbol file to the needs assimilation is that font file is discerned, and differentiates its sign form, and the TrueType symbol is carried out the symbol interpretation;
Step 2TrueType classification of sign: carry out classification of sign according to profile geometries in the TrueType symbol;
Step 3TrueType symbol shines upon to the dot-form map symbol based on the path: on the dot-form map symbol data model basis based on the path, sorted TrueType profile is mapped as the dot-form map symbol data based on the path.
Said step 1 specifically is meant: based on three layer models of TrueType character library, character, profile, and the data structure of profile, read the TrueType symbol data.
Said step 2 specifically is meant: the point symbol in the TrueType data is divided into two kinds of straight line and Beziers according to profile geometries.
Said step 3 specifically is meant: straight line is mapped as MoveTo, LineTo, and Bezier is mapped as CurveTo.
Said dot-form map symbol based on the path comprises following step to the TrueType symbol transition:
Step I is based on the dot-form map symbol interpretation in path: the dot-form map symbol file to based on the path is discerned, and differentiates its sign form, will meet map symbol data load in the symbol file of sign form in internal memory;
Step II is classified based on the dot-form map symbol in path: the VGE dot-form map symbol data that will be loaded in the internal memory are classified according to geometric configuration;
Step II I based on the dot-form map symbol in path to the TrueType sign map: sorted map symbol data map is the data among the TrueType with step 2.
Said step I specifically is meant; According to dot-form map symbol data model structure based on the path; Be symbolic library, symbol, path, summit, stroke, six layers of structure of filling, the map symbol in the authentication code file, the map symbol data load that will meet form is in internal memory.
Said Step II specifically is meant, will be divided into two types based on the dot-form map symbol in path, and one type is straight line, and another kind of is arc, Bezier, SPL.
Said Step II I is meant that specifically (MoveTo, LineTo) is mapped as the straight line among the TrueType with straight line, and arc (ArcTo), Bezier (CurveTo) are mapped as the Bezier among the TrueType with SPL (BsplineTo).
The present invention to the dot-form map symbol based on the path, shares the assimilation of TrueType symbol to realize dot-form map symbol.The present invention not only can be to assimilating based on the dot-form map symbol among the TrueType, and can assimilate ordinary symbol (figure) wherein, possesses the general graphical descriptive power, taken into account the composition characteristics of map symbol.
The present invention can map to the dot-form map symbol based on the path with the TrueType symbol is harmless, helps " use more in a storehouse " of map symbol, and a difficult problem provides a kind of approach in order to solve the map symbol isomorphism, share etc.
Description of drawings
Among Fig. 1 the present invention based on the dot-form map symbol data model synoptic diagram in path
Among Fig. 2 the present invention the TrueType symbol with based on the dot-form map symbol in path assimilation route synoptic diagram
Fig. 3 embodiment of the invention TrueType profile is mapped as the dot-form map symbol path synoptic diagram based on the path
Fig. 4 embodiment of the invention is mapped as TrueType profile synoptic diagram based on the dot-form map symbol path in path
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is explained further details.
The present invention has proposed TrueType symbol and dot-form map symbol switching method based on the path on the dot-form map symbol data model basis based on the path, the TrueType symbol is provided and based on the two-way mapping between the dot-form map symbol in path.For the GIS dot-form map symbol is shared a new technology path is provided, has helped promoting the formalization expression of cartographic convention and knowledge, helped eliminating the ambiguity of bringing because of the symbolic data structure isomery in the cartographic semiology.
As shown in Figure 2, the TrueType symbol with based on the dot-form map symbol switching method in path, this method comprise the TrueType symbol to based on the dot-form map symbol conversion in path, based on the dot-form map symbol in path to TrueType symbol transition two parts.
The TrueType symbol comprises following step to the dot-form map symbol conversion based on the path:
Step 1, the interpretation of TrueType symbol;
Step 2, TrueType classification of sign;
Step 3, TrueType symbol are to the dot-form map symbol mapping based on the path.
This instance is an operating system environment with Windows XP SP3, and Visual Studio 2008 SP1 are development environment, and C++ is a development language, and ArcGIS 9.3 is the GIS platform.
As shown in Figure 3, the practical implementation step is following:
The interpretation of step 1TrueType symbol is meant at first to be discerned the symbol file based on the TrueType structure of needs assimilation, differentiates its sign form.The ArcGIS symbol is on the basis of TrueType font, to make up to form, i.e. character library, character, profile three layer models.Therefore, this instance adopts ArcGIS 9.3 dotted map symbols object as an example.Map symbol is stored in the * .style file among the ArcGIS, and wherein dot-form map symbol can be formed by one or more TrueType symbol combination.Therefore, the TrueType font file of this instance employing ttf form is an instance data.From * .ttf file, reading character according to the data structure of profile among the TrueType is the point symbol data.
The classification of step 2TrueType dot-form map symbol is on step 2 basis, and the TrueType symbol data is differentiated, classified, and the point symbol in the data is classified according to the TrueType profile geometries.Like the point symbol among the ArcGIS is to be formed by several TrueType character combinations, and character is made up of the profile of several fillings, and profile is formed by connecting broken line or Bezier segment of curve.According to the geometric configuration of TrueType profile, sort out respectively.
Step 3TrueType symbol is meant to the dot-form map symbol mapping based on the path and on VGE dot-form map symbol data model, sorted TrueType symbol data is mapped as the dot-form map symbol based on the path.Respectively sorted TrueType profile in the step 2 is mapped as based on the path in the dot-form map symbol in path, mapping method is following:
1. straight-line segment:
The straight-line segment profile has write down the node coordinate in the straight line, in based on the dot-form map symbol in path, it is mapped as path MoveTo, LineTo.
2. Bezier curve:
Write down node and the reference mark coordinate in the curve in the Bezier curved profile, in based on the dot-form map symbol in path, it has been mapped as path CurveTo (node, reference mark).
As shown in Figure 4, comprise following step based on the dot-form map symbol in path to the TrueType symbol transition:
Step 1, based on the dot-form map symbol interpretation in path;
Step 2, based on the classification of the dot-form map symbol in path;
Step 3, based on the dot-form map symbol in path to the TrueType sign map.
Step 1 specifically is meant to be discerned the dot-form map symbol file based on the path; Differentiate its sign form; According to the dot-form map symbol data model based on the path is that symbolic library, symbol, path, summit, stroke, six layers of structure of filling are differentiated, with the map symbol data load in the symbol file in internal memory.
Step 2 specifically is meant classifies the dot-form map symbol data based on the path that are loaded in the internal memory according to geometric configuration, will be divided into two types based on the dot-form map symbol in path, and one type is straight line, and another kind of is arc, Bezier, SPL.
Step 3 is meant that specifically with the sorted map symbol data map of step 2 be the data among the TrueType; All will convert the font in the TrueType font file in this instance based on the dot-form map symbol in path; Straight line (MoveTo, LineTo) is mapped as the straight line among the TrueType, and arc (ArcTo), Bezier (CurveTo) and SPL (BsplineTo) are mapped as the Bezier of TrueType.Mapping method is following:
1. straight line
Write down starting point, terminal point coordinate in the straight line, converted the straight line in the TrueType profile into.
2. arc
Write down the coordinate at starting point, terminating point and two reference mark based on arc in the dot-form map symbol path in path, in TrueType, it has been approached with Bezier.
3. Bezier
Write down node and reference mark coordinate based on the Bezier in the dot-form map symbol path in path, directly converted the Bezier among the TrueType into.
4. SPL
Write down point and reference mark coordinate on the node place curve based on the SPL in the dot-form map symbol path in path, therefore can instead ask knot vector, exponent number.At each node place, be some Beziers with the SPL cutting, correspondence mappings is the Bezier among the TrueType.
The present invention can help realizing " use more in a storehouse " that sharing for map symbol provides a feasible approach with the TrueType symbol to the harmless mapping of dot-form map symbol based on the path.