High-performance GIS vector data editing and capturing method and device

文档序号:190518 发布日期:2021-11-02 浏览:14次 中文

阅读说明:本技术 一种高性能gis矢量数据编辑捕捉方法及装置 (High-performance GIS vector data editing and capturing method and device ) 是由 池晶 贺楷锴 余磊 沈雷 武永波 任康成 付智能 白文博 冯德润 沈文斐 于 2021-09-28 设计创作,主要内容包括:本发明适用于GIS技术领域,提供一种高性能GIS矢量数据编辑捕捉方法及装置,所述方法包括:对当前显示的一屏矢量地物数据进行简化数据处理,保存在简化缓存中;使用简化的数据绘制地图和绘制捕捉缓存;当开启一个捕捉任务时,获取当前捕捉点位并根据捕捉缓存进行捕捉计算,将捕捉结果进行缓存。本发明首先对数据进行简化,使用本地RGB位图索引查询代替空间查询,降低了几何算法的复杂度,减少了几何运算时间,提高了空间数据查询效率,提升了捕捉效率,具有很高的工程价值;并采用多路缓存策略来应对大数据的情况,提高了对象捕捉稳定性和流畅度,能够明显提高编辑作业人员的工作效率。(The invention is suitable for the technical field of GIS and provides a high-performance GIS vector data editing and capturing method and a device, wherein the method comprises the following steps: carrying out simplified data processing on the currently displayed vector ground feature data on one screen, and storing the data in a simplified cache; mapping and mapping capture cache using the simplified data; when a capturing task is started, the current capturing point position is obtained, capturing calculation is carried out according to the capturing cache, and the capturing result is cached. The method simplifies the data, replaces space query with local RGB bitmap index query, reduces the complexity of a geometric algorithm, reduces the geometric operation time, improves the spatial data query efficiency, improves the capture efficiency, and has high engineering value; and a multi-path cache strategy is adopted to deal with the condition of big data, so that the object capturing stability and smoothness are improved, and the working efficiency of editing operators can be obviously improved.)

1. A high-performance GIS vector data editing and capturing method is characterized by comprising the following steps:

s1, simplifying data processing is carried out on the currently displayed vector ground feature data of one screen, and the data is stored in a simplified cache;

step S2, drawing a map and drawing a capture cache by using the simplified data, wherein the capture cache comprises the mapping relation between the unique ID of the surface feature object and the bitmap index, and the unique ID of the surface feature object is called as OID;

and step S3, when a capturing task is started, acquiring the current capturing point position, performing capturing calculation according to the capturing cache, and caching the capturing result.

2. The method for editing and capturing high-performance GIS vector data according to claim 1, wherein in step S2, the specific process of drawing and capturing the cache is as follows:

creating a capture cache with adaptive size according to the size of the display pixels of the screen;

and corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in a capture cache.

3. The high-performance GIS vector data editing and capturing method of claim 2, wherein the surface feature objects are drawn to corresponding points in the capture cache by bitmap color assignment; if the surface feature object is a point or a line, directly assigning values and drawing according to the path of the surface feature object; and if the surface object is a surface, the surface object is used as a closed contour line to carry out path assignment drawing.

4. The method for editing and capturing high-performance GIS vector data according to claim 1, wherein the step S3 specifically comprises:

when a capturing task is started, acquiring a current capturing point position p (x, y);

inquiring whether a cache point or a line corresponding to the point p (x, y) exists in the capture cache;

if the object exists, finding out the corresponding OID through the mapping relation according to the cache point or line, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, namely capturing the corresponding ground object;

if the point p (x, y) does not exist, a pixel is extended outwards in the 8 directions around the point p (x, y) from the capture cache to find cache points or lines in the range of the 9 pixels, then a corresponding OID is found through a mapping relation, and then the geometry and the attributes of each ground object are taken out from the simplified cache, so that the corresponding ground object can be captured;

and caching the capture result.

5. The method for editing and capturing high-performance GIS vector data according to claim 1, wherein the captured results are cached in a memory, and the captured results are eliminated according to a least-used strategy.

6. A high performance GIS vector data edit capture apparatus, the apparatus comprising:

the data simplifying unit is used for carrying out simplified data processing on the currently displayed vector ground object data of one screen and storing the simplified data in a simplified cache;

the mapping unit is used for mapping the map and mapping a capturing cache by using simplified data, wherein the capturing cache comprises a mapping relation between a unique ID of a ground object and a bitmap index, and the unique ID of the ground object is called as OID;

and the interactive capturing unit is used for acquiring the current capturing point position, performing capturing calculation according to the capturing cache and caching the capturing result when a capturing task is started.

7. The high-performance GIS vector data editing and capturing apparatus of claim 6, wherein the drawing and capturing unit comprises:

the cache creating module is used for creating a capture cache with an adaptive size according to the size of the display pixels of the screen;

and the mapping and drawing module is used for corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in the capture cache.

8. The high-performance GIS vector data editing and capturing apparatus of claim 6, wherein the interaction capturing unit comprises:

the point position acquisition module is used for acquiring a current capture point position p (x, y) when a capture task is started;

the cache query module is used for querying whether a cache point or a cache line corresponding to the point p (x, y) exists in the capture cache;

the first capturing module is used for finding out the corresponding OID through the mapping relation according to the cache point or line when the cache inquiring module inquires that the corresponding OID exists, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, so that the corresponding ground object can be captured;

the second capturing module is used for finding out a pixel extending from 8 directions around the point p (x, y) from the capturing cache to find out cache points or lines in the range of the 9 pixels when the cache inquiring module does not inquire, then finding out corresponding OIDs through a mapping relation, and then taking out the geometry and the attributes of each object from the simplified cache to capture the corresponding object;

and the result caching module is used for caching the capture result.

Technical Field

The invention belongs to the technical field of GIS, and particularly relates to a high-performance GIS vector data editing and capturing method and device.

Background

Vector point line surface data is used as the most basic data in the GIS (Geographic Information System) industry, and a common data organization mode is to store points, lines and surfaces according to layer classification types respectively, namely the points are stored into one type, the lines are stored into one type, and the surfaces are stored into one type. In the analysis and processing of spatial data, data editing is a common data processing means, various powerful geometric operation processes are adopted in editing in various GIS software, various analysis and processing can be performed on a point line surface, but the manual editing of the data still takes the main work so far, and the manual editing needs to be largely realized by means of a node capturing method to quickly and effectively change and process the data, so that great errors are difficult to avoid due to manual point selection, and topology errors are caused.

It is obvious that the accuracy of manual hand-pointing may not be accurate, so that accurate addition and deletion of points cannot be achieved, and a large number of topological errors can be caused.

For example, in GeoGlobe software, when a surface is drawn, a node close to the surface is captured, and mathematically, capture can be regarded as a process of finding an optimal point, and the optimal point can be a node closest to a mouse point, an intersection point, a perpendicular point, a tangent line, a circle center and the like. The method comprises the following steps of obtaining a point of intersection of a mouse and ground objects in a geographic range, and finding out the accurate relation of line segments of the ground objects, such as the nearest node, the vertical point and the like, in the intersection.

The whole process of the existing capture technology is divided into three steps: 1. the method comprises the steps of obtaining ground objects in a geographic range by inquiring a database or a local cache file, wherein the step is mainly used for obtaining a plurality of complete ground object objects; 2. performing node-level geometric operation on each object in the range to obtain an accurate intersection point, for example, obtaining a node closest to a mouse in one object, and finding the closest node in all the objects by circulating the method; 3. and outputting the capture node for editing and caching all the surface feature objects for computing the node so as to accelerate the next capture.

Obviously, the current vector data capturing method has obvious defects:

firstly, the time consumption of space query is large, and the overall process efficiency is not high. The data needing to be captured is obtained through space query, the efficiency of the space query is much lower compared with that of the common attribute query, the space query needs to be carried out uninterruptedly in the high-frequency mouse movement, it is conceivable that under the condition of large data quantity, a database server side bears huge pressure, if the number of people who the server side visits at the same time is large, the capture is possibly blocked or disabled, and if the data quantity is larger than 10 ten thousand through conventional tests, the method can cause the blockage for more than 1 second.

Secondly, geometric operation of the ground object takes much time. Geometric intersection operation is carried out on all line segments according to the object geometry in the range of the mouse point, the process uses the intersection of two geometric calculation lines, and if the data volume is increased, the geometric calculation method is increased in an exponential level.

And thirdly, the cache mode is single, and the method is not suitable for application scenes with large data volumes. Too large a cache range can cause a large amount of data to be in local, not only occupies a large amount of storage space, but also can cause the efficiency to be reduced; conversely, the cache range is too small to achieve an effective reduction in the time to query the database.

Disclosure of Invention

In view of the above problems, the present invention aims to provide a high-performance GIS vector data editing and capturing method and apparatus, and aims to solve the technical problems of low capturing efficiency and high computation consumption of the conventional vector data capturing method.

On one hand, the high-performance GIS vector data editing and capturing method comprises the following steps:

s1, simplifying data processing is carried out on the currently displayed vector ground feature data of one screen, and the data is stored in a simplified cache;

step S2, drawing a map and drawing a capture cache by using the simplified data, wherein the capture cache comprises the mapping relation between the unique ID of the surface feature object and the bitmap index, and the unique ID of the surface feature object is called as OID;

and step S3, when a capturing task is started, acquiring the current capturing point position, performing capturing calculation according to the capturing cache, and caching the capturing result.

Further, in step S2, the specific process of drawing the capture buffer is as follows:

creating a capture cache with adaptive size according to the size of the display pixels of the screen;

and corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in a capture cache.

Further, the surface feature object is drawn to the corresponding point in the capture cache through bitmap color assignment; if the surface feature object is a point or a line, directly assigning values and drawing according to the path of the surface feature object; and if the surface object is a surface, the surface object is used as a closed contour line to carry out path assignment drawing.

Further, the step S3 specifically includes:

when a capturing task is started, acquiring a current capturing point position p (x, y);

inquiring whether a cache point or a line corresponding to the point p (x, y) exists in the capture cache;

if the object exists, finding out the corresponding OID through the mapping relation according to the cache point or line, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, namely capturing the corresponding ground object;

if the point p (x, y) does not exist, a pixel is extended outwards in the 8 directions around the point p (x, y) from the capture cache to find cache points or lines in the range of the 9 pixels, then a corresponding OID is found through a mapping relation, and then the geometry and the attributes of each ground object are taken out from the simplified cache, so that the corresponding ground object can be captured;

and caching the capture result.

Further, the capture result is cached in the memory, and the capture result is eliminated according to the least used strategy.

In another aspect, the high-performance GIS vector data editing and capturing device includes:

the data simplifying unit is used for carrying out simplified data processing on the currently displayed vector ground object data of one screen and storing the simplified data in a simplified cache;

the mapping unit is used for mapping the map and mapping a capturing cache by using simplified data, wherein the capturing cache comprises a mapping relation between a unique ID of a ground object and a bitmap index, and the unique ID of the ground object is called as OID;

and the interactive capturing unit is used for acquiring the current capturing point position, performing capturing calculation according to the capturing cache and caching the capturing result when a capturing task is started.

Further, the drawing capture unit includes:

the cache creating module is used for creating a capture cache with an adaptive size according to the size of the display pixels of the screen;

and the mapping and drawing module is used for corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in the capture cache.

Further, the interaction capturing unit includes:

the point position acquisition module is used for acquiring a current capture point position p (x, y) when a capture task is started;

the cache query module is used for querying whether a cache point or a cache line corresponding to the point p (x, y) exists in the capture cache;

the first capturing module is used for finding out the corresponding OID through the mapping relation according to the cache point or line when the cache inquiring module inquires that the corresponding OID exists, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, so that the corresponding ground object can be captured;

the second capturing module is used for finding out a pixel extending from 8 directions around the point p (x, y) from the capturing cache to find out cache points or lines in the range of the 9 pixels when the cache inquiring module does not inquire, then finding out corresponding OIDs through a mapping relation, and then taking out the geometry and the attributes of each object from the simplified cache to capture the corresponding object;

and the result caching module is used for caching the capture result.

The invention has the beneficial effects that: the method simplifies the data, replaces space query with local RGB bitmap index query, reduces the complexity of a geometric algorithm, reduces the geometric operation time, improves the spatial data query efficiency, improves the capture efficiency, and has high engineering value; and a multi-path cache strategy is adopted to deal with the condition of big data, so that the object capturing stability and smoothness are improved, and the working efficiency of editing operators can be obviously improved.

Drawings

Fig. 1 is a flowchart of a high-performance GIS vector data editing and capturing method according to a first embodiment of the present invention;

FIG. 2 is a diagram illustrating a mapping relationship according to a first embodiment of the present invention;

fig. 3 is a block diagram showing the structure of a high-performance GIS vector data editing and capturing device according to a second embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In order to explain the technical means of the present invention, the following description will be given by way of specific examples.

The first embodiment is as follows:

fig. 1 shows a flow of a high-performance GIS vector data editing and capturing method provided by an embodiment of the present invention, and only the parts related to the embodiment of the present invention are shown for convenience of description.

When an editor drags a screen of mapping ground object objects in a current display screen and then captures the objects, the following three steps are started to be executed, specifically, as shown in fig. 1, the method for editing and capturing high-performance GIS vector data provided by the embodiment includes the following steps:

step S1, data simplification step: and carrying out simplified data processing on the currently displayed vector ground feature data of one screen, and storing the data in a simplified cache.

The capture is operated according to the current screen content, so when displaying one screen of vector ground feature data, the data needs to be simplified firstly. The data of the current window is simplified according to the tolerance of the display pixels, the embodiment adopts the simplification of the protection topology, specifically uses asynchronous local cache, cannot use memory cache, or influences the response of the capture operation interface.

Some GIS vector terrain data can be large, and millions of data are common and stored in a database. However, the editing and updating are generally performed for specific areas, such as the editing of operations in a subarea, a prefecture and a city, and a township, so that the operations are edited on a screen-by-screen basis in a common scene at a certain scale. However, the GIS vector ground object data has a large amount and may have the problems of slow query and the like, and a common machine cannot cache a large amount of vector data in the memory. Therefore, the step is to perform data reduction processing before drawing and then drawing. Certainly, in order not to affect the efficiency of the drawing process, vector caching is performed in parallel based on the local file type database file sqlite.

The data reduction steps are as follows: grid indexes are used for the point data, simple points are not simplified, and multipoint data are simplified according to the geographical range represented by the pixels corresponding to the current scale; under the maximum simplification, the multipoint data becomes one point; the line data is simplified into two-point line break, the plane data is simplified into triangle, that is, after all the vector point line plane data are finally simplified, the vector point line plane data are also the point line plane data, and only the coordinate points are reduced.

The simplified cache is mainly used for drawing and capturing drawing cache, is not real original data, and is a sqlite database, because the sqlite file type database can establish rtree indexes locally, the reading and writing of the sqlite file type database are fast, the reading can reach 10 ten thousand/s, and the writing can reach 3 ten thousand/s.

Step S2, drawing capture step: and drawing a map and drawing a capture cache by using the simplified data, wherein the capture cache comprises a mapping relation between the unique ID of the surface object and the bitmap index, and the unique ID of the surface object is called as OID.

The simplified data is used for drawing the map and drawing the capture cache in parallel, the capture cache is not drawn in the true sense, and different values are attached to one block of memory according to the current screen range. The specific process of drawing, capturing and caching is as follows: creating a capture cache with adaptive size according to the size of the display pixels of the screen; and corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in a capture cache.

For example, the current screen size is w =1024 long and h =768 wide, then a block of capture buffer Swh of 1024 × 768 is created, the buffer data type is unsigned int [ unsigned shaping ]. The data type is set to unsigned int because there will be a one-to-one mapping relationship with the unique value number of the vector ground object later. Further, the color value RGB of the general image may be represented by using unsigned int, for example, the unsigned int corresponding to RGB (255, 255, 0) color is 65536. Therefore, each RGB color can be represented by a numerical value of an unknown int type, and the corresponding RGB color can be realized by a conventional color conversion method. This step may therefore consider capture cache Swh to be theoretically considered a bitmap index cache, but rather than being accessed in a bit-by-bit manner in the conventional sense, an index is stored in color.

The feature object obtained from the simplified buffer or the database generally has a unique ID of the feature object, referred to as OID (object ID) herein, which is generally an int [ shaping ] value greater than 0, and since greater than 0, the OID can be associated with any point in the bitmap index buffer Swh, and Swh corresponds to all data ranges of the screen range, so that the value Pv = Swh (x, y) is obtained based on any point P (x, y) in the screen. Therefore, the present invention uses OID to initialize Swh (x, y) memory, and then the mapping relationship between OID and Swh memory can be established. The subsequent interactive capture can complete the search of the related object without searching a database by directly acquiring the point value, namely Swh (x, y) = = OID can be used for acquiring the unique ID of the ground object, and the point is acquired to intersect with the ground object, so that a large amount of geometric calculation and query are avoided.

This color-based bitmap index mapping is very efficient to perform. As shown in fig. 2, in a basic mapping relationship, different surface feature objects have unique IDs, i.e., OIDs, and each surface feature object is rendered in the form of a color value by mapping the OIDs to colors. In fig. 2, it is assumed that OIDs of two feature line segments are 255 and 65536, respectively. And respectively representing RGB (255, 0, 0) and RGB (255, 255, 0) after mapping, and performing rendering through color assignment.

In the step, the surface feature object is drawn to the corresponding point in the capture cache through bitmap color assignment; if the surface feature object is a point or a line, directly assigning values and drawing according to the path of the surface feature object; and if the surface object is a surface, the surface object is used as a closed contour line to carry out path assignment drawing. Since the data is not really drawn to the device, the data is drawn only to the Swh section of the memory block, and anti-aliasing and complex rendering are not needed, and only certain assignment needs to be carried out on the corresponding memory value. The surface does not need to be filled, and only the boundary of the surface needs to be treated as a line. Because the surface capture does not capture the interior, the cache is generated relatively efficiently. In addition, the cache and the real map symbolic drawing are executed in parallel, so that the influence on map display and operation is basically reduced inefficiently, and a memory drawing engine agg can meet the requirement of application design by selecting one drawing method such as GDI (graphics device interface) and OpenGL (open graphics library) related to equipment. Through detailed tests, the capture buffer of 30W vector surface drawing does not exceed 3s, and the symbolized drawing needs 9s, so that if the map drawing and the capture buffer drawing are executed in parallel, the efficiency is not affected.

Step S3, interactive drawing step: when a capturing task is started, the current capturing point position is obtained, capturing calculation is carried out according to the capturing cache, and the capturing result is cached.

Specifically, the method comprises the following steps:

s31, when a capturing task is started, acquiring a current capturing point p (x, y);

s32, inquiring whether a cache point or a line corresponding to the point p (x, y) exists in the capture cache;

s33, if the corresponding object exists, finding out the corresponding OID through the mapping relation according to the cache point or line, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, namely capturing the corresponding ground object;

s34, if the point p (x, y) does not exist, a pixel is extended outwards in the 8 directions from the capture cache to find cache points or lines in the range of the 9 pixels, then a corresponding OID is found through the mapping relation, and then the geometry and the attributes of each object are taken out from the simplified cache, so that the corresponding object can be captured;

and S35, caching the captured result.

Assuming that a feature object at a p (x, y) point is to be captured, firstly, whether a cache point or a line segment corresponding to the p (x, y) point exists is searched for from a capture cache, if so, a corresponding OID is directly returned, and then the geometry and the attribute of the feature object are correspondingly taken out from a simplified cache through the OID, so that the corresponding feature object is captured; if not, firstly obtaining 8 directions around the p (x, y) point, and including 9 points of the p (x, y) point, namely finding the OID (similar to 9 grids) in the range according to a pixel extended from the edge, and then taking out the geometry and the attribute of the corresponding ground object from the simplified cache, thus capturing the corresponding ground object. Within the range of 9 grids, several OIDs can be taken out. If there is no corresponding OID, this is returned directly to null and a prompt is given.

The points and the line segments of the captured results are cached, and the cached points or the cached line segments have memories, so that the captured results are eliminated according to the longest-used strategy in order to prevent the memories from being too large, the capture cache is prevented from swelling, the efficiency can be guaranteed, and common editing is screen-on-screen editing which rarely jumps.

Example two:

fig. 3 shows a structure of a high-performance GIS vector data editing and capturing apparatus provided by an embodiment of the present invention, and only the portions related to the embodiment of the present invention are shown for convenience of explanation.

As shown in fig. 3, the high-performance GIS vector data editing and capturing device provided by the present embodiment includes:

the data simplifying unit 1 is used for carrying out simplified data processing on the currently displayed vector ground object data of one screen and storing the simplified data in a simplified cache;

the drawing and capturing unit 2 is used for drawing a map and drawing and capturing a cache by using simplified data, wherein the capturing cache comprises a mapping relation between a unique ID of a ground object and a bitmap index, and the unique ID of the ground object is called as OID;

and the interactive capturing unit 3 is used for acquiring the current capturing point position, performing capturing calculation according to the capturing cache and caching the capturing result when a capturing task is started.

The functional units 1 to 3 correspondingly implement steps S1 to S3 in the first embodiment, specifically, the vector feature data is simplified by the data simplification unit, then the drawing capture unit performs drawing capture caching, and finally the capture calculation and caching of the capture result are completed by the interaction capture unit.

Wherein the drawing capture unit 2 includes:

the cache creating module is used for creating a capture cache with an adaptive size according to the size of the display pixels of the screen;

and the mapping and drawing module is used for corresponding the unique ID of each ground object in the screen display range to a corresponding point in the bitmap index, establishing a mapping relation and drawing the mapping relation in the capture cache.

Wherein the interaction capturing unit 3 comprises:

the point position acquisition module is used for acquiring a current capture point position p (x, y) when a capture task is started;

the cache query module is used for querying whether a cache point or a cache line corresponding to the point p (x, y) exists in the capture cache;

the first capturing module is used for finding out the corresponding OID through the mapping relation according to the cache point or line when the cache inquiring module inquires that the corresponding OID exists, and correspondingly taking out the geometry and the attribute of the ground object through the OID from the simplified cache, so that the corresponding ground object can be captured;

the second capturing module is used for finding out a pixel extending from 8 directions around the point p (x, y) from the capturing cache to find out cache points or lines in the range of the 9 pixels when the cache inquiring module does not inquire, then finding out corresponding OIDs through a mapping relation, and then taking out the geometry and the attributes of each object from the simplified cache to capture the corresponding object;

and the result caching module is used for caching the capture result.

In conclusion, the method reduces the complexity of a geometric algorithm by using the special bitmap index, greatly improves the capture efficiency and has high engineering value; the query times of the database are greatly reduced by aiming at the database optimization, more bandwidth is saved, and the data utilization efficiency is relatively high; meanwhile, multi-path cache is adopted, the smoothness of overall capture is greatly improved, and the working efficiency of editing operators can be obviously improved.

The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:索引管理方法、装置、电子设备和可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!