Spatial data relationship checking method and system

By converting the geographical coordinate system into a projected coordinate system and using a plane geometry algorithm, the difficulty of determining the data relationship between points, lines and surfaces in GIS surveying and mapping is solved, and efficient spatial data relationship verification is achieved.

CN120386825APending Publication Date: 2025-07-29INSPUR SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510429919.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

In GIS surveying and mapping, it is difficult to directly determine the relative relationship between points, lines, surfaces and other data under the geographical coordinate system, and it is difficult to efficiently verify spatial data relationships.

Method used

Convert the geographical coordinate system to a projected coordinate system, and use the plane geometry algorithm to calculate the intersection, inclusion and points of polygons in the plane through the ray method, the enumeration intersection method and the sequence intersection method, including the ray method to determine the intersection point within the polygon, and the enumeration intersection method to determine the intersection of polygons and the sequence intersection method to cut the abnormal area.

Benefits of technology

Through projection coordinate conversion, the algorithm difficulty of determining spatial geometric relationships is reduced, and the judgment efficiency and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386825A_ABST
    Figure CN120386825A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of GIS, and particularly provides a spatial data relation checking method and system.The method comprises the steps that firstly, a geographic coordinate system is converted into a projection coordinate system, a plane geometry algorithm is used for calculating whether two polygons intersect or not, whether the two polygons are included or not and whether points are in a plane or not, and the method specifically comprises the steps that S1, whether coordinate points are in the polygon plane or not is judged; s2, judging whether the two polygonal surfaces are intersected or not; and S3, judging whether the two polygons have an inclusion relation or not. Compared with the prior art, coordinate conversion can be carried out in a projection mode, the difficulty of a space geometric figure relation judgment algorithm is reduced, and the judgment efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of GIS technology, and specifically provides a spatial data relationship verification method and system. Background Art

[0002] In GIS surveying and mapping, we often encounter two coordinate systems: geographic coordinate system and projected coordinate system.

[0003] A geographic coordinate system uses a three-dimensional spherical surface to define locations on the Earth's surface, enabling reference to points on the Earth's surface using longitude and latitude. A geographic coordinate system consists of three components: angular units of measurement, the prime meridian, and a reference ellipsoid. In a spherical system, horizontal lines are lines of equal latitude or latitude. Vertical lines are lines of equal longitude or longitude. Commonly used geographic coordinate systems include WGS-84, CGCS2000, and JCG02.

[0004] A projected coordinate system converts the longitude and latitude grid on the Earth's ellipsoid to a plane using certain mathematical rules. This establishes a one-to-one functional relationship between the geographic coordinates (φ, λ) of a ground point and the plane rectangular coordinates (x, y) or plane polar coordinates (δ, ρ) of the corresponding point on the map. This allows for a scientific transformation from the Earth's ellipsoid to the map plane. Commonly used projections include the Gauss-Krüger, Lambert, and Mercator projections.

[0005] In surveying and mapping, GIS equipment can be used to obtain data such as points, lines, and surfaces represented by geographic coordinates. In actual business operations, it is necessary to determine the relative relationships between these data. Directly determining the relative relationships between points, lines, and surfaces in a geographic coordinate system is difficult. Summary of the invention

[0006] The present invention aims to address the deficiencies of the above-mentioned prior art and provides a highly practical method for verifying spatial data relationships.

[0007] A further technical task of the present invention is to provide a spatial data relationship verification system that is rationally designed, safe and applicable.

[0008] The technical solution adopted by the present invention to solve its technical problem is:

[0009] A spatial data relationship verification method first converts the geographic coordinate system into a projected coordinate system, and then uses a plane geometry algorithm to calculate whether two polygons intersect, whether two polygons are contained, and whether a point is within a polygon. Specifically, the method includes:

[0010] S1, whether the coordinate point is within the polygon;

[0011] S2, whether the two polygonal faces intersect;

[0012] S3. Determine whether there is an inclusion relationship between the two polygons.

[0013] Further, in step S1, the ray method is used to determine whether a point is within a region. When a ray passes through the boundary of the region, there are only two cases:

[0014] One is entering and the other is exiting. For a ray, as long as it enters once, it must correspond to an exit once.

[0015] Further, when a point is outside the region, the ray made will definitely enter when passing through the region boundary. One entry corresponds to one exit, so the final number of crossings must be an even number;

[0016] When the point is within the region, the first crossing of the boundary must be an exit. If it enters the next time, it will correspond to another exit. Therefore, the points within the region will have an additional single exit, and the total number of final crossings is an odd number.

[0017] Further, in step S2, the method of enumerating intersection points is used to determine whether two rectangles intersect and calculate the intersection point coordinates as follows:

[0018] S2-1. Arrange the ordered vertex coordinates of the two irregular polygons pairwise in order to obtain the vertex ranges of each side of the two polygons;

[0019] S2-2. Substitute the vertex coordinates of each side into the general form of the binary linear equation, calculate the values of A, B, C, and D through the vertex coordinates, and traverse the general forms of each side to judge the parallel situation through the D value to exclude the co-segment or parallel anomaly;

[0020] S2-3. Combine the sides of the two rectangles pairwise, calculate the intersection points of each side, and use the coordinates of the four vertices of the two sides as the intersection extreme values to judge whether the intersection points exist within the vertex ranges of the two sides;

[0021] S2-4. Adopt the method of range expansion for correction to obtain the real intersection point situation.

[0022] Further, in step S3, in the way of sequence intersection, judge the abnormal region and perform clipping through the intersection points of the abnormal points and the rectangle as follows:

[0023] S3-1. Integrate the vertex set of the two rectangle regions, the abnormal vertex coordinate set, and the intersection point set, and judge the co-point situation in the set;

[0024] S3-2. Extract the set coordinates that are co-point and continuous in the vertex set and the abnormal vertex set to establish a pre-clipping set;

[0025] S3-3. Traverse the pre-clipping set, extract the starting and ending coordinates and judge the co-point situation with the rectangle intersection point set, and write the co-point intersection points into the pre-clipping set;

[0026] S3-4. Traverse the pre-clipping set, determine whether there are common intersection points or anti-intersection points at the start and end intersection points, and merge and write to the clipping set according to the judgment;

[0027] S3-5. Determine the accuracy of the clipping set according to the vertex coordinates and output it.

[0028] A spatial data relationship verification system. First, convert the geographic coordinate system to a projected coordinate system, and use plane geometry algorithms to calculate whether two polygons intersect, whether two polygons contain each other, and whether a point is within a face. Specifically, it includes:

[0029] (1). Whether the coordinate point is within the polygon face;

[0030] (2). Whether the two polygon faces intersect;

[0031] (3). Determine whether there is a containment relationship between two polygons

[0032] Furthermore, in step (1), the ray method is used to determine whether a point is within the region. When a ray passes through the boundary of the region, there are only two cases:

[0033] One is entering and the other is exiting. For the ray, as long as there is one entry, there must be one exit.

[0034] Furthermore, when a point is outside the region, the ray made will definitely enter when passing through the region boundary. One entry corresponds to one exit, so the final number of crossings must be even;

[0035] When the point is within the region, the first crossing of the boundary must be an exit. The next time if it enters, it will correspond to another exit. So the points within the region will have an extra single exit, and the final total number of crossings is odd.

[0036] Furthermore, in step (2), the enumeration intersection point method is used to determine whether two rectangles intersect and calculate the intersection point coordinates as follows:

[0037] (2-1). Arrange the ordered vertex coordinates of the two irregular polygons pairwise in order to obtain the vertex ranges of each side of the two polygons;

[0038] (2-2). Substitute the vertex coordinates of each side into the general form of the binary linear equation, calculate the values of A, B, C, and D through the vertex coordinates, and traverse the general form of each side to judge the parallel situation through the D value to exclude the co-segment or parallel anomaly;

[0039] (2-3). Combine the sides of the two rectangles pairwise, calculate the intersection points of each side, use the coordinates of the four vertices of the two sides as the extreme values of the intersection points, and judge whether the intersection points exist within the vertex ranges of the two sides;

[0040] (2-4) Modify by means of range expansion to obtain the true intersection situation.

[0041] Further, in step (3), in the way of sequence intersection, judge the abnormal area and perform clipping through the intersection points of the abnormal points and the rectangle, as follows:

[0042] (3-1) Integrate the vertex sets of the two rectangle areas, the abnormal vertex coordinate set, and the intersection point set, and judge the common point situation in the set;

[0043] (3-2) Extract the consecutive set coordinates that are common points in the vertex set and the abnormal vertex set, and establish a pre-clipping set;

[0044] (3-3) Traverse the pre-clipping set, extract the starting and ending coordinates and judge the common point situation with the rectangle intersection point set, and write the common intersection points into the pre-clipping set;

[0045] (3-4) Traverse the pre-clipping set, judge whether there are common intersection points or anti-intersection points at the starting and ending intersection points, and merge and write into the clipping set according to the judgment;

[0046] (3-5) Determine the accuracy of the clipping set according to the vertex coordinates and output.

[0047] Compared with the prior art, a method and system for verifying spatial data relationships of the present invention has the following outstanding beneficial effects:

[0048] The present invention uses a projection algorithm to convert the data represented in the geographic coordinate system obtained by surveying into data in the projected coordinate system, and uses plane geometry algorithms to determine the relationship between coordinate points and polygon surfaces, determine whether two polygon surfaces intersect, and determine whether there is an inclusion relationship between two polygons. Through coordinate conversion by projection, the difficulty of the spatial geometric relationship determination algorithm is reduced, and the efficiency of judgment is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Attached Figure 1 is a flowchart showing whether a coordinate point is inside a polygon surface in a method for verifying spatial data relationships;

[0051] Attached Figure 2 is a flowchart showing whether two polygon surfaces intersect in a method for verifying spatial data relationships;

[0052] AttachedFigure 3 It is a schematic flow diagram of whether two polygons have an inclusion relationship in a spatial data relationship verification method. Specific implementation manner

[0053] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with specific implementation manners. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present invention.

[0054] The following gives a best embodiment:

[0055] In a spatial data relationship verification method in this embodiment, first, the geographic coordinate system is converted into a projection coordinate system, and plane geometry algorithms are used to calculate whether two polygons intersect, whether two polygons contain each other, and whether a point is within a surface. Specifically, it includes:

[0056] S1. Whether the coordinate point is within the polygon surface;

[0057] As Figure 1 shown, there are only two situations when a ray passes through the boundary of a region:

[0058] One is entering and the other is exiting. For a ray, as long as there is one entry, there must be one corresponding exit.

[0059] Therefore, when a point is outside the region, the ray made will definitely enter when passing through the region boundary. One entry corresponds to one exit, so the final number of crossings must be even;

[0060] When the point is inside the region, the first crossing of the boundary must be an exit. If it enters the next time, there will be another corresponding exit. So the points inside the region will have an extra single exit. Therefore, the total number of final crossings is odd.

[0061] S2. Whether two polygon surfaces intersect;

[0062] As Figure 2 shown, the enumeration intersection point method is used to determine whether two rectangles intersect and calculate the intersection point coordinates as follows:

[0063] S2-1. Arrange the ordered vertex coordinates of two irregular polygons pairwise in sequence to obtain the vertex ranges of each side of the two polygons;

[0064] S2-2. Substitute the vertex coordinates of each side into the general form of the binary linear equation, calculate the values of A, B, C, and D through the vertex coordinates, and traverse the general forms of each side to judge the parallel situation through the D value, and exclude the co-segment or parallel anomaly;

[0065] S2-3. Combine two pairs of rectangle sides, calculate the intersection points of each pair of sides, use the coordinates of the four vertices of the two sides as the extreme values of the intersection points, and determine whether the intersection points exist within the range of the vertices of the two sides;

[0066] S2-4. To avoid the situation where two values are almost the same during floating-point operations, a method of range expansion is used for correction to obtain the actual intersection points.

[0067] This algorithm makes an assumption about the vertex set of the polygon, that is, they are ordered. If the vertex set is unordered, it needs to be sorted first.

[0068] S3. Determine whether there is an inclusion relationship between two polygons;

[0069] As Figure 3 shown, use the method of sequence intersection to judge the abnormal area and perform clipping through the intersection points of the abnormal points and the rectangle, as follows:

[0070] S3-1. Integrate the vertex sets of the two rectangle regions, the abnormal vertex coordinate set, and the intersection point set, and judge the co-point situation in the sets;

[0071] S3-2. Extract the co-point and continuous set coordinates in the vertex set and the abnormal vertex set, and establish a pre-clipping set;

[0072] S3-3. Traverse the pre-clipping set, extract the starting and ending coordinates and judge the co-point situation with the rectangle intersection point set, and write the co-point intersection points into the pre-clipping set;

[0073] S3-4. Traverse the pre-clipping set, judge whether there is a co-intersection point or anti-intersection point situation for the starting and ending intersection points, and merge and write into the clipping set according to the judgment;

[0074] S3-5. Determine the accuracy of the clipping set according to the vertex coordinates and output it.

[0075] Based on the above method, a spatial data relationship verification system in this embodiment first converts the geographic coordinate system into a projection coordinate system, and uses plane geometry algorithms to calculate whether two polygons intersect, whether two polygons contain each other, and whether a point is within a surface, specifically including:

[0076] (1). Whether a coordinate point is within a polygon surface;

[0077] (2). Whether two polygon surfaces intersect;

[0078] (3). Judge whether there is an inclusion relationship between two polygons

[0079] Among them, in step (1), the ray method is used to judge whether a point is within a region. When a ray passes through the boundary of a region, there are only two situations:

[0080] One is passing through and the other is passing out. For a ray, as long as it passes through once, it must correspond to a passing out once.

[0081] When a point is outside the region, the ray made will definitely pass through the region boundary by passing in. One passing in corresponds to one passing out, so the final number of crossings must be an even number;

[0082] When the point is inside the region, the first crossing of the boundary must be a passing out. The next time if it passes in, it will again correspond to a passing out. So the point inside the region will have an extra single passing out, and the final total number of crossings is an odd number.

[0083] In step (2), the method of enumerating intersection points is used to determine whether two rectangles intersect and calculate the intersection point coordinates as follows:

[0084] (2-1) Arrange the ordered vertex coordinates of the two irregular polygons pairwise in sequence to obtain the vertex ranges of each side of the two polygons;

[0085] (2-2) Substitute the vertex coordinates of each side into the general form of the binary linear equation, calculate the values of A, B, C, and D through the vertex coordinates, and traverse the general forms of each side to judge the parallel situation through the D value to exclude the cases of collinear segments or parallel anomalies;

[0086] (2-3) Combine the sides of the two rectangles pairwise, calculate the intersection points of each side, use the coordinates of the four vertices of the two sides as the extreme values of the intersection points, and judge whether the intersection points exist within the vertex ranges of the two sides;

[0087] (2-4) Make corrections by means of range expansion to obtain the true intersection point situation.

[0088] In step (3), in the way of sequence intersection, judge the abnormal region and perform clipping through the abnormal points and the rectangle intersection points as follows:

[0089] (3-1) Integrate the vertex set of the two rectangle regions, the abnormal vertex coordinate set, and the intersection point set, and judge the concurrent situation in the sets;

[0090] (3-2) Extract the set coordinates that are concurrent and continuous in the vertex set and the abnormal vertex set to establish a pre-clipping set;

[0091] (3-3) Traverse the pre-clipping set, extract the start and end coordinates and judge the concurrent situation with the rectangle intersection point set, and write the concurrent intersection points into the pre-clipping set;

[0092] (3-4) Traverse the pre-clipping set, judge whether there are concurrent intersection points or reverse intersection point situations at the start and end intersection points, and merge and write into the clipping set according to the judgment;

[0093] (3-5) Determine the accuracy of the clipping set according to the vertex coordinates and output it.

[0094] The above specific embodiments are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above specific embodiments. Any technical solution that conforms to the above specific embodiments described in the present invention and any appropriate changes or substitutions made by any person of ordinary skill in the art shall fall within the patent protection scope of the present invention.

[0095] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for verifying spatial data relationships, characterized in that, First, the geographic coordinate system is converted to a projected coordinate system. Using plane geometry algorithms, it is calculated whether two polygons intersect, whether two polygons contain each other, and whether a point is within a surface, specifically including: S1. Whether a coordinate point is within a polygon surface; S2. Whether two polygon surfaces intersect; S3. Determine whether there is a containment relationship between two polygons.

2. The spatial data relationship verification method according to claim 1, wherein In step S1, the ray method is used to determine whether a point is within a region. When a ray passes through the boundary of a region, there are only two cases: One is entering and the other is exiting. For a ray, as long as there is one entry, there must be a corresponding exit.

3. The spatial data relationship verification method according to claim 2, wherein When a point is outside the region, the ray made passes through the region boundary must be entering, and one entry corresponds to one exit, so the final number of crossings must be even; When the point is within the region, the first crossing of the boundary must be exiting. If it enters the next time, there will be a corresponding exit again. So, the point within the region will have an extra single exit, and the final total number of crossings is odd.

4. A method for verifying spatial data relationships according to claim 3, characterized in that, In step S2, the enumeration intersection point method is used to determine whether two rectangles intersect and calculate the intersection point coordinates, as follows: S2-1. Arrange the ordered vertex coordinates of two irregular polygons pairwise in order to obtain the vertex ranges of each side of the two polygons; S2-2. Substitute the vertex coordinates of each side into the general form of a binary linear equation, calculate the values of A, B, C, and D through the vertex coordinates, and traverse the general forms of each side to judge the parallel situation through the D value, excluding collinear segments or parallel anomalies; S2-3. Combine the sides of the two rectangles pairwise, calculate the intersection points of each side, and use the four vertex coordinates of the two sides as the extreme values of the intersection points to judge whether the intersection points exist within the vertex ranges of the two sides; S2-4. Adopt the method of range expansion for correction to obtain the true intersection point situation.

5. The spatial data relationship verification method according to claim 4, characterized in that In step S3, in the way of sequence intersection, the abnormal region is judged and trimmed through the abnormal points and the intersection points of the rectangles, as follows: S3-1. Integrate the vertex sets of the two rectangle regions, the abnormal vertex coordinate set, and the intersection point set, and judge the common point situation in the sets; S3-2. Extract the set coordinates that are common and continuous in the vertex set and the abnormal vertex set to establish a pre-trimming set; S3-3. Traverse the pre-trimming set, extract the starting and ending coordinates and judge the common point situation with the rectangle intersection point set, and write the common intersection points into the pre-trimming set; S3-4. Traverse the pre-trimming set, judge whether there are common intersection points or reverse intersection point situations for the starting and ending intersection points, and merge and write into the trimming set according to the judgment; S3-5. Determine the accuracy of the trimming set according to the vertex coordinates and output.

6. A spatial data relationship verification system, characterized in that, First, the geographic coordinate system is converted to a projected coordinate system. Using plane geometry algorithms, it is calculated whether two polygons intersect, whether two polygons contain each other, and whether a point is within a surface, specifically including: (1). Whether a coordinate point is within a polygon surface; (2). Whether two polygon surfaces intersect; (3). Determine whether there is a containment relationship between two polygons.

7. A spatial data relationship verification system according to claim 6, characterized in that, In step (1), the ray method is used to determine whether a point is within a region. When a ray passes through the boundary of a region, there are only two cases: One is entering and the other is exiting. For a ray, as long as there is one entry, there must be a corresponding exit.

8. A spatial data relationship verification system according to claim 7, characterized in that When a point is outside the region, the ray drawn will definitely penetrate the region boundary when passing through it. Each penetration corresponds to an emergence, so the final number of penetrations must be even. When the point is inside the region, the first penetration of the boundary must be an emergence. The next penetration, if any, will correspond to another emergence. So, for a point inside the region, there will be an extra single emergence, and the final total number of penetrations is odd.

9. The spatial data relationship verification system according to claim 8, wherein In step (2), the method of enumerating intersection points is used to determine whether two rectangles intersect and calculate the intersection point coordinates as follows: (2-1) Arrange the ordered vertex coordinates of the two irregular polygons pairwise in sequence to obtain the vertex ranges of each side of the two polygons. (2-2) Substitute the vertex coordinates into the general form of the binary linear equation to calculate the values of A, B, C, and D through the vertex coordinates. Traverse the general forms of each side and judge the parallel situation through the D value to exclude the abnormal situations of collinear segments or parallelism. (2-3) Combine the sides of the two rectangles pairwise to calculate the intersection points of each side. Use the coordinates of the four vertices of the two sides as the extreme values of the intersection points to judge whether the intersection points exist within the vertex ranges of the two sides. (2-4) Adopt the method of range expansion for correction to obtain the actual intersection point situation.

10. A spatial data relationship verification system according to claim 9, characterized in that, In step (3), the method of sequence intersection is used to judge the abnormal region and perform clipping through the abnormal points and the rectangle intersection points as follows: (3-1) Integrate the vertex set of the two rectangle regions, the abnormal vertex coordinate set, and the intersection point set, and judge the co-point situation in the sets. (3-2) Extract the consecutive set coordinates that are co-point in the vertex set and the abnormal vertex set to establish a pre-clipping set. (3-3) Traverse the pre-clipping set, extract the start and end coordinates and judge the co-point situation with the rectangle intersection point set, and write the co-point intersection points into the pre-clipping set. (3-4) Traverse the pre-clipping set, judge whether there are co-intersection points or anti-intersection points at the start and end intersection points, and merge and write into the clipping set according to the judgment. (3-5) Determine the accuracy of the clipping set according to the vertex coordinates and output it.