Background technology
Map symbol is the visual main tool of spatial data, and its left brain by pictorial stimulus people pictograph, understanding produces imago, transmits the information such as feature, the regularity of distribution of geographical entity.Map symbol and symbolic library are one of gordian techniquies of GIS, map making and all kinds of electronic chart softwares.But because the difference and the symbolic information of symbol data model, storage mode and drafting strategy are different with the spatial data interrelational form between the different system, symbolic information is not shared synchronously when causing geodata to be shared; During interoperability of system, symbolic information is lost, is out of shape.In order to realize sharing of dot-form map symbol, people have attempted sign form conversion, TrueType font, symbol corresponding tables, multi-platform several different methods such as play up.But, because the difference of different system on map symbol data model, mode of composition root causes these methods all can not fundamentally solve the problem that map symbol is shared.Styled Layer Descriptor (SLD) standard that OGC formulates is attempted the data model of schematic symbol uniformly, and still, " SLD " primitive types is single, is not approved widely.
For addressing the above problem, need a kind of new method, can assimilate the GIS of current main-stream, the linear map symbol in the CAD software, share same symbolic library.
Summary of the invention
The objective of the invention is to share the defective that the aspect exists, the linear map symbol model based on the path is provided, as the shared basis of the line symbol between GIS, CAD, professional graphics software at existing linear map symbol.Another goal of the invention of the present invention provides a kind of shared method of linear map symbol, at same symbolic library, uses for different CAD and GIS platform respectively, realizes sharing and play up fast linear map symbol.
The present invention for a technical scheme that solves its technical matters employing is:
Based on the linear map symbol model (hereinafter to be referred as VGE line symbol model) in path, this model is made up of linear map symbol data model and linear map symbol renderer.
Described linear map symbol data model is made of stroke and decoration; Described stroke comprises path and index thereof, and stroke can be provided with attributes such as color, texture, width, vertical misalignment and drawing order, and simultaneously, stroke comprises the configuration mode of line, and the actual situation pattern and the lateral excursion of line can be set in the configuration mode; Described decoration is meant the online top point symbol of configuration, comprises attributes such as configuration rule and configuration parameter.In addition, complicated line symbol can utilize script that it is designed by interface, also can be converted into area symbol by profile transformation.
Described linear map symbol renderer is made up of stroke process device, filling processor and three interfaces of path conversion.
The technical scheme that realizes another goal of the invention of the present invention is: the linear map symbol based on VGE line symbol model is shared method, comprises line symbol data sharing method and function sharing method.
Described data sharing method comprises linear map symbol assimilation and linear map symbol XML exchange.Described linear map symbol assimilation is based on VGE line symbol model, assimilates linear map symbol in present main flow CAD, the GIS software platform.Described linear map symbol XML exchange is that the line symbol data based on the VGE symbolic model are carried out the symbol exchange, shared by the XML form, comprises line symbol data that import the commutative form of XML and the line symbol data that derive the commutative form of XML.
Described function sharing method comprises linear map symbol monitoring and linear map symbol replacement, can be divided into dual mode: a kind of in operating system during the corresponding GIS running software of monitoring line symbol play up the drawing for order that calls, and it is replaced with the instruction of playing up of VGE linear map symbol; Another kind is that mode with com is with the VGE linear map symbol and play up and extend on the corresponding GIS platform.
Advantage of the present invention is: the linear map symbol data are separated with playing up, and aspect symbol data, can assimilate the line symbol of making in main flow CAD, GIS, the professional graphics software, support the design of complicated line symbol, cartoon characters, support texture to fill; Aspect symbol plays up, can and play up the VGE line symbol and extend on the corresponding GIS software platform, thereby realize that the line symbol between GIS, CAD, professional graphics software shares, realize " use more in a storehouse " in linear map symbol storehouse.
Embodiment
Below in conjunction with drawings and Examples the present invention is described in further details.
Embodiment 1
VGE line symbol model provided by the invention, model are played up the two large divisions by linear map symbol data model and map symbol and are formed.Wherein:
As shown in Figure 1, constitute by stroke and decoration.Stroke comprises path and index thereof, and stroke can be provided with attributes such as color, texture, width, vertical misalignment and drawing order, and simultaneously, stroke comprises the configuration mode of line, and the actual situation pattern and the lateral excursion of line can be set in the configuration mode; Decoration is meant the online top point symbol of configuration, comprises attributes such as configuration rule and configuration parameter.In addition, complicated line symbol can utilize script that it is designed by interface, also can be converted into area symbol by profile transformation.We define a LineSymbol class, and following functions are provided:
①GetArraySize(int?*?size)
Be used for obtaining complete all members' of linear map symbol memory size, parameter s ize is the memory address of linear map symbol size.
②GetArray(BYTE?*?buffer)
Be used for obtaining complete all members' of linear map symbol internal memory record, parameter b uffer is the memory address of linear map symbol content.
③GetStrokeCount(int?*?c)
Be used for obtaining the number of all strokes of complete linear map symbol, parameter c is the memory address of a stroke number variable in the linear map symbol.
④GetStroke(int?ID)
Be used for obtaining the full detail (color, texture, width, side-play amount, actual situation pattern etc.) of complete certain stroke of linear map symbol, parameter I D is the unique identifying number of stroke in the linear map symbol.
⑤GetDecorationCount(int?*?d)
Be used for obtaining the number of all decorations of complete linear map symbol, parameter d is to decorate the memory address of a number variable in the linear map symbol.
⑥GetDecoration(int?ID)
Be used for obtaining the full detail of complete certain decoration of linear map symbol, parameter I D is the unique identifying number of decorating in the linear map symbol.
⑦GetTransCount(int?*?d)
Be used for obtaining the number of complete all profile transformations of linear map symbol, parameter d is the memory address of a profile transformation number variable in the linear map symbol.
⑧GetTrans(int?ID)
Be used for obtaining the full detail of complete certain profile variations of linear map symbol, parameter I D is the unique identifying number of profile transformation in the linear map symbol.
Linear map symbol is played up: the VGE symbol is played up by stroke process device, filling processor and three interfaces of path conversion and is formed.Linear map symbol is played up the ProcessOnePolyline function of corresponding VGE symbol in playing up, and it calls the ProcessStroke function, and is as follows:
ProcessStroke(Stroke?*?s)
Be used on virtual canvas object, drawing a stroke with certain stroke parameter (color, texture, width, actual situation pattern etc.).Parameter s is quoting of a stroke object.
Embodiment 2
As shown in Figure 2, the present invention also provides a kind of linear map symbol based on VGE line symbol model to share method, comprises line symbol data sharing method and function sharing method.Data sharing can be divided into linear map symbol assimilation, linear map symbol XML exchange, and function sharing refers to the line symbol monitoring and replaces.
This method specifically adopts following steps to realize:
Step 1, based on VGE linear map symbol model, the line symbol that designs among the CAD, GIS software platform of assimilation main flow, line symbol file importing that will already present other form (as * .dxf, * .style).
Step 2, the XML Switching Module by the VGE line symbol import the line symbol data of the commutative form of XML, and as the line symbol among the SLD, the function that provides is:
LoadFromFile(string?file)
Be written into symbol data in internal memory from outside wire map symbols bank file, parameter f ile is the pathname of outside wire map symbols bank.File type can be the symbol Interchange Format of XML form, also can be self-defining storage inside form.
Step 3, utilize the com mode that VGE line symbol model and high-quality map symbol render engine are extended in the GIS software platform of application.
Step 4, line symbol is played up the drawing for order that calls during monitoring GIS running software in operating system, and it is replaced with the instruction of playing up of VGE line symbol.
Step 5, the XML Switching Module by the VGE line symbol are output as the commutative form of XML with the VGE line symbol that designs, and share for linear map symbol, and the function that provides is:
SaveToFile(string?file)
Symbolic library behind the edit-modify is saved in the outside wire map symbols bank file, and parameter f ile is the pathname of outside wire map symbols bank.File type can be the symbol Interchange Format of XML form, also can be self-defining storage inside form.