CN111931015B - Tolerance type line data query method based on geological settlement data - Google Patents

Tolerance type line data query method based on geological settlement data Download PDF

Info

Publication number
CN111931015B
CN111931015B CN202010804069.5A CN202010804069A CN111931015B CN 111931015 B CN111931015 B CN 111931015B CN 202010804069 A CN202010804069 A CN 202010804069A CN 111931015 B CN111931015 B CN 111931015B
Authority
CN
China
Prior art keywords
tolerance
point
points
starting point
data
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.)
Active
Application number
CN202010804069.5A
Other languages
Chinese (zh)
Other versions
CN111931015A (en
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202010804069.5A priority Critical patent/CN111931015B/en
Publication of CN111931015A publication Critical patent/CN111931015A/en
Application granted granted Critical
Publication of CN111931015B publication Critical patent/CN111931015B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists

Abstract

The invention relates to the technical field of information, provides a tolerance type line data query method based on geological settlement data, and aims to solve the problem that data cannot be acquired because data on a query line provided by a geoserver official party is always null. The main scheme comprises the following steps: setting a tolerance value according to the error range; step 2: acquiring a line segment, and carrying out tolerance processing on a starting point and an end point of the line segment, wherein the starting point and the end point contain longitude and latitude information, so as to obtain a rectangle consisting of 2 starting point tolerance points and 2 end point tolerance points; and step 3: picking up data of points in the rectangle through a Filter; and 4, step 4: and dividing the line segments according to preset value lengths, and forming a json array by using data of each divided segment.

Description

Tolerance type line data query method based on geological settlement data
Technical Field
The invention relates to the technical field of information, and provides a tolerance type line data query method based on geological settlement data.
Background
GeoServer is implemented by J2EE specified by OpenGIS Web server, map data can be conveniently released by utilizing GeoServer, users are allowed to update, delete and insert characteristic data, and spatial geographic information can be easily and rapidly shared among users by GeoServer.
Drawing a plurality of line segments connected end to end on a layer which is issued by geoserver and contains geological settlement data acquired by insar, and obtaining points on the line segments so as to perform next visualization analysis. For acquiring points on a line segment, the geoserver provides a getFeature operation. And determining longitude and latitude coordinates of a starting point and a terminating point, and writing a Filter for inquiring data. After many experiments, the data on the query line provided by the geoserver official is always empty due to data problems. However, in the polygon query provided by geoserver, a closed polygon is drawn on a data layer and is intersected with the data layer, the longitude and latitude coordinates of each point of the enclosed closed graph are determined (the longitude and latitude coordinates of a starting point are the same as those of a terminating point), and a corresponding Filter is programmed, so that data of the points in the polygon can be picked up. A method is then proposed for performing a polygon lookup by converting line segments into polygons in a tolerance manner.
Disclosure of Invention
The method comprises the steps that the geoserver official provides data which can be used for inquiring and obtaining points passed by line segments, then the data on the inquiry line provided by the geoserver official is always empty, and the data cannot be obtained.
In order to solve the technical problems, the invention adopts the following technical scheme:
a capacity difference type line data query method based on geological settlement data is characterized by comprising the following steps:
step 1: setting a tolerance value according to the error range;
step 2: acquiring a line segment, and carrying out tolerance processing on a starting point and an end point of the line segment, wherein the starting point and the end point contain longitude and latitude information, so as to obtain a rectangle consisting of 2 starting point tolerance points and 2 end point tolerance points;
and step 3: picking up data of points in the rectangle through a Filter;
and 4, step 4: and dividing the line segments according to preset value lengths, and forming a json array by using data of each divided segment.
In the above technical solution, step 2 specifically includes the following steps:
the tolerance processing of the starting point and the end point of the line segment, which contain the latitude and longitude information, comprises the following steps:
step 1: judging whether the longitude and latitude of the two end points of the line segment are the same,
if the same phase latitude and longitude are the same, performing the step 2, and if the same phase latitude and longitude are different, performing the step 3; if the latitude is different, the step 4 is carried out;
step 2: the starting point and the ending point are the same point, a straight line cannot be formed, and error information is returned;
and step 3: comparing the longitudes, selecting a point with small longitude as a starting point and a point with large longitude as a termination point, subtracting tolerance from the longitude of the starting point, sequentially adding and subtracting the tolerance to the latitude to obtain 2 tolerance points of the starting point, adding tolerance to the longitude of the termination point, sequentially adding and subtracting the tolerance to the latitude to obtain 2 tolerance points of the termination point, and splicing the 2 tolerance points of the starting point to the 2 tolerance points of the termination point into a rectangle;
and 4, step 4: comparing the latitudes of the two points, selecting a point with a small latitude as a starting point, selecting a point with a large latitude as a termination point, subtracting the tolerance from the latitude of the starting point, obtaining 2 tolerance points of the starting point by adding and subtracting the tolerance from the longitude of the starting point, then adding the tolerance to the latitude of the termination point, obtaining 2 tolerance points of the termination point by adding and subtracting the tolerance from the longitude of the termination point, and splicing the 2 tolerance points of the starting point and the 2 tolerance points of the termination point into a rectangle.
In the above technical solution, the step 3 includes calculating the total length of all end-to-end line segments, segmenting according to a preset value, dividing the total length of the line segments by the preset value to obtain a coefficient a, then calculating the total number of data of points on the line outgoing segment, multiplying the total number of data by the coefficient a to obtain a segmentation index, and then taking out the data points on the line segments according to the segmentation index.
Because the invention adopts the technical scheme, the invention has the following beneficial effects:
1. the geoserver official provides data that can be queried to obtain points through which line segments pass, but does not work well for all data layers.
2. According to the size of the line segment on the actual highway, the segmentation point is set to segment data on the line segment, and visual display and analysis are facilitated.
Drawings
FIG. 1 is a data layer published by a geoserver;
FIG. 2 is a diagram illustrating the definition of a constant allowance as a tolerance;
FIG. 3 is a schematic diagram of coordinates of an intercept start point and an intercept end point;
FIG. 4 is a tolerance result for the same latitude;
FIG. 5 is a polygonal area formed by two tolerance points;
FIG. 6 is a polygonal area formed by four tolerance points;
FIG. 7 is a code for forming polygons based on tolerance points;
FIG. 8 is a code for forming polygons based on tolerance points;
fig. 9 is an effect display diagram.
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 detailed description and specific examples, while indicating the preferred embodiment of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The invention provides a capacity difference type line data query method based on geological settlement data, which comprises the following steps:
setting an error range with an acceptable tolerance size;
converting the line segment into a polygon;
segmenting the data according to the actual kilometers on the map layer, such as segmenting the data every 1 kilometer, and extracting the data to form a JSON array
The project release data is shown in fig. 1.
After comparing the longitude and latitude coordinates of each point for many times, the points which are approximately similar are found to be different from the fifth decimal place behind the decimal point, thus the position difference of the points in the same area depends on the fifth decimal place behind the decimal point, therefore, the fifth decimal place behind the decimal point is determined to be subjected to tolerance, namely the tolerance is determined to be 0.00001, required data can be inquired under the tolerance, the error can be reduced to a great degree, and the points which are not required are not counted in the result.
A constant allowance is defined as a tolerance, as in fig. 2.
The coordinates of the start point and the end point are intercepted, and the fifth decimal after the decimal point is intercepted, where the start point and the end point are replaced by leafpoint and rightPoint, as shown in fig. 3.
Setting a tolerance variable starts to carry out tolerance on the starting point and the ending point in two cases.
One, two points of the same latitude
Firstly, judging whether the longitudes of two points are the same, if so, the starting point and the ending point are the same point, a straight line cannot be formed, and returning error information: the coordinates of the two points are completely consistent and cannot form a straight line.
And if the longitudes of the two points are different, comparing the latitudes, selecting a point with small longitude as a starting point and a point with large longitude as a termination point, subtracting the tolerance from the longitude of the starting point, sequentially adding or subtracting the tolerance to the latitude to obtain two tolerance points of the starting point, and sequentially adding or subtracting the tolerance to the longitude of the termination point to obtain two tolerance points of the termination point. Finally, the results are spliced as shown in fig. 4.
Two points of latitude are different
Comparing the latitudes of the two points when the latitudes of the two points are different, selecting a point with a small latitude as a starting point, selecting a point with a large latitude as an end point, subtracting the tolerance from the latitude of the starting point, adding or subtracting the tolerance to the longitude of the starting point to obtain two tolerance points of the starting point, adding the tolerance to the latitude of the end point, adding or subtracting the tolerance to the longitude of the end point to obtain query data, and splicing.
Note: because errors occur when the double-type data is subjected to addition and subtraction, the double-type data is converted into BigDecimal firstly and then subjected to addition and subtraction.
Tolerance setting
Considering that a line query must have an initial point and an end point that are not the same point, determining to tolerance the two points to obtain another two points may make the four points form a rectangle as shown in fig. 5, and if the tolerance is set within an acceptable error range, all the queried points in the rectangle may be considered as points where the initial point and the end point pass through.
However, after many test experiments, it is concluded that the filter polygon query provided by geoserver does not include the point of the boundary into the query result, i.e., the point on the line connecting the start point and the end point is not included into the query result, and further adjustment is performed according to the result.
The tolerance of the starting point and the ending point is obtained to obtain four points, so that the starting point and the ending point are contained in a rectangle as shown in fig. 6, and the inquired point in the rectangular graph can be considered as the point passed by the starting point and the ending point within the acceptable tolerance of the set error.
And calculating the total length of all the line segments connected end to end, and segmenting the line segments according to a certain numerical value, wherein the total length of the line segments is 10000 meters, and the line segments are segmented according to the length of every 500 meters. Dividing the value by 10000 by 500 to obtain a coefficient of 0.05, calculating the total number of data of points on the outgoing line segment, multiplying the total number by the coefficient to obtain a division index, and taking out data points on the line segment according to the division index.

Claims (1)

1. A capacity difference type line data query method based on geological settlement data is characterized by comprising the following steps:
step 1: setting a tolerance value according to the error range;
step 2: drawing a plurality of line segments connected end to end on a map layer which is issued by geoserver and contains geological settlement data collected by insar, and carrying out tolerance processing on a starting point and an end point of the line segment, which contain longitude and latitude information, so as to obtain a rectangle consisting of 2 starting point tolerance points and 2 end point tolerance points;
and step 3: acquiring data which is penetrated by a starting point and an end point in a rectangle through a Filter;
and 4, step 4: segmenting the line segments according to preset value lengths, and forming a json array by data of each segmented segment;
the step 2 specifically comprises the following steps:
the tolerance processing of the starting point and the end point of the line segment, which contain the latitude and longitude information, comprises the following steps:
step 2.1: judging whether the longitude and latitude of the two end points of the line segment are the same,
if the latitude is the same, the longitude is the same, then step 2.2 is carried out, if the latitude is the same, the longitude is different, then step 2.3 is carried out; if the latitudes are different, performing step 2.4;
step 2.2: the starting point and the ending point are the same point, a straight line cannot be formed, and error information is returned;
step 2.3: comparing the longitudes, selecting a point with small longitude as a starting point and a point with large longitude as a termination point, subtracting tolerance from the longitude of the starting point, sequentially adding and subtracting the tolerance to the latitude to obtain 2 tolerance points of the starting point, adding tolerance to the longitude of the termination point, sequentially adding and subtracting the tolerance to the latitude to obtain 2 tolerance points of the termination point, and splicing the 2 tolerance points of the starting point to the 2 tolerance points of the termination point into a rectangle;
step 2.4: comparing the latitudes of the two points, selecting a point with a small latitude as a starting point, taking a point with a large latitude as an end point, subtracting the latitude of the starting point by a tolerance from the latitude of the starting point, obtaining 2 tolerance points of the starting point by adding and subtracting the tolerance from the longitude of the starting point, then adding the tolerance to the latitude of the end point, obtaining 2 tolerance points of the end point by adding and subtracting the tolerance from the longitude of the end point, and splicing the 2 tolerance points of the starting point and the 2 tolerance points of the end point into a rectangle;
and step 4, calculating the total length of all the line segments connected end to end, segmenting according to a preset value, dividing the total length of the line segments by the preset value to obtain a coefficient a, then calculating the total number of data of points on the line segments, multiplying the total number of the data by the coefficient a to obtain a segmentation index, and then taking out data points on the line segments according to the segmentation index.
CN202010804069.5A 2020-08-11 2020-08-11 Tolerance type line data query method based on geological settlement data Active CN111931015B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010804069.5A CN111931015B (en) 2020-08-11 2020-08-11 Tolerance type line data query method based on geological settlement data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010804069.5A CN111931015B (en) 2020-08-11 2020-08-11 Tolerance type line data query method based on geological settlement data

Publications (2)

Publication Number Publication Date
CN111931015A CN111931015A (en) 2020-11-13
CN111931015B true CN111931015B (en) 2022-04-26

Family

ID=73312142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010804069.5A Active CN111931015B (en) 2020-08-11 2020-08-11 Tolerance type line data query method based on geological settlement data

Country Status (1)

Country Link
CN (1) CN111931015B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5546572A (en) * 1991-08-28 1996-08-13 Hitachi, Ltd. Method for retrieving database of image information
CN101458678A (en) * 2007-12-14 2009-06-17 中国科学院计算技术研究所 Dynamic tolerance setup method based on scan line arithmetic
CN103473268A (en) * 2013-08-15 2013-12-25 北京恒达时讯科技开发有限责任公司 Linear element spatial index construction method and system and retrieval method and system thereof
CN107766433A (en) * 2017-09-19 2018-03-06 昆明理工大学 A kind of range query method and device based on Geo BTree
CN107798054A (en) * 2017-09-04 2018-03-13 昆明理工大学 A kind of range query method and device based on Trie

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5546572A (en) * 1991-08-28 1996-08-13 Hitachi, Ltd. Method for retrieving database of image information
CN101458678A (en) * 2007-12-14 2009-06-17 中国科学院计算技术研究所 Dynamic tolerance setup method based on scan line arithmetic
CN103473268A (en) * 2013-08-15 2013-12-25 北京恒达时讯科技开发有限责任公司 Linear element spatial index construction method and system and retrieval method and system thereof
CN107798054A (en) * 2017-09-04 2018-03-13 昆明理工大学 A kind of range query method and device based on Trie
CN107766433A (en) * 2017-09-19 2018-03-06 昆明理工大学 A kind of range query method and device based on Geo BTree

Also Published As

Publication number Publication date
CN111931015A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
US9546872B1 (en) Hybrid road network and grid based spatial-temporal indexing under missing road links
CN112233240B (en) Three-dimensional vector data slicing method and device of three-dimensional vector map and electronic equipment
CN111078818B (en) Address analysis method and device, electronic equipment and storage medium
CN108153979B (en) Deformation information extraction method based on InSAR, terminal and storage medium
CN111723959B (en) Region dividing method and device, storage medium and electronic device
CN105868297A (en) Online map based remote sensing interpretation sample calling method, apparatus and system
CN104850649A (en) Method and system for sampling points of interest on map
CN110517154A (en) Data model training method, system and computer equipment
CN104063421B (en) Magnanimity traffic remotely-sensed data search method and device
CN108230001A (en) The method, apparatus and system of extending user
CN103324749A (en) Spatial analysis and correction method based on standard text addresses
CN114070760B (en) Mapping method and related device for network space asset
JP2008089815A (en) Area information provision method
CN111931015B (en) Tolerance type line data query method based on geological settlement data
CN110309166B (en) Traceable geographic elevation data completion method
CN110309237A (en) A kind of method and apparatus updating map
CN113159457A (en) Intelligent path planning method and system and electronic equipment
CN116049576B (en) Aggregation display method and device for map data and electronic equipment
CN107801418B (en) Floating population estimation device and method using map search record
CN114612034A (en) Warehouse determination method, device and equipment
CN115980847A (en) Gas content prediction method and device, computer equipment and storage medium
CN109241368B (en) Mass POI data storage method
CN113838078A (en) Coal mining subsidence ground crack identification and extraction method, device and storage medium
CN112419058A (en) Data management method and device, storage medium and electronic equipment
CN105975634A (en) Method for storing multi-dimensional ordered data in distributed data storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant