Lightweight data retrieval method based on space retrieval

By using a tool library to parse and process spatial data, feature source objects that intersect with or contain the spatial range are filtered out, solving the problem of low efficiency in spatial data retrieval in existing technologies and realizing efficient and flexible spatial data query.

CN120804076AActive Publication Date: 2025-10-17TAIHUA WISDOM IND GRP CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510904189.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-10-17
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

Existing spatial data retrieval methods suffer from low retrieval comprehensiveness, high time and labor costs, and significant differences in index structures among different databases, resulting in low query efficiency.

Method used

The dataset is loaded from the data management platform using a tool library, spatial elements are parsed into feature source objects, and spatial relationship operations are performed using the intersects() and contains() functions to filter out feature source objects that intersect or contain the spatial range. Combined with fuzzy matching algorithms and data format processing, return data that meets user requirements is generated.

Benefits of technology

It improves the query speed and accuracy of spatial data retrieval, reduces reliance on database spatial query plugins, enhances query autonomy and flexibility, and meets the high-efficiency needs of spatial range queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804076A_ABST
    Figure CN120804076A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight data retrieval method based on spatial retrieval, which comprises the following steps of: loading a data set from a data management platform by adopting a tool library, and analyzing spatial elements in the data set into feature source objects; a tool library is adopted to convert the spatial range into geometric objects to be screened; and adopting an intersects () function and a contains () function in the tool library to screen out feature source objects which are at least partially intersected with the boundary of the geometric object to be screened to form a result set, and extracting the result set to obtain return data. By combining the powerful space operation capability of the tool library with an optimized space screening algorithm, space elements which intersect with or are contained in a space range can be rapidly screened out, the query speed and precision are remarkably improved, and the efficient requirements for space delimitation and range query in various scenes are powerfully met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer data management, and more particularly, to a lightweight data retrieval method based on spatial retrieval. BACKGROUND

[0002] With the continuous advancement of urban digital construction, various government departments and units have accumulated a large amount of geographic space-related data, which contains basic information and geographic coordinate data of various data in the city. At the same time, there are also rich spatial data resources such as city spatial data, county spatial data set, and street spatial data set. Efficient retrieval and analysis of these spatial data are of great significance to urban planning, resource management, emergency response and many other fields.

[0003] In the spatial data application scenario, it is often necessary to perform retrieval operations on elements within a spatial range, such as querying all points of interest, specific facility distribution, etc. in a certain area on the map. This relies on effective spatial query technology to obtain the required data information.

[0004] In the prior art, a vector spatial information gridding storage management method for large-scale satellite data is disclosed in a Chinese patent application file (application number: 202210672392.0, application date: June 15, 2022), which includes the following steps: step 1, grid subdivision is performed on the geographic coordinate space range used by the vector spatial information, and the grid is numbered; step 2, the vector spatial information is converted into a unified GeoJSON format, and each independent vector spatial object is saved as a text file with the hash value of the geographic coordinate sequence as the file name; step 3, multi-element vector spatial information is logically connected to the corresponding numbered grid based on the spatial intersection relationship of geographic coordinates and the numbered grid; step 4, a corresponding data management system is established according to the numbered grid storage model to realize the functions of adding, deleting, rewriting and searching multi-element vector spatial information. That is, in the prior art, the data management of spatial information is based on index establishment for data searching, but this retrieval method can only perform one-to-one searching based on the index, resulting in low comprehensiveness of spatial range retrieval. In addition, this retrieval method requires prior construction of an index, which will cost a lot of time and manpower.

[0005] Therefore, the present application provides a lightweight data retrieval method based on spatial retrieval. SUMMARY

[0006] Therefore, the present application provides a lightweight data retrieval method based on spatial retrieval.

[0007] obtaining a data set comprising spatial elements, storing the data set to a data management platform;

[0008] obtaining a spatial range to be screened, request parameters and a visualization scheme;

[0009] loading the data set from the data management platform using a tool library and parsing the spatial elements in the data set into feature source objects;

[0010] converting the spatial range into a screening geometry object using the tool library;

[0011] performing spatial relationship operations on the screening geometry object and each of the feature source objects using an intersects() function in the tool library to screen the feature source objects intersecting the boundary of the screening geometry object, and performing spatial relationship operations on the screening geometry object and each of the feature source objects using a contains() function in the tool library to screen the feature source objects located within the range of the screening geometry object; and constructing a result set comprising the spatial elements corresponding to the feature source objects intersecting the boundary of the screening geometry object and the feature source objects located within the range of the screening geometry object;

[0012] parsing the request parameters to extract a query field, a query data type and a data format, performing matching operations on the query field and each of the spatial elements in the result set using a fuzzy matching algorithm to screen the spatial elements matching the query field as matching spatial elements, extracting data from the matching spatial elements according to the query data type to obtain extracted data, constructing assembled data comprising the matching spatial elements and the extracted data corresponding thereto, and performing format processing on the assembled data according to the data format to obtain return data;

[0013] rendering and displaying the return data according to the visualization scheme.

[0014] Optionally, the data set is obtained by:

[0015] obtaining online geographic data through a data interface;

[0016] manually obtaining offline geographic data;

[0017] converting the offline geographic data into electronic data;

[0018] summarizing the online geographic data and the electronic data into electronic geographic data;

[0019] obtaining the data set by cleaning, rectifying and unifying the format of the electronic geographic data.

[0020] Optionally, the electronic geographic data is cleaned, comprising:

[0021] The electronic geographic data is operated by using a regular expression and an outlier detection algorithm to filter out repeated data, error data and invalid data in the electronic geographic data; and the repeated data, the error data and the invalid data are removed.

[0022] Optionally, the electronic geographic data is rectified, comprising:

[0023] The position information of the electronic geographic data is cross-contrasted and coordinate calibrated by means of a map positioning service and a geographic information system technology.

[0024] Optionally, the tool library is used to convert the spatial range into the to-be-screened geometric object, comprising:

[0025] The tool library judges that the spatial range is a circle or a rectangle;

[0026] If the spatial range is a circle, the tool library extracts the center of the circle and the radius of the circle, and constructs a geometric object according to the center of the circle and the radius of the circle as the to-be-screened geometric object;

[0027] If the spatial range is a rectangle, the tool library extracts four vertices of the rectangle, and constructs the geometric object according to the four vertices as the to-be-screened geometric object.

[0028] Optionally, a fuzzy matching algorithm is used to perform matching operations on the query field and each spatial element in the result set respectively, and the spatial element matched with the query field is screened out as the matched spatial element, comprising:

[0029] The query field is a name field;

[0030] The name field is matched with the carried information of each spatial element in the result set respectively by using a fuzzy matching algorithm, and the spatial element matched with the query field is screened out as the matched spatial element.

[0031] Optionally, the matched spatial element is data-extracted according to the query data type to obtain the extracted data, comprising:

[0032] According to the query data type, at least one of data type conversion, nested structure construction, data extraction according to the query data type and data assembly is performed on the carried information of the matched spatial element to obtain the extracted data.

[0033] Optionally, the data extraction from the matching spatial elements according to the query data type obtains the extracted data, comprising:

[0034] The query data type is coordinate information.

[0035] The corresponding point coordinates are extracted from the carrying information of the matching spatial elements as the extracted data.

[0036] Optionally, after the matching spatial elements and the corresponding extracted data are assembled into the assembled data, the method further comprises:

[0037] The assembled data is checked for integrity and accuracy.

[0038] Optionally, the tool library is a GeoTools tool library, and the format of the data set is a GeoJSON format.

[0039] Compared with the prior art, the lightweight data retrieval method based on spatial retrieval provided by the application at least has the following beneficial effects:

[0040] 1. The lightweight data retrieval method based on spatial retrieval provided by the application comprises the following steps: loading a data set from a data management platform by using a tool library, and parsing spatial elements in the data set into feature source objects; converting a spatial range into a to-be-screened geometric object by using the tool library; performing spatial relationship operations on the to-be-screened geometric object and each feature source object by using an intersects() function in the tool library, screening feature source objects intersecting with the boundary of the to-be-screened geometric object, and performing spatial relationship operations on the to-be-screened geometric object and each feature source object by using a contains() function in the tool library, screening feature source objects located within the range of the to-be-screened geometric object; and assembling spatial elements corresponding to the feature source objects intersecting with the boundary of the to-be-screened geometric object and the feature source objects located within the range of the to-be-screened geometric object into a result set. By using the powerful spatial operation capability of the tool library and combining an optimized spatial screening algorithm, spatial elements intersecting with or contained in the spatial range can be quickly screened, the query speed and accuracy are significantly improved, and the efficient demand for spatial demarcation and range query in various scenarios is met.

[0041] 2. The lightweight data retrieval method based on spatial retrieval provided by the application does not need to depend on a database spatial query plug-in, directly obtains a data set from a data management platform, improves the autonomy and flexibility of query, obtains returned data by parsing and processing the data set through a tool library, determines the detail degree and format of the returned data according to specific requirements of a user containing a request parameter and a visualization scheme, and ensures the lightweight deployment and resource occupancy rate.

[0042] Of course, implementing any product of the present application does not necessarily require achieving all of the above-mentioned technical effects simultaneously.

[0043] Other features of the present application, its nature and advantages will become apparent from the following detailed description of exemplary embodiments of the application with reference to the drawings. BRIEF DESCRIPTION OF DRAWINGS

[0044] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments of the present application and, together with the description, serve to explain the principles of the application.

[0045] Figure 1 is a flow diagram of a lightweight data retrieval method based on spatial retrieval provided by the present application.

[0046] Figure 2 is another flow diagram of a lightweight data retrieval method based on spatial retrieval provided by the present application.

[0047] Figure 3 is a flow diagram of acquiring a data set.

[0048] Figure 4 is yet another flow diagram of a lightweight data retrieval method based on spatial retrieval provided by the present application. DETAILED DESCRIPTION

[0049] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangements, numerical expressions, and values of components and steps set forth in these embodiments are not limiting to the scope of the present application unless otherwise specifically stated.

[0050] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way limiting to the scope of the application or its applications or uses.

[0051] Techniques, methods, and apparatus known to those of ordinary skill in the relevant art can not be discussed in detail herein, but should be considered as part of the specification, where appropriate.

[0052] In all of the examples shown and discussed herein, any specific values should be interpreted as merely illustrative and not as a limitation. Thus, other examples of exemplary embodiments can have different values.

[0053] It should be noted that like numbers and letters refer to like items throughout the drawings, and that, once an item is defined in one drawing, it should not require further discussion in subsequent drawings.

[0054] Example 1

[0055] Referring toFigure 1 , Figure 1 is a flowchart of a lightweight data retrieval method based on spatial retrieval provided by the application, to illustrate a specific embodiment of the lightweight data retrieval method based on spatial retrieval provided by the application, comprising:

[0056] S101: Obtain a data set, the data set comprising spatial elements, and store the data set to a data management platform;

[0057] S102: Obtain a spatial range to be screened, request parameters and a visualization scheme;

[0058] S103: Load the data set from the data management platform by using a tool library, and parse the spatial elements in the data set into feature source objects;

[0059] S104: Convert the spatial range to a to-be-screened geometric object by using the tool library;

[0060] S105: Perform spatial relationship operation on the to-be-screened geometric object and each feature source object by using an intersects() function in the tool library, to screen out the feature source objects intersecting the boundary of the to-be-screened geometric object, and perform spatial relationship operation on the to-be-screened geometric object and each feature source object by using a contains() function in the tool library, to screen out the feature source objects located within the range of the to-be-screened geometric object; and construct a result set comprising the spatial elements corresponding to the feature source objects intersecting the boundary of the to-be-screened geometric object and the feature source objects located within the range of the to-be-screened geometric object;

[0061] S106: Analyze the request parameters, extract a query field, a query data type and a data format, perform matching operation on the query field and each spatial element in the result set by using a fuzzy matching algorithm, to screen out the spatial elements matching the query field as matching spatial elements; perform data extraction on the matching spatial elements according to the query data type to obtain extracted data, construct assembled data comprising the matching spatial elements and the corresponding extracted data, and perform format processing on the assembled data according to the data format to obtain return data;

[0062] S107: Perform rendering on the return data according to the visualization scheme and display the return data.

[0063] It should be noted that in step S101, acquiring the data set can be a periodic behavior, i.e., acquiring the data set every preset time period, periodically updating the data set stored in the data management platform, to cooperate with the retrieval process to realize lightweight processing of data space range retrieval. The data type of the data set stored in the data management platform can be a simple GeoJson data format. The prior art mainly relies on database spatial query plug-ins and map service spatial query interfaces when performing element retrieval within a spatial range. Although the database spatial query plug-in can use the spatial indexing mechanism of the database itself to perform data filtering, it has many limitations. For example, the spatial query plug-in interfaces of different databases are not unified, which greatly increases the development and maintenance cost in a multi-database environment; and the plug-in is often deeply bound to a specific database, lacking universality and flexibility. The method of the embodiment directly calls the data set stored in the data management platform, which can eliminate the dependence on the database spatial query plug-in compared with the prior art, and improve flexibility.

[0064] It can be understood that the traditional method has unsatisfactory efficiency in spatial demarcation and range query. Taking the database spatial query plug-in as an example, because it needs to adapt to the complex indexing mechanism of the database, and the index structures of different databases differ greatly, complex adaptation operations need to be frequently performed during query, consuming a large amount of computing resources and time, resulting in slow query speed, and the precision is also difficult to guarantee due to the limitations of the index. The map service spatial query interface is extremely prone to lag when transmitting massive data, and it is difficult to accurately demarcate the spatial range. In steps S103 to S105, the tool library loads the data set from the data management platform, and parses the spatial elements in the data set into feature source objects; the tool library converts the spatial range into a to-be-filtered geometric object; the intersects() function in the tool library performs spatial relationship operations on the to-be-filtered geometric object and each feature source object, respectively, to filter out the feature source objects intersecting the boundary of the to-be-filtered geometric object; the contains() function in the tool library performs spatial relationship operations on the to-be-filtered geometric object and each feature source object, respectively, to filter out the feature source objects within the range of the to-be-filtered geometric object; and the spatial elements corresponding to the feature source objects intersecting the boundary of the to-be-filtered geometric object and the feature source objects within the range of the to-be-filtered geometric object constitute a result set. Specifically, the embodiment provides a calculation method of the intersects() function and the contains() function:

[0065] intersects() function: judge whether the geometric objects intersect or not. For two geometric objects A and B, intersects(A, B) returns a Boolean value, and returns True only when there is at least one common point between the geometric shapes of A and B.

[0066] The specific formula is:

[0067] Point P(x0, y0) on line segment AB(x1, y1)-(x2, y2), need to meet:

[0068] (y2-y1)x0-(x2-x1)y0+x2y1-y2x1=0 and x0 in [min(x1, x2), max(x1, x2)] range, y0 in [min(y1, y2), max(y1, y2)] range.

[0069] Substitute data and calculation:

[0070] point = Point(2, 2);

[0071] line = LineString([(1, 1), (3, 3)]) print("Point and line intersection:", point.intersects(line)), output true.

[0072] And contains(A, B) means A contains B completely, that is, all points of B are inside or on the boundary of A.

[0073] The calculation method is:

[0074] From point P in any direction, count the number of intersection points with the boundary of polygon A, and the number of intersection points is odd inside.

[0075] Substitute data:

[0076] polygon = Polygon([(0, 0), (0, 4), (4, 4), (4, 0)]) # square

[0077] point_inside = Point(2, 2)

[0078] point_outside = Point(5, 5) print("Face contains internal point:", polygon.contains(point_inside)) # output True print("Face does not contain external point:", polygon.contains(point_outside)) # output False.

[0079] By using the powerful spatial operation capability of the tool library combined with the optimized spatial screening algorithm, the spatial elements intersecting with or contained in the spatial range can be quickly screened, the query speed and accuracy are significantly improved, and the efficient demand for spatial demarcation and range query in various scenes is met. Moreover, the tool library analyzes and processes the data set to obtain the returned data, according to the specific requirements of the user including the request parameters and the visualization scheme, the detailed degree and format of the returned data are determined, and the lightweight deployment and resource occupancy are ensured.

[0080] Embodiment 2

[0081] Reference Figure 2 , Figure 3 and Figure 4 , Figure 2 is another flowchart of the lightweight data retrieval method based on spatial retrieval provided by the application, Figure 3 is a flowchart of obtaining a data set, Figure 4 is another flowchart of the lightweight data retrieval method based on spatial retrieval provided by the application, which illustrates another specific embodiment of the lightweight data retrieval method based on spatial retrieval provided by the application, comprising:

[0082] S201: obtaining a data set, the data set comprising spatial elements, and storing the data set to a data management platform.

[0083] Among them, obtaining a data set comprises:

[0084] S2011: obtaining online geographic data through a data interface;

[0085] S2012: manually obtaining offline geographic data;

[0086] S2013: converting the offline geographic data into electronic data;

[0087] S2014: integrating the online geographic data and the electronic data into electronic geographic data;

[0088] S2015: obtaining the data set by cleaning, rectifying and unifying the format of the electronic geographic data.

[0089] Cleaning the electronic geographic data comprises:

[0090] Regular expressions and outlier detection algorithms are used to operate on the electronic geographic data, and repeated data, error data and invalid data in the electronic geographic data are screened out; the repeated data, error data and invalid data are removed.

[0091] Rectifying the electronic geographic data comprises:

[0092] By means of map positioning service and geographic information system (GIS) technology, the position information of electronic geographic data is cross-compared and coordinate calibrated.

[0093] The electronic geographic data is processed in a unified format, including:

[0094] By using a standardized data template, the data mapping and conversion tool is used to structure process data in different structures and coding formats, so as to ensure that all electronic geographic data conforms to the unified specification.

[0095] S202: Obtain the spatial range to be screened, the request parameter and the visualization scheme;

[0096] S203: Load the data set from the data management platform by using the tool library, and parse the spatial elements in the data set into feature source objects;

[0097] S204: Convert the spatial range into a to-be-screened geometric object by using the tool library, including: the tool library judges whether the spatial range is a circle or a rectangle;

[0098] S2041: If the spatial range is a circle, the tool library extracts the center of the spatial range and the radius of the spatial range, and constructs a geometric object according to the center of the spatial range and the radius of the spatial range as the to-be-screened geometric object;

[0099] S2042: If the spatial range is a rectangle, the tool library extracts the four vertices of the spatial range, and constructs a geometric object according to the four vertices of the spatial range as the to-be-screened geometric object.

[0100] S205: The intersects() function in the tool library is used to perform spatial relationship operation on the to-be-screened geometric object and each feature source object respectively, and the feature source objects intersecting with the boundary of the to-be-screened geometric object are screened out; the contains() function in the tool library is used to perform spatial relationship operation on the to-be-screened geometric object and each feature source object respectively, and the feature source objects located within the range of the to-be-screened geometric object are screened out; the spatial elements corresponding to the feature source objects intersecting with the boundary of the to-be-screened geometric object and the feature source objects located within the range of the to-be-screened geometric object constitute a result set;

[0101] S206: The query field, query data type and data format are extracted by analyzing the request parameter, the query field is matched with each spatial element in the result set by using a fuzzy matching algorithm, and the spatial element matched with the query field is screened out as a matched spatial element, including:

[0102] The query field is a name field;

[0103] The name field is matched with the carried information of each spatial element in the result set by using a fuzzy matching algorithm, and the spatial element matching the query field is screened out as a matching spatial element.

[0104] S207: Data extraction is performed on the matching spatial element according to the query data type to obtain extracted data, including:

[0105] According to the query data type, at least one of data type conversion, nested structure construction, data extraction according to the query data type, and data assembly is performed on the carried information of the matching spatial element to obtain the extracted data.

[0106] S208: The matching spatial element and the corresponding extracted data form assembled data.

[0107] S209: The integrity and accuracy of the assembled data are verified.

[0108] S2091: If the integrity and accuracy are passed, the assembled data is formatted according to the data format to obtain the return data.

[0109] S2091: If the integrity and accuracy are not passed, the retrieval can be ended or data correction can be performed, which can be set according to the actual situation, and the embodiment does not make specific limitations.

[0110] S210: The return data is rendered and displayed according to the visualization scheme.

[0111] It should be noted that in step S201, the online geographic data is obtained through a data interface. In order to ensure the comprehensiveness and accuracy of the obtained online geographic data, efficient network communication technology and customized data transmission protocol are needed, and accurate information sources need to be found. For example, the basic information of market entities in a specific range, such as registration, business status, etc., can be obtained from the big data bureau through a professional data interface, together with the geographic coordinates of the registered address, and the detailed data of resources and assets such as land and real estate are collected in cooperation with the planning bureau to determine the geographic distribution coordinates, and the online geographic data is gathered. Online geographic data can include detailed geographic spatial information such as city macro-level topography, transportation trunk layout, and large public facility distribution, etc. Of course, it is not limited to this. By using professional data interfaces, high-concurrency data grabbing technology can process tens of thousands of data requests per second, and combined with intelligent caching mechanism and distributed collection architecture, target data can be quickly and accurately collected. In order to comprehensively and accurately obtain online geographic data, it is safe and stable to gather.

[0112] The online geographic data can not be comprehensive, and needs to be manually improved. The data can be manually collected in each county to collect land use status, industrial park planning, education and medical resource distribution, and other spatial data with county characteristics. These data describe the spatial characteristics and development layout of each county in detail, and provide rich regional information for spatial retrieval. Or rely on the grassroots management institutions, focus on collecting street-level building distribution, commercial network layout, population density and other micro-level spatial data. These data can accurately reflect the actual situation of the street, and provide strong support for city fine management and spatial retrieval. The manually obtained data can be paper files, which are not convenient for management. The data can be converted into electronic data through interface or file scanning method, and then integrated with the online geographic data to form electronic geographic data.

[0113] Through a rigorous aggregation process, these spatial data from different levels and different fields are integrated into a unified data management platform, which becomes a solid foundation data source for subsequent spatial retrieval.

[0114] After obtaining the electronic geographic data, the electronic geographic data is cleaned to eliminate duplicate, error and invalid data, and the preliminary arrangement work is completed. The cleaned electronic geographic data is rectified to effectively correct the position deviation caused by signal drift and data error. The rectified electronic geographic data is processed in a unified format. The data mapping and conversion tool is used to structure the data with different structures and coding formats, to ensure that all data meet the unified standard. In this embodiment, the cleaned, rectified and unified format processed electronic geographic data is in a simple and standardized GeoJSON format, which is convenient for subsequent analysis and processing. Through a safe and stable data transmission channel, the processed electronic geographic data is transmitted in real-time stream or batch transmission mode, and is timely integrated into the data management platform. A data transmission monitoring mechanism can also be established to track the data transmission progress and integrity in real time, to ensure efficient and accurate data collection, and to lay a solid foundation for subsequent data analysis and application.

[0115] In steps S203 to S205, the tool library adopts the GeoTools tool library, which can parse and process GeoJson data. The data reading module of the GeoTools tool library can load a data set, parse it into an operable FeatureSource object, i.e., a feature source object, and provide a data basis for subsequent screening. The spatial operation engine of the GeoTools tool library is used to construct and operate geometric objects, generate a Geometry instance corresponding to the spatial range, i.e., a to-be-screened geometric object, by parsing a given spatial range, and use it as a reference standard for screening. The GeoTools tool library iteratively processes the loaded data set, FeatureSource obtains FeatureIterator, and iterates through each spatial element in the data set. The spatial relationship judgment method provided by the GeoTools tool library, such as the intersects() and contains() functions, is used to perform spatial relationship operations on the feature source object of the spatial element and the to-be-screened geometric object. The intersects() function is used to determine whether the boundary of the feature source object of the spatial element and the to-be-screened geometric object intersects; the contains() function is used to determine whether the feature source object of the spatial element is completely contained in the range of the to-be-screened geometric object. When either of the above two conditions is met, the spatial element is screened out and added to the result set, completing the screening of the spatial element and providing accurate data support for subsequent spatial analysis and data application.

[0116] In the present embodiment, step S206 can be specifically: parsing the request parameters and extracting the query fields such as the spatial element name keyword, using a JSON or XML parsing tool to structure the request data, and traversing the spatial element data set within the query range according to the parsed query fields. For each spatial element, extract its corresponding field and perform string matching with the user input field, for example, use a fuzzy matching algorithm to find spatial elements whose names meet the conditions. The present embodiment provides a kind of calculation method for matching the query field with each spatial element in the result set in step S206 using a fuzzy matching algorithm to screen out the spatial elements matching the query field as matching spatial elements, including:

[0117] Calculation formula:

[0118] Substitute data:

[0119] features=[

[0120] {"name":"Certain Garden", "geometry":"POLYGON((116.2839.98,116.340.0,116.3239.99,116.2839.98))", "location":"H District, B City"},

[0121] {"name":"Certain Certain Certain Certain Park", "geometry":"POLYGON((116.439.96,116.4239.98,116.4439.97,116.439.96))", "location":"C District, B City"},

[0122] {"name":"Certain Beach", "geometry":"POLYGON((121.4931.23,121.5131.24,121.531.22,121.4931.23))", "location":"H District, S City"},

[0123] {"name":"Certain Park", "geometry":"POLYGON((116.4539.9116.4739.92,116.4639.89,116.4539.9))", "location":"C District, B City"}]

[0124] contains_match = gdf[gdf['name'].str.contains(query)] print("Contains match results:", contains_match['name'].tolist()).

[0125] In step S207, for the spatial elements screened out matching the query field, the detailed data fields expected to be returned by the user, i.e., the query data type, are accurately matched with the fields in the original data carried by the matching spatial elements, to determine the detailed information fields that need to be obtained. The query data type can be divided into returning simple data and returning complex data. If simple data is returned, the query data type can be coordinate information. When the corresponding point coordinates are extracted from the matching spatial elements as extraction data, the extraction data and the matching spatial elements form assembled data, which can be an array in JSON format, and is returned through an API interface. If complex data is returned, not only the query field specified by the user is extracted, but also the detailed data field requirement expected to be returned by the user is obtained. According to the detailed data field requirement expected to be returned by the user, a SQL query statement is constructed or a corresponding data query interface is called to retrieve complete and detailed spatial element information from the data management platform. The obtained data is assembled according to the format required by the user, which may involve data type conversion, nested structure construction and other operations. Of course, referring to Figure 4 , if the query data type in the user request parameter does not require to return detailed data, the matching spatial elements can also be returned as data, and are returned through an API interface.

[0126] In this embodiment, according to the structured data that has been converged to the unified data management platform, direct range data query is performed. According to the coordinate information of the spatial range, the data records meeting the conditions are located in the structured data. For example, for a geographic coordinate data record, it is judged whether the coordinates are within the spatial range specified by the user. If yes, the record is included in the result set.

[0127] After the result set is constructed, the demand data is extracted, and the demand data enters the display link. In step S210, the display module selects a suitable visualization scheme according to the data type and user preference. If the user prefers intuitive map display, Leaflet, OpenLayers and other map frameworks are called to mark the coordinate points in the result set on the map in the form of icons, heat maps and the like, and support the pop-up of detailed information windows by clicking the coordinate points. If the user needs data reports, ECharts, Highcharts and other chart libraries are used to convert coordinate data and related attributes into visualization charts such as bar charts, line charts and scatter charts, and the latitude and longitude coordinates are formatted to retain appropriate decimal places, so that the displayed data is both professional and easy to understand, providing users with a high-quality data visualization experience.

[0128] It can be understood that the embodiment realizes an innovative method for querying data space without relying on a database space query plug-in, directly obtaining data from a data source, improving the autonomy and flexibility of the query, effectively solving the deficiencies of the prior art, and providing a more powerful tool for data space query.

[0129] It can be understood that the embodiment realizes an innovative method for querying data space without relying on a database space query plug-in, directly obtaining data from a data source, improving the autonomy and flexibility of the query, effectively solving the deficiencies of the prior art, and providing a more powerful tool for data space query.

[0130] 1、The lightweight data retrieval method based on spatial retrieval provided by the application, comprising: loading a data set from a data management platform using a tool library, and parsing spatial elements in the data set into feature source objects; converting a spatial range into a to-be-screened geometric object using the tool library; performing spatial relationship operations on the to-be-screened geometric object and each feature source object using an intersects() function in the tool library, screening out feature source objects intersecting the boundary of the to-be-screened geometric object, and performing spatial relationship operations on the to-be-screened geometric object and each feature source object using a contains() function in the tool library, screening out feature source objects located within the range of the to-be-screened geometric object; and constructing a result set of spatial elements corresponding to the feature source objects intersecting the boundary of the to-be-screened geometric object and the feature source objects located within the range of the to-be-screened geometric object. The powerful spatial operation capability of the tool library combined with the optimized spatial screening algorithm can quickly screen out spatial elements intersecting or contained in the spatial range, significantly improving the query speed and accuracy, and effectively meeting the efficient demand for spatial demarcation and range query in various scenarios.

[0131] 2、The lightweight data retrieval method based on spatial retrieval provided by the application does not rely on a database space query plug-in, directly obtains a data set from a data management platform, improves the autonomy and flexibility of the query, and obtains returned data by parsing and processing the data set through the tool library, so as to determine the detail level and format of the returned data according to the specific requirements of the user including the request parameters and the visualization scheme, and ensure the lightweight deployment and resource occupancy.

[0132] Although some specific embodiments of the application have been described in detail through examples, those skilled in the art should understand that the above examples are only for illustration, but not for limiting the scope of the application. Those skilled in the art should understand that the above embodiments can be modified without departing from the scope and spirit of the application. The scope of the application is defined by the appended claims.

Claims

1. A lightweight data retrieval method based on spatial retrieval, characterized in that: include: Acquire a data set, the data set including a spatial element, and store the data set in a data management platform; Get the spatial range to be filtered, request parameters, and visualization scheme; Using a tool library to load the dataset from the data management platform, and parsing the spatial elements in the dataset into feature source objects; The tool library is used to convert the spatial range into a geometric object to be screened, including: The tool library determines that the spatial range is a circle or a rectangle; If the spatial range is a circle, the tool library extracts the center of the spatial range and the radius of the spatial range, and constructs a geometric object according to the center of the spatial range and the radius of the spatial range as the geometric object to be screened; If the spatial range is a rectangle, the tool library extracts four vertices of the spatial range, and constructs the geometric object as the geometric object to be screened according to the four vertices of the spatial range; Using the intersects() function in the tool library, the geometric object to be screened is respectively subjected to a spatial relationship operation with each of the feature source objects, and the feature source objects intersecting with the boundary of the geometric object to be screened are screened out; using the contains() function in the tool library, the geometric object to be screened is respectively subjected to a spatial relationship operation with each of the feature source objects, and the feature source objects located within the range of the geometric object to be screened are screened out; the spatial elements corresponding to the feature source objects intersecting with the boundary of the geometric object to be screened and the feature source objects located within the range of the geometric object to be screened constitute a result collection; Parsing the request parameters to extract the query field, query data type, and data format; using a fuzzy matching algorithm to match the query field with each of the spatial elements in the result collection, and screening out the spatial elements that match the query field as matching spatial elements; extracting data from the matching spatial elements according to the query data type to obtain extracted data; and assembling the matching spatial elements and the corresponding extracted data into assembled data; and formatting the assembled data according to the data format to obtain return data; The returned data is rendered and displayed according to the visualization scheme.

2. The lightweight data retrieval method based on spatial retrieval according to claim 1 is characterized in that: Acquiring the data set includes: Obtain online geographic data through the data interface; Manual acquisition of offline geographic data; converting the offline geographic data into electronic data; Aggregating the online geographic data and the electronic data into electronic geographic data; The data set is obtained after cleaning, correcting and unifying the format of the electronic geographic data.

3. The lightweight data retrieval method based on spatial retrieval according to claim 2 is characterized in that: Cleaning the electronic geographic data includes: Regular expressions and outlier detection algorithms are used to operate on the electronic geographic data to screen out duplicate data, erroneous data, and invalid data in the electronic geographic data; and the duplicate data, erroneous data, and invalid data are eliminated.

4. The lightweight data retrieval method based on spatial retrieval according to claim 2 is characterized in that: Correcting the electronic geographic data includes: With the help of map positioning services and geographic information system technology, the location information of the electronic geographic data is cross-referenced and coordinate calibrated.

5. The lightweight data retrieval method based on spatial retrieval according to claim 1 is characterized in that: Using a fuzzy matching algorithm to perform a matching operation on the query field and each of the spatial elements in the result set, and screening out the spatial elements matching the query field as the matching spatial elements, includes: The query field is a name field; A fuzzy matching algorithm is used to perform string matching on the name field and the information carried by each of the spatial elements in the result set, and the spatial elements matching the query field are screened out as the matching spatial elements.

6. The lightweight data retrieval method based on spatial retrieval according to claim 1 is characterized in that: Extracting data from the matching space elements according to the query data type to obtain the extracted data includes: According to the query data type, the information carried by the matching space element is converted into a data type, a nested structure is constructed, and at least one of data extraction and data assembly corresponding to the query data type is processed to obtain the extracted data.

7. The lightweight data retrieval method based on spatial retrieval according to claim 1 is characterized in that: Extracting data from the matching space elements according to the query data type to obtain the extracted data includes: The query data type is coordinate information; The corresponding point coordinates are extracted from the information carried by the matching space element as the extracted data.

8. The lightweight data retrieval method based on spatial retrieval according to claim 1 is characterized in that: After the matching space elements and the corresponding extracted data are combined into the assembled data, the method further includes: The assembly data is checked for completeness and accuracy.

9. The lightweight data retrieval method based on spatial retrieval according to claim 1, characterized in that: The tool library adopts the GeoTools tool library, and the format of the dataset is GeoJSON format.

Citation Information

Patent Citations

  • Spatial data encoding based on any database, spatial data querying method and electronic equipment

    CN111538735A

  • Space vector data rapid calculation method based on PostGIS

    CN118260372A

  • Distributed intelligent retrieval method and system for spatio-temporal data

    CN118838937A

  • Spatial search engine support of virtual earth visualization system

    US20100332468A1