CN104851096A - Method for rapidly judging position relation between point and polygon in GIS application - Google Patents

Method for rapidly judging position relation between point and polygon in GIS application Download PDF

Info

Publication number
CN104851096A
CN104851096A CN201510255047.7A CN201510255047A CN104851096A CN 104851096 A CN104851096 A CN 104851096A CN 201510255047 A CN201510255047 A CN 201510255047A CN 104851096 A CN104851096 A CN 104851096A
Authority
CN
China
Prior art keywords
point
rotation angle
polygon
polygonal
position relation
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
CN201510255047.7A
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.)
Inspur Communication Information System Co Ltd
Original Assignee
Inspur Communication Information System 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 Inspur Communication Information System Co Ltd filed Critical Inspur Communication Information System Co Ltd
Priority to CN201510255047.7A priority Critical patent/CN104851096A/en
Publication of CN104851096A publication Critical patent/CN104851096A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for rapidly judging the position relation between points and polygons in GIS application, which comprises the following concrete implementation processes: acquiring all points to be judged; solving a minimum bounding rectangle of the polygon; screening all points to be judged out of the polygonal minimum bounding rectangle in batch; and judging the points in or on the minimum bounding rectangle of the polygon one by adopting a look-around method until all the points are judged. Compared with the prior art, the method for rapidly judging the position relation between the point and the polygon in the GIS application can rapidly filter out points which are not in the polygon, reduces the range of the points to be judged, greatly reduces the calculation time, avoids the complex processing of the traditional ray method on the boundary condition, and is strong in practicability and easy to popularize.

Description

A kind of method of quick decision-point and Polygon position relation in GIS application
Technical field
The present invention relates in Distribution GIS application, identify fast the computing method of map enclosing the network element entity in the arbitrary polygon of choosing, specifically a kind of method of decision-point and Polygon position relation fast in practical, GIS application.
Background technology
In GIS application, the geographic distribution situation of mobile communication equipment network element (such as base station, community etc.) can be checked intuitively.When occurring that certain region speech quality difference causes alarm or fault, service engineer can navigate to this region on GIS, a polygonal region is selected in doubling-up, and then by gathering the community index in this region, association analysis, finally navigate to community and the failure cause of concrete fault.This is that operator is concerned about and urgent use scenes very much.And to solve this kind of problem most basic be exactly want judging point and polygonal position relationship.If the community in polygon accurately and fast can not be identified, service engineer's localizing faults will be affected and even do the decision-making made mistake.The built-in function PtInRegion of the Visual C++ that Microsoft company provides can roughly realize this function, but PtInRegion not always reliably returns correct result, particularly when the point that will judge is positioned at polygonal border.Rays method in computational geometry, namely from treating that judging point sends a ray in the horizontal direction to the right, the number of times (parity) according to penetrating Intersecting of line and polygon judges, but it is difficult to process border, summit and the special circumstances such as border and ray conllinear.Based on this, a kind of method of quick decision-point and Polygon position relation in now providing GIS to apply.
Summary of the invention
Technical assignment of the present invention is for above weak point, provides the method for decision-point and Polygon position relation fast in a kind of practical, GIS application.
A method for quick decision-point and Polygon position relation in GIS application, its specific implementation process is:
Obtain the judging point that needs;
Ask for polygonal minimum area-encasing rectangle;
The judging point that needs outside the minimum area-encasing rectangle of polygon is fallen in batch screening;
Method of looking about is adopted to judge one by one the point within the minimum area-encasing rectangle of polygon or on limit, until all points all judge complete.
The acquisition process of described polygonal minimum area-encasing rectangle is:
According to polygonal all summits, calculate the minimum value of the minimum value of the horizontal coordinate of this polygon vertex, maximal value and longitudinal coordinate, maximal value, and by point (level minimums, longitudinal minimum value) and point (horizontal maximum, longitudinal maximal value) as the southwest corner of minimum area-encasing rectangle and northeast corner.
Described method of looking about judges to refer to that all rotation angle, relative to treating the directive rotation angle that judging point is formed, are then added judging points and polygonal relation by every two adjacent vertexs of acquisition counterclockwise.
Described directive rotation angle is calculated by inner product of vectors and Outer Product of Vectors.
The computation process of described rotation angle is: from any one summit polygonal, according to counterclockwise looking about one week, calculate in conjunction with inner product of vectors and Outer Product of Vectors and forward adjacent vertex b to relative to treating directive rotation angle formed by judging point p from initial vertex a, the like, until again go back to initial vertex a, statistics rotation angle sum, according to rotation angle sum judging point and polygonal relation.
Described rotation angle sum judging point and polygonal relation refer to: when rotation angle sum is 360 °, then put in polygon; When rotation angle sum is 0 °, then put outside polygon.
The detailed process that described rotation angle sum judges is:
By inner product of vectors be: , obtain the size of rotation angle θ; Pass through Outer Product of Vectors , obtain the direction of rotation angle θ; When time, point to be judged is positioned at polygonal inside; When time, then point to be judged is positioned at polygonal outside.
The method of quick decision-point and Polygon position relation in a kind of GIS application of the present invention, has the following advantages:
The method of decision-point and Polygon position relation fast in a kind of GIS application that the present invention proposes, can fast and accurately judging point and polygonal position relationship.Fall the point outside polygon by polygonal minimum area-encasing rectangle fast filtering, the position relationship of judging point and rectangle is very simply and fast; The method of looking about method judging point and Polygon position relation is very accurately and comprehensively, and without the need to doing too much complicated process to special circumstances such as border, summit, extended lines; Point not in polygon can be fallen by fast filtering, reduce the scope treating judging point, greatly reduce computing time, avoid the loaded down with trivial details process of traditional radiographic method for border condition, practical, be easy to promote.
Accompanying drawing explanation
Accompanying drawing 1 is processing flow chart of the present invention.
Accompanying drawing 2 is key diagrams of the minimum area-encasing rectangle of polygon.
Accompanying drawing 3 puts when polygonal internal with the key diagram of looking about method calculating rotation angle.
Accompanying drawing 4 puts when outside of polygon with the key diagram of looking about method calculating rotation angle.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
The invention provides a kind of GIS apply in the method for fast decision-point and Polygon position relation, by the minimum area-encasing rectangle of polygon, adopt and look about method and in conjunction with inner product of vectors, Outer Product of Vectors, fast also judging point and polygonal position relationship accurately.
As shown in Figure 1, its specific implementation process is,
Obtain the judging point that needs;
Ask for polygonal minimum area-encasing rectangle;
The judging point that needs outside the minimum area-encasing rectangle of polygon is fallen in batch screening;
Method of looking about is adopted to judge one by one the point within the minimum area-encasing rectangle of polygon or on limit, until all points all judge complete.
The acquisition process of described polygonal minimum area-encasing rectangle is:
According to polygonal all summits, calculate the minimum value of the minimum value of the horizontal coordinate of this polygon vertex, maximal value and longitudinal coordinate, maximal value, be designated as respectively , and by point (level minimums, longitudinal minimum value) and point (horizontal maximum, longitudinal maximal value), namely with as southwest corner and the northeast corner of minimum area-encasing rectangle.
If treat, judging point P point is outside minimum area-encasing rectangle, inevitable outside polygon; If treat, judging point P point is within minimum area-encasing rectangle or on limit, then need further judgement.This judgement adopts and looks about method.
Described method of looking about judges to refer to that all rotation angle, relative to treating the directive rotation angle that judging point is formed, are then added judging points and polygonal relation by every two adjacent vertexs of acquisition counterclockwise.
Described directive rotation angle is calculated by inner product of vectors and Outer Product of Vectors.
The computation process of described rotation angle is: from any one summit polygonal, according to counterclockwise looking about one week, calculate in conjunction with inner product of vectors and Outer Product of Vectors and forward adjacent vertex b to relative to treating directive rotation angle formed by judging point p from initial vertex a, the like, until again go back to initial vertex a, statistics rotation angle sum, according to rotation angle sum judging point and polygonal relation.
Described rotation angle sum judging point and polygonal relation refer to: when rotation angle sum is 360 °, then put in polygon; When rotation angle sum is 0 °, then put outside polygon.
The detailed process that described rotation angle sum judges is:
By inner product of vectors be: , obtain the size of rotation angle θ; Pass through Outer Product of Vectors , obtain the direction of rotation angle θ; When time, point to be judged is positioned at polygonal inside; When time, then point to be judged is positioned at polygonal outside.
In addition, also there are following several special circumstances: when being positioned on summit, vector field homoemorphism is 0; When to be positioned on a limit but be not summit time, inner product of vectors is-1; When on the extended line being positioned at a limit, inner product of vectors is 1.
Embodiment: time below to select the network element in certain geographic range with polygon circle in GIS map, be example with the network element in method identification polygon of the present invention.Network element on map has the Fundamental Geographic Information System of longitude, dimension, in the prerequisite of being undertaken judging by method of the present invention is, by Gauss projection coordinate conversion, latitude and longitude coordinates is converted to the coordinate of plane right-angle coordinate.Network element is used at the coordinate after Gauss projection coordinate conversion represent, as etc..
Accompanying drawing 2 pairs of minimum area-encasing rectangles of polygon are illustrated.Polygon vertex is numbered by anticlockwise order, obtains polygon vertex sequence: .Calculate the minimum value of X-coordinate in polygon vertex coordinate sequence , X-coordinate maximal value , Y-coordinate minimum value , Y-coordinate maximal value , obtain a little and point , using its southwest corner as the minimum area-encasing rectangle of polygon and northeast corner.
Fall with the mode fast filtering of batch processing and treat judging point outside the minimum area-encasing rectangle of polygon, namely X-coordinate is less than or X-coordinate is greater than , or Y-coordinate is less than or Y-coordinate is greater than point.
For the point within the minimum area-encasing rectangle of polygon or on limit, method of looking about is adopted to judge one by one.
Accompanying drawing 3 describes when calculating the explanation of rotation angle with looking about method when judging point is positioned at polygonal internal.Summit B is forwarded counterclockwise to, relative to treating that formed by judging point P, rotation angle is from summit A ; Summit C is forwarded counterclockwise to, relative to treating that formed by judging point P, rotation angle is from summit B ; The like, until ought again rotate back into summit A.Being rotated counterclockwise the rotation angle sum obtained for a week is 360 °.
Accompanying drawing 4 describes when calculating the explanation of rotation angle with looking about method when judging point is positioned at outside of polygon.Summit B is forwarded counterclockwise to, relative to treating that formed by judging point P, rotation angle is from summit A ; Summit C is forwarded counterclockwise to, relative to treating that formed by judging point P, rotation angle is from summit B ; The like, until ought again rotate back into summit A.But it should be noted that forward summit D to relative to treating that formed by judging point P, rotation angle is negative from summit C.When again rotating back into summit A, the rotation angle sum of all forwards is offset with the rotation angle forwarding the negative sense of summit D from summit C to.Therefore, being rotated counterclockwise the rotation angle sum obtained for a week is 0 °.
Pass through inner product of vectors calculate angle theta formed by two vectors, scope exists , the angle calculated is nondirectional.Then Outer Product of Vectors is passed through calculate the direction of angle theta, namely positive and negative.Sum Outer Product of Vectors in resultant vector, obtains being rotated counterclockwise a B relative to directive rotation angle formed by a P from an A.
Above-mentioned embodiment is only concrete case of the present invention; scope of patent protection of the present invention includes but not limited to above-mentioned embodiment; in any a kind of GIS application according to the invention fast the method for decision-point and Polygon position relation claims and the those of ordinary skill of any described technical field to its suitable change done or replacement, all should fall into scope of patent protection of the present invention.

Claims (9)

1. a method for GIS quick decision-point and Polygon position relation in applying, it is characterized in that, its specific implementation process is:
Obtain the judging point that needs;
Ask for polygonal minimum area-encasing rectangle;
The judging point that needs outside the minimum area-encasing rectangle of polygon is fallen in batch screening;
Method of looking about is adopted to judge one by one the point within the minimum area-encasing rectangle of polygon or on limit, until all points all judge complete.
2. the method for a kind of GIS according to claim 1 quick decision-point and Polygon position relation in applying, it is characterized in that, the acquisition process of described polygonal minimum area-encasing rectangle is:
According to polygonal all summits, calculate the minimum value of the minimum value of the horizontal coordinate of this polygon vertex, maximal value and longitudinal coordinate, maximal value, and by point (level minimums, longitudinal minimum value) and point (horizontal maximum, longitudinal maximal value) as the southwest corner of minimum area-encasing rectangle and northeast corner.
3. the method for a kind of GIS according to claim 1 and 2 quick decision-point and Polygon position relation in applying, it is characterized in that, described method of looking about judges to refer to that all rotation angle, relative to treating the directive rotation angle that judging point is formed, are then added judging points and polygonal relation by every two adjacent vertexs of acquisition counterclockwise.
4. the method for a kind of GIS according to claim 3 quick decision-point and Polygon position relation in applying, it is characterized in that, described directive rotation angle is calculated by inner product of vectors and Outer Product of Vectors.
5. the method for a kind of GIS according to claim 4 quick decision-point and Polygon position relation in applying, it is characterized in that, the computation process of described rotation angle is: from any one summit polygonal, according to counterclockwise looking about one week, calculate in conjunction with inner product of vectors and Outer Product of Vectors and forward adjacent vertex b to relative to treating directive rotation angle formed by judging point p from initial vertex a, the like, until again go back to initial vertex a, statistics rotation angle sum, according to rotation angle sum judging point and polygonal relation.
6. the method for a kind of GIS according to claim 3 quick decision-point and Polygon position relation in applying, it is characterized in that, described rotation angle sum judging point and polygonal relation refer to: when rotation angle sum is 360 °, then put in polygon; When rotation angle sum is 0 °, then put outside polygon.
7. the method for a kind of GIS according to claim 6 quick decision-point and Polygon position relation in applying, it is characterized in that, the detailed process that described rotation angle sum judges is:
By inner product of vectors be: , obtain the size of rotation angle θ; Pass through Outer Product of Vectors , obtain the direction of rotation angle θ; When time, point to be judged is positioned at polygonal inside; When time, then point to be judged is positioned at polygonal outside.
8. the method for a kind of GIS according to claim 5 quick decision-point and Polygon position relation in applying, it is characterized in that, described rotation angle sum judging point and polygonal relation refer to: when rotation angle sum is 360 °, then put in polygon; When rotation angle sum is 0 °, then put outside polygon.
9. the method for a kind of GIS according to claim 8 quick decision-point and Polygon position relation in applying, it is characterized in that, the detailed process that described rotation angle sum judges is:
By inner product of vectors be: , obtain the size of rotation angle θ; Pass through Outer Product of Vectors , obtain the direction of rotation angle θ; When time, point to be judged is positioned at polygonal inside; When time, then point to be judged is positioned at polygonal outside.
CN201510255047.7A 2015-05-19 2015-05-19 Method for rapidly judging position relation between point and polygon in GIS application Pending CN104851096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510255047.7A CN104851096A (en) 2015-05-19 2015-05-19 Method for rapidly judging position relation between point and polygon in GIS application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510255047.7A CN104851096A (en) 2015-05-19 2015-05-19 Method for rapidly judging position relation between point and polygon in GIS application

Publications (1)

Publication Number Publication Date
CN104851096A true CN104851096A (en) 2015-08-19

Family

ID=53850723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510255047.7A Pending CN104851096A (en) 2015-05-19 2015-05-19 Method for rapidly judging position relation between point and polygon in GIS application

Country Status (1)

Country Link
CN (1) CN104851096A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105869188A (en) * 2016-04-22 2016-08-17 广州日滨科技发展有限公司 Detection method and system for point to polygon position relation
CN106982439A (en) * 2017-03-28 2017-07-25 中国地质大学(武汉) One kind seeks poor confirmation method for many satellite sensor earth observation overlay areas
WO2020019509A1 (en) * 2018-07-26 2020-01-30 平安科技(深圳)有限公司 Method and device for positioning and detecting robot, and computer-readable storage medium
CN112509031A (en) * 2020-12-02 2021-03-16 湖北工业大学 Position judging method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102213767A (en) * 2011-04-08 2011-10-12 浙江工业大学 Positioning control method for closed region of vehicle-mounted GPS (Global Positioning System)
CN102360509A (en) * 2011-10-19 2012-02-22 浙江大学 Method for judging space position relation of point and polygon by using maximum slope ray algorithm

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102213767A (en) * 2011-04-08 2011-10-12 浙江工业大学 Positioning control method for closed region of vehicle-mounted GPS (Global Positioning System)
CN102360509A (en) * 2011-10-19 2012-02-22 浙江大学 Method for judging space position relation of point and polygon by using maximum slope ray algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘汝佳 黄亮: "《算法艺术与信息学竞赛》", 31 January 2004 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105869188A (en) * 2016-04-22 2016-08-17 广州日滨科技发展有限公司 Detection method and system for point to polygon position relation
CN106982439A (en) * 2017-03-28 2017-07-25 中国地质大学(武汉) One kind seeks poor confirmation method for many satellite sensor earth observation overlay areas
WO2020019509A1 (en) * 2018-07-26 2020-01-30 平安科技(深圳)有限公司 Method and device for positioning and detecting robot, and computer-readable storage medium
CN112509031A (en) * 2020-12-02 2021-03-16 湖北工业大学 Position judging method
CN112509031B (en) * 2020-12-02 2022-08-16 湖北工业大学 Position judging method

Similar Documents

Publication Publication Date Title
US10943364B2 (en) Method and device for determining areas of interest based on geolocation data
US8046168B2 (en) System and method for determining position within or without a complex polygon geofence
CN105334522B (en) The detection method and device of GPS attacks
CN104851096A (en) Method for rapidly judging position relation between point and polygon in GIS application
US10318819B2 (en) Camera surveillance planning and tracking system
US11842516B2 (en) Homography through satellite image matching
US10659916B2 (en) Retrospective path analysis
JP2017015585A (en) Navigation signal processing device, navigation signal processing method and navigation signal processing program
CN108924544A (en) Camera distortion measurement method and test device
CN112422653A (en) Scene information pushing method, system, storage medium and equipment based on location service
WO2020019509A1 (en) Method and device for positioning and detecting robot, and computer-readable storage medium
CN105992239B (en) A kind of method, apparatus and equipment of real-time positioning pseudo-base station
CN104050869B (en) GIS map covering is layouted response method and system
WO2020019512A1 (en) Robot positioning detection method and apparatus and computer readable storage medium
CN108763248B (en) Water area space monitoring fine division method and system
CN107247280B (en) Positioning authentication and processing method and device
CN115797579A (en) Image superposition method and device for three-dimensional map, electronic equipment and storage medium
CN113566847B (en) Navigation calibration method and device, electronic equipment and computer readable medium
EP3327481B1 (en) Method for modelling an imaging device, corresponding computer program product and computer-readable carrier medium
KR101459004B1 (en) Method for converting 3D Image based plan to 3D Image based spherical surface
CN106525070B (en) A kind of detection method and system of motion state of automobile
KR20190088745A (en) A method of displaying the position of a foreign object in the runway with GPS coordinates in an airport grid map
Kozmin et al. Comparison of spectrum monitoring coverage features of AOA and TDOA geolocation methods–
CN104502937B (en) Terminal positioning method and device
CN117809446A (en) Parking area processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150819

WD01 Invention patent application deemed withdrawn after publication