CN104036535A - Quick sorting method for vector in two-dimensional geographic information system - Google Patents

Quick sorting method for vector in two-dimensional geographic information system Download PDF

Info

Publication number
CN104036535A
CN104036535A CN201410236559.4A CN201410236559A CN104036535A CN 104036535 A CN104036535 A CN 104036535A CN 201410236559 A CN201410236559 A CN 201410236559A CN 104036535 A CN104036535 A CN 104036535A
Authority
CN
China
Prior art keywords
vector
information system
color value
geographic information
vector graphics
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
CN201410236559.4A
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.)
Central Plains Wisdom Urban Design Research Institute Co Ltd
Original Assignee
Central Plains Wisdom Urban Design 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 Central Plains Wisdom Urban Design Research Institute Co Ltd filed Critical Central Plains Wisdom Urban Design Research Institute Co Ltd
Priority to CN201410236559.4A priority Critical patent/CN104036535A/en
Publication of CN104036535A publication Critical patent/CN104036535A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a quick sorting method for a vector in a two-dimensional geographic information system. The quick sorting method for the vector in the two-dimensional geographic information system comprises the following steps: (1) generating a temporary raster image in a computer memory, wherein the temporary raster image is as big as a computer screen or QWidget; (2) normally drawing each vector graphic on a computer; (3) drawing each vector graphic in the step (2) on a temporary image in the computer memory, and filling the vector graphics with different colors, wherein a color value used for each graphic is unique; (4) establishing a mapping table; (5) obtaining the pixel value of a position where a mouse is positioned; and (6) finding the color value the same with the pixel value and finding a graphic corresponding to the color value by the mapping table. According to the quick sorting method for the vector in the two-dimensional geographic information system, the same method can be used for sorting different vector graphics, such as points, lines, surfaces and the like, and the efficiency and the universality of a graphic sorting method in the prior art can be improved.

Description

The quick picking method of vector in two dimension Geographic Information System
Technical field
The present invention relates to Geographic Information System, especially relate to the quick picking method of vector in a kind of two-dimentional Geographic Information System.
Background technology
Geographic Information System (GIS) is the technological achievement of the multi-door subjects such as collection geography, cartography, computer graphics, mapping, remote sensing and a kind of comprehensive high-tech product that grows up is being brought into play significant role in the numerous areas such as urban construction, traffic programme, land survey, agriculture and forestry production.In GIS, all kinds of basic geographical information elements, as planning zone boundary, city, villages and small towns and traffic route etc. can represent with three class vector graphics such as point, line, surface, can say that vector data is one of most important data mode in GIS.
In GIS, editor's vector graphics is one of a kind of critical element task.Before carrying out edit figure, generally need to choose the figure that will edit with mouse, conventional method is that position and the relation between figure at cursor place judges which figure is chosen while clicking the mouse by calculating, for " face " key element, judge exactly cursor position and polygonal relation, if light drops in polygon, show that this face key element is chosen, otherwise do not choose; Concerning " point " and " line " key element, judge that exactly mouse arrives the distance of " point " and line, if distance is less than certain threshold values, shows that this key element is chosen, otherwise do not choose.The shortcoming of conventional method is, when polygonal limit number is too many, efficiency is not high, and, when having that a plurality of key elements are folded exists overlapped situation, cannot distinguish which vector graphics chooses be.
Summary of the invention
In view of this, the object of the present invention is to provide the quick picking method of vector in a kind of two-dimentional Geographic Information System, improved the editorial efficiency of vector graphics in prior art, and can fine processing a plurality of figures situation about mutually superposeing.
For solving the problems of the technologies described above, the present invention by the following technical solutions:
The quick picking method of vector in two-dimentional Geographic Information System, comprises the steps:
Step (1), in calculator memory, produces the interim grating image of a width, and its size is identical with computer screen or QWidget;
Step (2), normally draws each vector graphics on computers;
Step (3), each vector graphics described in plot step on the intermediate images in calculator memory (2), in the process of graphing, fills vector graphics with different colours, and color value is random value, and each figure color value used is unique;
Step (4), sets up mapping table, and the color value in step (3) and the figure of drawing are set up to one-to-one relationship;
Step (5), obtains the pixel value of mouse position on screen;
Step (6), compares the pixel value in step (5) with unique color value that step (4) produces, find identical with it color value, and recycling mapping table finds this color value graph of a correspondence.
As preferably, described step (3), draws vector graphics in internal memory picture by unique color, is stored in calculator memory as a setting.
As preferably, described step (1) represents a grating image with QImage object in the cross-platform storehouse of QT.
As preferably, described step (2), in the cross-platform storehouse of QT, the graph function interface providing by QPainter class is drawn each vector graphics.
As preferably, described step (3) with same QPainter interface function, is drawn the vector graphics of a step (2) on QImage object.
As preferably, described step (4), sets up index relative one to one with Hash list structure by vector graphics and unique color value of drawing it.
As preferably, 4 byte representations of 32 bits for described color value.
Method proposed by the invention has following beneficial effect:
This method is without the spatial relation of judgement mouse point and vector graphics, also without the type of considering vector graphics, identical to the disposal route of point, line, surface three class vector graphics.Compare with conventional method, this method can be located the vector graphics of selection fast, only need to save as cost with in very little; Can process in the same manner three kinds of dissimilar vector graphics of point, line, surface, simplify computing machine treatment scheme; Can process well the overlapping situation of a plurality of key elements, improve efficiency and the universality of figure picking method in prior art.
Other advantages of the present invention, target and feature will be set forth to a certain extent in the following description, and to a certain extent, based on will be apparent to those skilled in the art to investigating below, or can be instructed from the practice of the present invention.Target of the present invention and other advantages can be by below instructions or accompanying drawing in specifically noted structure realize and obtain.
Accompanying drawing explanation
Fig. 1 is method flow diagram of the present invention;
Fig. 2 is the schematic diagram that is related to of QImage object of the present invention and QWidget object;
Fig. 3 is the schematic diagram that vector graphics that the present invention is different represents with unique color value;
Fig. 4 is the schematic diagram that the present invention searches the vector graphics that color value is corresponding in Hash table.
Embodiment
core of the present invention is for providing a kind of method of choosing fast vector graphics in Geographic Information System, use the method can significantly improve the efficiency of vector graphics selection algorithm in Geographic Information System, to different vector graphics such as point, line, surface, all can make to use the same method to choose, can improve efficiency and the universality of figure picking method in prior art.
In order to make those skilled in the art understand better technical scheme of the present invention, below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.
Referring to Fig. 1, the present invention specifically comprises the following steps:
Step (1), prepare what a internal memory grating image, in the cross-platform storehouse of QT, with QImage object, represent a grating image, the size of image must be consistent with display screen, in QT storehouse, be used for the control of rendering image and be called as QWidget, if vector graphics is to be plotted on QWidget, rather than be directly plotted in whole computer screen, what the size of grating image QImage need be with QWidget so is consistent.
Step (2), normally draws each vector in VectorLayer, in QT storehouse, by QPainter class, provides a series of graph function interface, is easy to realize the drafting of point, line, surface with these interface functions.
Step (3) with same QPainter interface function, is drawn once on QImage object, and repeating step 2, are only that rendered object changes QImage object into from QWidget or screen.Then with unique color value, fill each polygon vector, vector graphics is line type or vertex type in this way, can directly with unique color value, draw.The relation of QImage object and QWidget object is referring to Fig. 2.Described unique color value is with 4 byte representations of 32 bits in the operating systems such as windows, unix, and available random function generates, but will guarantee that each figure color value used is unique, referring to Fig. 3.In step (2), each vector graphics is once drawn, is used for normally showing, once drawn again in step (3), with unique color value, is plotted in internal memory picture.
Step (4), creates a Hash table (Hash Table) data structure, utilizes this structure, sets up the one-to-one relationship of the vector graphics of color value and drafting.Color value must be unique, is for can be as the key word of HASH TABLE, and subsequent step can easily be inquired about corresponding vector graphics by unique color value.
Step (5), the QWidget control in QT storehouse provides QMouseEvent event handling function, and when user clicks the mouse at every turn on QWidget or screen, this event handling function will be called.Can in this function, preserve the position at cursor place.Then obtain the pixel value of onscreen cursor position.
Step (6) referring to Fig. 4, using the color of the pixel value in step (5) as key word, finds the vector graphics that this color value is corresponding in Hash table step (4) Suo Shu.
Finally explanation is, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, other modifications that those of ordinary skills make technical scheme of the present invention or be equal to replacement, only otherwise depart from the spirit and scope of technical solution of the present invention, all should be encompassed in the middle of claim scope of the present invention.

Claims (7)

1. the quick picking method of vector in two-dimentional Geographic Information System, is characterized in that: comprise the steps:
Step (1), in calculator memory, produces the interim grating image of a width, and its size is identical with computer screen or QWidget;
Step (2), normally draws each vector graphics on computers;
Step (3), each vector graphics described in plot step on the intermediate images in calculator memory (2), in the process of graphing, fills vector graphics with different colours, and color value is random value, and each figure color value used is unique;
Step (4), sets up mapping table, and the color value in step (3) and the figure of drawing are set up to one-to-one relationship;
Step (5), obtains the pixel value of mouse position on screen;
Step (6), compares the pixel value in step (5) with unique color value that step (4) produces, find identical with it color value, and recycling mapping table finds this color value graph of a correspondence.
2. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 1, is characterized in that: described step (3), is stored in calculator memory as a setting with unique color drafting vector graphics in internal memory picture.
3. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 2, is characterized in that: described step (1) represents a grating image with QImage object in the cross-platform storehouse of QT.
4. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 3, is characterized in that: described step (2), in the cross-platform storehouse of QT, the graph function interface providing by QPainter class is drawn each vector graphics.
5. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 4, is characterized in that: described step (3), with same QPainter interface function, on QImage object, draw the vector graphics of a step (2).
6. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 1, is characterized in that: described step (4), with Hash list structure, vector graphics and unique color value of drawing it are set up to index relative one to one.
7. the quick picking method of vector in a kind of two-dimentional Geographic Information System according to claim 1, is characterized in that: 4 byte representations of 32 bits for described color value.
CN201410236559.4A 2014-05-30 2014-05-30 Quick sorting method for vector in two-dimensional geographic information system Pending CN104036535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410236559.4A CN104036535A (en) 2014-05-30 2014-05-30 Quick sorting method for vector in two-dimensional geographic information system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410236559.4A CN104036535A (en) 2014-05-30 2014-05-30 Quick sorting method for vector in two-dimensional geographic information system

Publications (1)

Publication Number Publication Date
CN104036535A true CN104036535A (en) 2014-09-10

Family

ID=51467294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410236559.4A Pending CN104036535A (en) 2014-05-30 2014-05-30 Quick sorting method for vector in two-dimensional geographic information system

Country Status (1)

Country Link
CN (1) CN104036535A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111479053A (en) * 2020-03-25 2020-07-31 清华大学 Software control system and method for scanning light field multicolor microscopic imaging
CN112882662A (en) * 2021-03-17 2021-06-01 中国人民解放军国防科技大学 Geographic element efficient access method based on continuous memory

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111479053A (en) * 2020-03-25 2020-07-31 清华大学 Software control system and method for scanning light field multicolor microscopic imaging
CN111479053B (en) * 2020-03-25 2021-07-16 清华大学 Software control system and method for scanning light field multicolor microscopic imaging
CN112882662A (en) * 2021-03-17 2021-06-01 中国人民解放军国防科技大学 Geographic element efficient access method based on continuous memory
CN112882662B (en) * 2021-03-17 2022-05-27 中国人民解放军国防科技大学 Geographic element efficient access method based on continuous memory

Similar Documents

Publication Publication Date Title
US10319062B2 (en) Rendering map data using descriptions of raster differences
CN110347769A (en) Processing method, device, equipment and the storage medium of multi-layer map tile
CN105393282A (en) Efficient composition and rendering of graphical elements
DE202014010936U1 (en) Efficient retrieval of map tile data
CN112100795B (en) Computer aided design drawing comparison method and device
CN104657458A (en) Method and device for presenting object information of foreground object in scene image
CN102270236A (en) Rasterized geographic information system (GIS)-based spatial relationship judging method and system
WO2021093344A1 (en) Semi-automatic image data labeling method, electronic apparatus, and storage medium
Shen et al. A new approach to simplifying polygonal and linear features using superpixel segmentation
CN104143096A (en) Binary connected domain labeling method based on address event representation
CN105051789A (en) Three-dimensional map display system
CN105068918A (en) Page test method and device
CN105913475A (en) Dynamic visualized method of space-time change process
CN103473984A (en) Template-based dynamic map obtaining method in network environment
Shen et al. A progressive method for the collapse of river representation considering geographical characteristics
CN105844609B (en) Partitioning an image
CN104166715A (en) Vxworks platform electronic chart engine
CN104036535A (en) Quick sorting method for vector in two-dimensional geographic information system
Adreani et al. Implementing integrated digital twin modelling and representation into the Snap4City platform for smart city solutions
CN106157353A (en) A kind of word rendering intent and word rendering device
US9275481B2 (en) Viewport-based contrast adjustment for map features
US20220206676A1 (en) Modifying drawing characteristics of digital raster images utilizing stroke properties
Michaelsen On the automation of gestalt perception in remotely sensed data
JP2016532897A (en) Method and apparatus for building an intermediate character library
Luo et al. A multiprocess model of adaptable complexity for impervious surface detection

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140910