CN117519697A - Vector data visualization method and device - Google Patents

Vector data visualization method and device Download PDF

Info

Publication number
CN117519697A
CN117519697A CN202311452478.3A CN202311452478A CN117519697A CN 117519697 A CN117519697 A CN 117519697A CN 202311452478 A CN202311452478 A CN 202311452478A CN 117519697 A CN117519697 A CN 117519697A
Authority
CN
China
Prior art keywords
canvas
vector data
coordinates
coordinate
description information
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.)
Pending
Application number
CN202311452478.3A
Other languages
Chinese (zh)
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.)
Beijing Technology Research Branch Of Tiandi Technology Co ltd
General Coal Research Institute Co Ltd
Original Assignee
Beijing Technology Research Branch Of Tiandi Technology Co ltd
General Coal Research Institute 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 Beijing Technology Research Branch Of Tiandi Technology Co ltd, General Coal Research Institute Co Ltd filed Critical Beijing Technology Research Branch Of Tiandi Technology Co ltd
Priority to CN202311452478.3A priority Critical patent/CN117519697A/en
Publication of CN117519697A publication Critical patent/CN117519697A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/56Information retrieval; Database structures therefor; File system structures therefor of still image data having vectorial format

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Image Generation (AREA)

Abstract

The disclosure provides a vector data visualization method and device, and relates to the technical field of front ends. Comprising the following steps: acquiring a vector data set; creating a canvas corresponding to the vector data set based on the respective vector data coordinates; calculating a conversion parameter and an offset parameter based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas; mapping the vector data coordinates to canvas coordinates in the canvas based on the conversion parameters and the offset parameters; and calling a preset geometric drawing and style rendering function, and performing visual display at the front end based on each canvas coordinate and the description information corresponding to each canvas coordinate. Therefore, when the vector data is drawn, the drawing of different vector data can be rapidly completed without a third party graphic library, the rapid browsing requirement of a user is met, the user is supported to expand functions, and the function is rapidly visualized at the front end.

Description

Vector data visualization method and device
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method and a device for visualizing vector data.
Background
Unlike client development, which relies mainly on existing graphic framework libraries, the front-end graphic framework library is used only for drawing descriptions of graphics and styles, while the underlying graphic engine and graphic rendering are embedded in the browser in Canvas form and a unified set of standards has been formed. At present, the existing front-end two-dimensional graphic frames such as Leaflet, openlayers, mapbox do a great deal of code packaging and function merging work in the aspects of geometric drawing, space analysis, layer management, control packaging, coordinate conversion, man-machine interaction and the like, support the adaptation to various development and application requirements in a form of introducing a dependency library, and are widely applied to front-end embedded type visual development and WebGIS visual platform construction.
Because a complete graphic framework needs too many and complex basic functions, in practical application, the functions actually needed to be used may be only a small part of the functions, and introducing the whole graphic framework library will cause code enlargement and redundancy in the development process, and in the whole project engineering, loading time will be too long, page loading will be slow, rendering frame rate will be reduced, even page clamping will be generated.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
An embodiment of a first aspect of the present disclosure provides a method for visualizing vector data, including:
acquiring a vector data set, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate;
creating a canvas corresponding to the vector data set based on the respective vector data coordinates;
calculating a conversion parameter and an offset parameter based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas;
mapping the vector data coordinates to canvas coordinates in the canvas based on the conversion parameters and the offset parameters;
and calling a preset geometric drawing and style rendering function, and performing visual display at the front end based on each canvas coordinate and the description information corresponding to each canvas coordinate.
Embodiments of a second aspect of the present disclosure provide a vector data visualization system, including:
the acquisition module is used for acquiring a vector data set, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate;
the creation module is used for creating canvas corresponding to the vector data set based on the vector data coordinates;
the computing module is used for computing conversion parameters and offset parameters based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas;
the mapping module is used for mapping each vector data coordinate into each canvas coordinate in the canvas based on the conversion parameter and the offset parameter;
and the display module is used for calling a preset geometric drawing and style rendering function and carrying out visual display at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
An embodiment of a third aspect of the present disclosure provides an electronic device, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the vector data visualization method as proposed by the embodiment of the first aspect of the present disclosure when the processor executes the program.
An embodiment of a fourth aspect of the present disclosure proposes a computer readable storage medium storing a computer program which, when executed by a processor, implements a vector data visualization method as proposed by an embodiment of the first aspect of the present disclosure.
The vector data visualization method and device provided by the disclosure have the following beneficial effects:
in the embodiment of the disclosure, a vector data set is firstly obtained, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate, then a canvas corresponding to the vector data set is created based on each vector data coordinate, then conversion parameters and offset parameters are calculated based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas, then each vector data coordinate is mapped to each canvas coordinate in the canvas based on the conversion parameters and the offset parameters, finally a preset geometric drawing and style rendering function is called, and visual display is performed at the front end based on the description information corresponding to each canvas coordinate and each canvas coordinate. Therefore, when the vector data is drawn, a third party graphic library is not needed, so that dependence is reduced, the use threshold is low, the development process is convenient, unnecessary interactive references are reduced, the drawing of different vector data can be rapidly completed, the rapid browsing requirement of a user is met, the function expansion of the user is supported, and the front end is rapidly visualized.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
fig. 1 is a schematic flow chart of a method for visualizing vector data according to an embodiment of the disclosure;
fig. 2 is a schematic structural diagram of a vector data visualization apparatus according to an embodiment of the disclosure;
FIG. 3 is a schematic diagram of a minimum bounding rectangle according to an embodiment of the present disclosure;
fig. 4 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
It should be noted that, because a complete set of graphic frames needs to take into account too many complicated basic functions, in practical application, the functions actually needed to be used may be only a small part of the functions, and introducing the whole graphic frame library will cause code bloated and redundancy in the development process, which will tend to cause conditions of overlong loading time, slow page loading, reduced rendering frame rate, even page blocking and the like for the whole project engineering. Based on the method, the device and the system, aiming at the requirement of a user on quick preview of vector data, the method and the system can directly draw the vector data at the front end by calling a geometric drawing and style rendering function which are finished in advance on the basis of preprocessing the original vector data, so that the visualization of the vector data is quickly finished. The method does not need any third-party plug-in and graphic library, reduces unnecessary interactive rendering and loading time such as coordinate system conversion and the like, simultaneously reduces the hardware requirement on equipment, supports a user to quickly look up vector data at the front end, has shorter loading time and is not easy to be blocked on a page.
The following describes a vector data visualization method and apparatus according to an embodiment of the present disclosure with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for visualizing vector data according to an embodiment of the present disclosure.
As shown in fig. 1, the vector data visualization method may include the steps of:
step 101, acquiring a vector data set, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate.
In particular, vector datasets may be collected from various sources, such as Geographic Information System (GIS) databases, sensor data, open data platforms, and the like. These datasets will typically contain vector data coordinates and corresponding descriptive information. If the existing data set is not satisfactory, data format conversion is required. Professional geographic information software (e.g., arcGIS, QGIS) or programming tools (e.g., the geopladas library of Python) can be used to read the raw data and convert it to vector dataset format while retaining descriptive information. If the vector data is stored in a database, the desired vector data set may be retrieved by a query language (e.g., SQL). The query results may contain each vector data coordinate and corresponding descriptive information. It should be noted that, the obtained vector data set should include each vector data coordinate and the description information corresponding to each coordinate. This ensures the integrity and availability of the data set, providing a basis for subsequent data visualization and analysis.
Optionally, a data type of the vector data is also recorded in the vector data set.
The description information corresponding to the vector data may be attribute information such as characters, character sizes, character colors, patterns and the like corresponding to the vector coordinate points.
Step 102, creating canvas corresponding to the vector data set based on each vector data coordinate.
Alternatively, a minimum bounding rectangle corresponding to each vector data coordinate may be first determined, where the minimum bounding rectangle characterizes the minimum rectangle that can completely enclose each vector data coordinate, and then a corresponding canvas may be generated at the front end based on an aspect ratio example corresponding to the minimum bounding rectangle, and four corner points of the minimum bounding rectangle are respectively placed at positions corresponding to four corners of the canvas.
Specifically, the minimum bounding rectangle may be calculated first: for a known set of vector data coordinates, a computational geometry algorithm (e.g., a rotated cartooning algorithm or a minimum bounding box algorithm) may be used to calculate its minimum bounding rectangle. The minimum bounding rectangle is the smallest rectangle that can fully contain all vector data points, and its length and width are the smallest of all possible bounding rectangles, respectively. Thereafter, the size of the canvas created at the front end may be determined based on the aspect ratio of the minimum outsourcing rectangle. To maintain the same aspect ratio as the minimum bounding rectangle, the corresponding width and height need to be specified when creating the canvas. In order to enable the minimum outsourcing rectangle formed by vector data to be capable of being fully paved on the whole canvas, four corner points of the minimum outsourcing rectangle can be placed at positions of four corresponding corners of the canvas respectively. Therefore, all contents in the canvas can be completely displayed, and the situation of out-of-range or cutoff cannot occur. Through the above steps, a front end canvas of suitable size and matching the smallest outsourced rectangle formed by the vector data can be created. This ensures that the vector data is best visualized on the canvas and that all the data content can be displayed. As shown in fig. 3, fig. 3 is a schematic diagram of a minimum bounding rectangle according to an embodiment of the present disclosure.
Step 103, calculating conversion parameters and offset parameters based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas.
Alternatively, a coordinate point mapping model may be constructed as:
wherein A and B are canvas coordinates, a and B are vector data coordinates, k is a conversion parameter, and Deltax and Deltay are offset parameters.
Specifically, coordinate conversion can be performed according to the constructed coordinate point mapping model to convert actual vector data coordinates into front end canvas coordinates.
To determine the conversion parameters and the offset parameters, at least two pairs of known coordinate points need to be selected, one of which is the actual vector data coordinates (A1, B1) and the other of which is the corresponding front end canvas coordinates (A1, B1). Thus, two equations can be derived:
A1=ka1+△x
B1=kb1+△y
by solving these two equations, the values of the conversion parameter k and the offset parameters Δx, Δy can be obtained. The specific calculation process can use mathematical methods such as substitution method or primordial elimination method.
And 104, mapping each vector data coordinate into each canvas coordinate in the canvas based on the conversion parameter and the offset parameter.
After the values of the conversion parameter k and the offset parameters Δx, Δy are obtained, these parameters can be applied to coordinate conversion of the actual vector data. For each actual vector data point (a, b), the following formula may be used for conversion:
A=ka+△x
B=kb+△y
through the steps, the coordinates of the actual vector data can be converted into corresponding front end canvas coordinates. This ensures that the vector data forming outsourced rectangles can be tiled into the entire canvas and reach an optimal state in terms of visualization. Wherein, the more known coordinate points are selected, the more accurate the conversion result is.
And 105, calling a preset geometric drawing and style rendering function, and performing visual display at the front end based on each canvas coordinate and the description information corresponding to each canvas coordinate.
Optionally, a preset geometric drawing and style rendering function may be invoked, and based on the canvas coordinates and the description information corresponding to each canvas coordinate, corresponding points, lines and faces are drawn on the canvas at the front end.
Specifically, the coordinates (a, B) of the actual vector data can be converted into corresponding front end canvas coordinates (a, B) according to the coordinate conversion already performed, and a preset geometric drawing and style rendering function is called to draw corresponding points, lines and planes according to the description information corresponding to each canvas coordinate.
It is first necessary to traverse all the actual vector data and coordinate-convert each data point (a, b). And then, according to the obtained front end canvas coordinates (A, B) and the corresponding description information, a preset point, line and surface drawing function is called for drawing.
For example, a point may be drawn using a drawing point function, coordinates (a, B) of the incoming point and corresponding style parameters (e.g., color, size, etc.). Likewise, to draw a line or a polygon, a corresponding drawing function may be invoked. And finally, when the drawing function is called, corresponding style parameters are also required to be provided for rendering the drawn geometric figure. For example, style attributes such as color, size, transparency, etc. may be set for the drawn points or lines to better reveal the characteristics and information of the vector data.
Through the steps, corresponding points, lines and faces can be drawn on the front-end canvas based on the canvas coordinates and the description information corresponding to each canvas coordinate. The process requires predefined rendering functions and style rendering parameters, and sequentially traversing all vector data in order to render.
The function package and the corresponding attribute setting of the function package for drawing the vector points, lines, planes and labels are provided. The method specifically comprises the following steps:
the vector point drawing attribute settings include position coordinates, style parameters such as radius, color, edge width, edge color, text information, text color, font style and size, text offset, text background color, text direction, etc.
The vector line drawing attribute settings include position coordinates, style parameters such as line width, color, edge width, edge color, etc.
Vector surface rendering attribute settings, including position coordinates, style parameters, such as fill color, edge width, edge color, etc.
Using the encapsulated function, fast visualization of the vector data is accomplished at the front end based on the incoming vector data and style parameters.
Optionally, according to canvas coordinates corresponding to each vector data type, the following geometric rendering and style rendering functions may be determined:
vector points: geometry rendering function: and drawing a circle by using a context. Arc method of canvas, and setting the circle center coordinates as the position coordinates of the vector points.
Style rendering function: according to style attribute setting of the vector points, setting filling colors and edge colors by using a context. FileStyle method and a context. StrokeStyle method of canvas, and performing filling and tracing operations by using the context. Fill method and the context. Stroke method. If text information exists, text can be drawn and a style can be set by using a text.
Vector line: geometry rendering function: the start point and end point coordinates of the line are set using the context. Moveto and context. Lineto methods of canvas, and the line segments are sequentially connected according to a given position coordinate array.
Style rendering function: according to style attribute setting of the vector line, setting line width and color by using a context. Linewidth method and a context. Stroketype method of canvas, and performing edge drawing operation by using the context. Stroketype method.
Vector surface: geometry rendering function: and setting vertex coordinates of the polygon by using a context. Moveto method and a context. Lineto method of canvas, sequentially connecting line segments according to a given position coordinate array, and closing a path by using a context. Close path method.
Style rendering function: according to style attribute setting of the vector surface, setting filling colors and edge colors by using a context. FileStyle method and a context. StrokeStyle method of canvas, and performing filling and tracing operations by using the context. Fill method and the context. Stroke method.
Based on the above geometric drawing and style rendering functions, and corresponding description information, visual presentation can be performed at the front end. And according to the type and the coordinates of the input vector data, calling corresponding functions to draw and render, and realizing the visual effect of the vector data.
In the embodiment of the disclosure, a vector data set is firstly obtained, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate, then a canvas corresponding to the vector data set is created based on each vector data coordinate, then conversion parameters and offset parameters are calculated based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas, then each vector data coordinate is mapped to each canvas coordinate in the canvas based on the conversion parameters and the offset parameters, finally a preset geometric drawing and style rendering function is called, and visual display is performed at the front end based on the description information corresponding to each canvas coordinate and each canvas coordinate. Therefore, when the vector data is drawn, a third party graphic library is not needed, so that dependence is reduced, the use threshold is low, the development process is convenient, unnecessary interactive references are reduced, the drawing of different vector data can be rapidly completed, the rapid browsing requirement of a user is met, the function expansion of the user is supported, and the front end is rapidly visualized. By mapping the vector data set onto the canvas, visual presentation of the vector data may be achieved at the front end using a preset geometric rendering and style rendering function. The method and the device help users to more intuitively understand and analyze the data content, and improve the visual presentation effect of the data. Vector data coordinates are mapped to canvas coordinates in the canvas by calculating the conversion parameters and the offset parameters. This allows for conversion between different coordinate systems, such as converting latitude and longitude coordinates to planar coordinates or pixel coordinates. This allows for easy overlay or contrast analysis of the vector dataset with the map background, other layers. And carrying out association display on the description information corresponding to each vector data coordinate in visual display. This helps the user to better understand the data features, attributes and meanings, and further to make data analysis and decisions. In front-end presentations, the user may perform interactive operations such as zoom-in, zoom-out, pan, select, and filter. Therefore, the user can freely explore the data content, and view and analyze the specific area according to the need, so that the user experience and the data exploration efficiency are improved. In a word, the visual display and interactive operation of the data are realized by using the mapping relation between the vector data set and the canvas. It helps users better understand the data content, make data analysis and decisions. Meanwhile, through data conversion and mapping, superposition analysis can be conveniently carried out with other layers, and the capability and effect of data analysis are expanded.
In order to implement the above embodiment, the present disclosure further proposes a vector data visualization system.
Fig. 2 is a schematic structural diagram of a vector data visualization system according to an embodiment of the present disclosure.
As shown in fig. 2, the vector data visualization system 200 may include:
an obtaining module 210, configured to obtain a vector data set, where the vector data set includes each vector data coordinate and description information corresponding to each vector data coordinate;
a creating module 220, configured to create a canvas corresponding to the vector data set based on the vector data coordinates;
a calculation module 230, configured to calculate a conversion parameter and an offset parameter based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas;
a mapping module 240, configured to map the vector data coordinates to canvas coordinates in the canvas based on the conversion parameters and the offset parameters;
and the display module 250 is used for calling a preset geometric drawing and style rendering function and performing visual display at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
Optionally, the creating module is specifically configured to:
determining a minimum circumscribed rectangle corresponding to each vector data coordinate, wherein the minimum circumscribed rectangle characterizes a minimum rectangle capable of completely surrounding each vector data coordinate;
and generating a corresponding canvas at the front end based on the aspect ratio corresponding to the minimum circumscribed rectangle, and respectively placing four corner points of the minimum circumscribed rectangle at the positions of the four corresponding corners of the canvas.
Optionally, the computing module is further configured to:
the coordinate point mapping model is constructed as follows:
wherein A and B are canvas coordinates, a and B are vector data coordinates, k is a conversion parameter, and Deltax and Deltay are offset parameters.
Optionally, the display module is specifically configured to:
and calling a preset geometric drawing and style rendering function, and drawing corresponding points, lines and faces on the canvas at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
Optionally, the display module is specifically configured to:
determining geometric drawing and style rendering functions associated with each canvas coordinate according to the vector data type corresponding to each vector data coordinate;
and performing visual display at the front end based on the geometric drawing and style rendering functions associated with each canvas coordinate and the description information corresponding to the canvas coordinates.
In the embodiment of the disclosure, a vector data set is firstly obtained, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate, then a canvas corresponding to the vector data set is created based on each vector data coordinate, then conversion parameters and offset parameters are calculated based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas, then each vector data coordinate is mapped to each canvas coordinate in the canvas based on the conversion parameters and the offset parameters, finally a preset geometric drawing and style rendering function is called, and visual display is performed at the front end based on the description information corresponding to each canvas coordinate and each canvas coordinate. Therefore, when the vector data is drawn, a third party graphic library is not needed, so that dependence is reduced, the use threshold is low, the development process is convenient, unnecessary interactive references are reduced, the drawing of different vector data can be rapidly completed, the rapid browsing requirement of a user is met, the function expansion of the user is supported, and the front end is rapidly visualized.
In order to achieve the above embodiments, the present disclosure further proposes an electronic device including: the vector data visualization method comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the vector data visualization method according to the previous embodiment of the disclosure when executing the program.
In order to implement the foregoing embodiments, the present disclosure further proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements a vector data visualization method as proposed in the foregoing embodiments of the present disclosure.
Fig. 4 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure. The electronic device 12 shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 4, the electronic device 12 is in the form of a general purpose computing device. Components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry Standard architecture (Industry Standard Architecture; hereinafter ISA) bus, micro channel architecture (Micro Channel Architecture; hereinafter MAC) bus, enhanced ISA bus, video electronics standards Association (Video Electronics Standards Association; hereinafter VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnection; hereinafter PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter: RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a compact disk read only memory (Compact Disc Read Only Memory; hereinafter CD-ROM), digital versatile read only optical disk (Digital Video Disc Read Only Memory; hereinafter DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks, such as a local area network (Local Area Network; hereinafter: LAN), a wide area network (Wide Area Network; hereinafter: WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the methods mentioned in the foregoing embodiments.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "a plurality" is at least two, such as two, three, etc., unless explicitly specified otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
Furthermore, each functional unit in the embodiments of the present disclosure may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present disclosure have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the present disclosure, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the present disclosure.

Claims (10)

1. A method of visualizing vector data, comprising:
acquiring a vector data set, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate;
creating a canvas corresponding to the vector data set based on the respective vector data coordinates;
calculating a conversion parameter and an offset parameter based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas;
mapping the vector data coordinates to canvas coordinates in the canvas based on the conversion parameters and the offset parameters;
and calling a preset geometric drawing and style rendering function, and performing visual display at the front end based on each canvas coordinate and the description information corresponding to each canvas coordinate.
2. The method of claim 1, wherein the creating a canvas corresponding to the vector dataset based on the respective vector data coordinates comprises:
determining a minimum circumscribed rectangle corresponding to each vector data coordinate, wherein the minimum circumscribed rectangle characterizes a minimum rectangle capable of completely surrounding each vector data coordinate;
and generating a corresponding canvas at the front end based on the aspect ratio corresponding to the minimum circumscribed rectangle, and respectively placing four corner points of the minimum circumscribed rectangle at the positions of the four corresponding corners of the canvas.
3. The method of claim 1, further comprising, prior to the calculating the conversion parameter and the offset parameter based on the at least two vector data coordinates and corresponding ones of the at least two vector data coordinates in the canvas:
the coordinate point mapping model is constructed as follows:
wherein A and B are canvas coordinates, a and B are vector data coordinates, k is a conversion parameter, and Deltax and Deltay are offset parameters.
4. The method of claim 1, wherein the invoking the preset geometric rendering and style rendering function, based on the respective canvas coordinates and the description information corresponding to each canvas coordinate, performs a visual presentation at a front end, comprises:
and calling a preset geometric drawing and style rendering function, and drawing corresponding points, lines and faces on the canvas at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
5. The method of claim 1, wherein the invoking the preset geometric rendering and style rendering function, based on the respective canvas coordinates and the description information corresponding to each canvas coordinate, performs a visual presentation at a front end, comprises:
determining geometric drawing and style rendering functions associated with each canvas coordinate according to the vector data type corresponding to each vector data coordinate;
and performing visual display at the front end based on the geometric drawing and style rendering functions associated with each canvas coordinate and the description information corresponding to the canvas coordinates.
6. A vector data visualization apparatus, comprising:
the acquisition module is used for acquiring a vector data set, wherein the vector data set comprises each vector data coordinate and description information corresponding to each vector data coordinate;
the creation module is used for creating canvas corresponding to the vector data set based on the vector data coordinates;
the computing module is used for computing conversion parameters and offset parameters based on at least two vector data coordinates and canvas coordinates corresponding to the at least two vector data coordinates in the canvas;
the mapping module is used for mapping each vector data coordinate into each canvas coordinate in the canvas based on the conversion parameter and the offset parameter;
and the display module is used for calling a preset geometric drawing and style rendering function and carrying out visual display at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
7. The apparatus of claim 6, wherein the creation module is specifically configured to:
determining a minimum circumscribed rectangle corresponding to each vector data coordinate, wherein the minimum circumscribed rectangle characterizes a minimum rectangle capable of completely surrounding each vector data coordinate;
and generating a corresponding canvas at the front end based on the aspect ratio corresponding to the minimum circumscribed rectangle, and respectively placing four corner points of the minimum circumscribed rectangle at the positions of the four corresponding corners of the canvas.
8. The apparatus of claim 6, wherein the computing module is further to:
the coordinate point mapping model is constructed as follows:
wherein A and B are canvas coordinates, a and B are vector data coordinates, k is a conversion parameter, and Deltax and Deltay are offset parameters.
9. The device according to claim 6, wherein the display module is specifically configured to:
and calling a preset geometric drawing and style rendering function, and drawing corresponding points, lines and faces on the canvas at the front end based on the canvas coordinates and the description information corresponding to each canvas coordinate.
10. The device according to claim 6, wherein the display module is specifically configured to:
determining geometric drawing and style rendering functions associated with each canvas coordinate according to the vector data type corresponding to each vector data coordinate;
and performing visual display at the front end based on the geometric drawing and style rendering functions associated with each canvas coordinate and the description information corresponding to the canvas coordinates.
CN202311452478.3A 2023-11-02 2023-11-02 Vector data visualization method and device Pending CN117519697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311452478.3A CN117519697A (en) 2023-11-02 2023-11-02 Vector data visualization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311452478.3A CN117519697A (en) 2023-11-02 2023-11-02 Vector data visualization method and device

Publications (1)

Publication Number Publication Date
CN117519697A true CN117519697A (en) 2024-02-06

Family

ID=89746831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311452478.3A Pending CN117519697A (en) 2023-11-02 2023-11-02 Vector data visualization method and device

Country Status (1)

Country Link
CN (1) CN117519697A (en)

Similar Documents

Publication Publication Date Title
CA2124604C (en) Method and apparatus for operating on an object-based model data structure to produce a second image in the spatial context of a first image
US10599284B2 (en) Three-dimensional digital modeling with two-dimensional canvas
CA2676487C (en) Method for emphasizing differences in graphical appearance between an original document and a modified document with annotations
US10943375B2 (en) Multi-state vector graphics
Wu et al. ViSizer: a visualization resizing framework
US20080238947A1 (en) System and method for non-linear magnification of images
US9501811B2 (en) Resizing an image
JPH0785290A (en) Method and equipment for clipping of graphic polygon to clip region
US10832376B2 (en) Generating enhanced digital content using piecewise parametric patch deformations
US20220121307A1 (en) Method and device of drawing handwriting track, electronic apparatus, medium, and program product
US10650576B1 (en) Snapping experience with clipping masks
US10628918B2 (en) Generating enhanced digital content using piecewise parametric patch deformations
US10706500B2 (en) Generating enhanced digital content using piecewise parametric patch deformations
EP0607136A1 (en) Graphics output system with bounded updating
JPH05334383A (en) Image drawing editing device
CN113538623A (en) Method and device for determining target image, electronic equipment and storage medium
US20240161430A1 (en) Applying vector-based decals on three-dimensional objects
CN117519697A (en) Vector data visualization method and device
JP2003250039A (en) Image processing apparatus, image processing method, and recording medium
US20060204133A1 (en) Method and system for transforming spatial data
US11087069B2 (en) Method of visually interacting with a document by dynamically displaying a fill area in a boundary
US11182955B1 (en) Utilizing dynamic filtering to adaptively generate control points of a vector object for display in a graphical user interface
JP2004348708A (en) Polygon creation method for geographical information system, and its device
AU2022263506B2 (en) Systems and methods for creating and using deformable text shapes
Bergamasco et al. Saliency-driven Variational Retargeting for Historical Maps

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