A satellite image spatial coverage screening method based on an approximation algorithm and using PostGIS functions
By combining PostgreSQL and PostGIS with an approximate algorithm for satellite image screening, we can automatically select satellite image datasets with a small number of scenes, low overlap, and high coverage. This solves the problem of high time cost of manual screening and achieves efficient data screening.
Patent Information
- Application Number
- CN202411954559.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In the existing technology, the satellite image data screening process relies on manual visual screening, which results in high time cost and makes it difficult to quickly screen out effective data sets with a small number of scenes, low overlap and high coverage.
An approximate algorithm based on the PostgreSQL database and the PostGIS extension plug-in is used, and PostGIS spatial functions such as ST_Intersection, ST_Union, and ST_Area are used for iterative analysis to automatically screen out satellite image datasets that meet the requirements.
The calculation is completed in polynomial time, which reduces the time cost, improves the screening efficiency, reduces the amount of satellite image data with large overlap, and simplifies the manual screening process.
Smart Images

Figure CN119884268B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a satellite image spatial coverage screening method, and in particular to a satellite image spatial coverage screening method based on an approximate algorithm and utilizing a PostGIS function. Background Art
[0002] With the rapid advancement of satellite technology, satellite imagery data has become an indispensable information resource in numerous fields, driving a wide range of innovative applications. Simultaneously, the significant increase in the number of satellites in orbit has led to an unprecedented accumulation of satellite imagery data worldwide. When leveraging this data to support various research, planning, and monitoring applications, a crucial first step is to efficiently acquire comprehensive, high-quality imagery datasets covering specific areas and time periods to ensure the accuracy and timeliness of subsequent analysis. Currently, the acquisition and selection of qualified datasets relies heavily on manual labor. First, based on the precise geographic coordinates of the target area, personnel must meticulously search for suitable satellite imagery resources. Subsequently, strict time windows and cloud cover thresholds are set for a secondary screening process, initially constructing a dataset with high overlap. This process is then further refined through the use of manual visual screening, meticulously examining each image's quick preview. Using professional skills and experience to determine image availability, a third screening process is conducted, ultimately resulting in a smaller number of valid datasets. This manual visual screening process is time-consuming and expensive. Developing a method to rapidly select valid datasets with a small number of scenes, low overlap, and high coverage would effectively address the time-consuming nature of this manual screening process.
[0003] PostgreSQL is a powerful open-source object-relational database that supports most SQL language standards and provides many modern database features, such as relational queries, foreign keys, triggers, views, transaction integrity, and multi-version concurrency control. PostGIS is a PostgreSQL extension that provides storage, query, and analysis capabilities for spatial objects. These spatial objects can be points, lines, polygons, and other common data types in geographic information systems (GIS). Summary of the Invention
[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the existing technology and provide a satellite image spatial coverage screening method based on an approximate algorithm and using PostGIS functions, which effectively solves the problems of large amount of satellite image data and large overlap in the target area, and high time cost of manual visual screening. The present invention combines the PostgreSQL database and its powerful PostGIS extension plug-in, and performs complex spatial calculations on massive satellite image data by calling the spatial functions provided by PostGIS. Specifically, the present invention aims to use an approximate algorithm for iterative analysis, and customize a coverage query function using PostGIS spatial functions such as ST_Intersection, ST_Union, and ST_Area to perform cross-calculations on the geographic spatial data stored in the PostgreSQL database to identify and screen out data that overlaps or intersects with each other in a specific area, thereby reducing the time cost of manual visual screening and quickly screening out qualified satellite image data sets with a small number of scenes, low overlap, and high coverage.
[0005] The technical solution adopted by the present invention is: the present invention comprises the following steps:
[0006] Step 1: Receive the scope of the target area. The query scope of the target area is to obtain the spatial vector surface data of the target area, which is the spatial vector data of the target area uploaded by the user in a certain format such as Shapefile, GeoJSON, KML, etc.
[0007] Step 2: Obtain spatial vector data from the PostgreSQL database, namely the image vector ranges of several satellite image data, and extract relevant attribute information of the spatial vector data, such as name, cloud cover, geomtery object, etc.
[0008] Step 3: Use the ST_Intersects function in PostGIS to determine whether the image vector range in the PostgreSQL database intersects with the target area one by one in space, and obtain a dataset of several candidate satellite images that have spatial intersections, and store the dataset in a temporary data set;
[0009] Step 4: Use the ST_Union function in PostGIS to perform vector union calculation on the temporary data set to obtain the union range covered by the temporary data set
[0010] Step 5: Use the ST_Intersection function and ST_Area function in PostGIS to calculate the intersection of the target area and the union range covered by the temporary data set to obtain the actual effective coverage area;
[0011] Step 6: Determine whether the actual effective coverage area is greater than 0. If the area is not greater than 0, return that there is no suitable satellite image data in the target area; if the area is greater than 0, use the approximate algorithm for iterative analysis: first, use the ST_Intersection function in the PostGIS function to intersect an image vector range in the temporary data set with the actual effective coverage range to obtain the range of the overlapping area; then use the ST_Area function in the PostGIS function to calculate the area of the overlapping area and determine whether the area of the overlapping area is greater than 0. If the area of the overlapping area is not greater than 0, mark the satellite image data as invalid data; if the area of the overlapping area is greater than 0, use the ST_Difference function in the PostGIS function to calculate the remaining actual coverage area after erasing the overlapping area from the current actual effective coverage range, and then use the ST_Area function in the PostGIS function to calculate the remaining actual coverage area, mark the satellite image data as valid data, and use the remaining actual coverage area as the current actual effective coverage range in the next cycle; continue to traverse the next image in the temporary data set for the next round of calculation until the image in the temporary data set is marked as valid or invalid data, and finally return a valid data set.
[0012] The code for iterative analysis of satellite image spatial coverage screening using an approximate algorithm is as follows:
[0013]
[0014]
[0015] The beneficial effects of this invention are as follows: 1. It fully utilizes the fast speed of approximate algorithms to complete calculations in polynomial time, reducing the amount of data required for highly overlapping satellite images within the target area, lowering time costs and improving query and screening efficiency. 2. It also fully utilizes the PostgreSQL database and PostGIS plug-in to perform data queries and spatial calculations directly within the database. This reduces the total time required to query, process, and return results compared to using GeoTools, GDAL, and other tools in Java, Python, and other environments for the same amount of image data. It also facilitates direct calling of the custom function in programming languages like Java and Python, improving its reusability for other applications that require querying the vector range of satellite images covering the target area. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 is a flow chart of the present invention;
[0017] Figure 2A temporary data set diagram of several candidate satellite images that have a spatially intersecting relationship provided by an embodiment of the present invention;
[0018] Figure 3 is a temporary data set coverage map provided by an embodiment of the present invention;
[0019] Figure 4 This is an effective data set coverage map provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0020] like Figure 1 As shown, in this embodiment, the present invention includes the following steps:
[0021] Step 1: Receive the scope of the target area. The query scope of the target area is to obtain the spatial vector surface data of the target area, which is the spatial vector data of the target area uploaded by the user in a certain format such as Shapefile, GeoJSON, KML, etc.
[0022] In this embodiment, the scope of Zhuhai City is received in GeoJSON format, the geographic scope in GeoJSON format is converted into a geographic object, and its spatial reference system identifier (SRID) is set to 4326 (WGS 84), and finally the result is saved in a table named states_needed
[0023] Step 2: Obtain spatial vector data from the PostgreSQL database, namely the image vector ranges of several satellite image data, and extract relevant attribute information of the spatial vector data, such as name, cloud cover, geomtery object, etc.
[0024] In the embodiment, SQL statements are used to obtain all Zhuhai-1 satellite images and their geographic information and attribute information (such as name (name), cloud cover (image_cloudage), geomtery object (temp_2_range), etc.) in the PostgreSQL database.
[0025] Step 3: Use the ST_Intersects function in PostGIS to determine whether the image vector range in the PostgreSQL database intersects with the target area one by one in space, and obtain a dataset of several candidate satellite images that have spatial intersection relationships, and store the dataset in a temporary data set;
[0026] In the embodiment, SQL statements are used to filter out all Zhuhai No. 1 data from May 26, 2019 to August 24, 2021, and the geographic information and attribute information of each satellite image data (such as name (name), cloud cover (image_cloudage), geomtery object (temp_2_range) etc.) are obtained. Then, the ST_Intersects function in PostGIS function is used to extract the data sets of several candidate satellite images that have spatial intersection with the range of Zhuhai City and store them in a temporary data set; a total of 1709 rows of results are obtained, and the query results are shown in Figure 2 , coverage information see Figure 3 ;
[0027] Step 4: Use the ST_Union function in PostGIS to perform vector union calculation on the temporary data set to obtain the union range (states_real) covered by the temporary data set;
[0028] Step 5: Use the ST_Intersection function and ST_Area function in PostGIS to intersect the target area and the union range covered by the temporary data set to obtain an effective coverage range face vector (states_rest); then use the ST_Area function to calculate the area size of the effective union range (states_rest);
[0029] The code for steps 3-5 is as follows:
[0030] states_real=ST_Union(ST_Intersection(states_needed,b.range))from"rscm_image_data_total"as b where ST_Intersects(states_needed,b.range)andb.image_take_time between to_date(imageInitTime,'2019-05-26')and to_date(checkTime,'2021-08-24')and b.image_cloudage <CAST(imageCloudage AS numeric);
[0031] states_rest=states_real;
[0032] states_temp_doub=ST_Area(states_rest);
[0033] Step 6: Determine whether the actual effective coverage range (states_rest) is greater than 0. If the area is not greater than 0, return that there is no suitable satellite image data in the target area; if the area is greater than 0, use the approximate algorithm for iterative analysis: first use the ST_Intersection function in the PostGIS function to intersect an image vector range (temp_2_range) in the temporary data set with the actual effective coverage range (states_rest) to obtain the range of the overlapping area (states_temp_2); then use the ST_Area function in the PostGIS function to calculate the overlapping area range and determine whether the overlapping area range is greater than 0. If the overlapping area range is not greater than 0, mark the satellite image data as invalid data. If the overlapping area range is greater than 0, mark the satellite image data as invalid data. If the value is 0, the ST_Difference function in PostGIS function is used to calculate the remaining actual coverage (states_temp) after erasing the overlapping area (states_temp_2) from the current actual coverage (states_rest). The ST_Area function in PostGIS function is then used to calculate the remaining actual coverage area (states_temp_doub). The satellite image data is marked as valid data, and the remaining actual coverage (states_temp) is used as the current actual coverage (states_rest) in the next cycle. The next round of calculation is continued by traversing the next image in the temporary data set until the image in the temporary data set is marked as valid or invalid data, and finally a valid data set is returned.
[0034] In the embodiment, it is determined whether the area of the actual effective coverage range vector is greater than 0, and an approximate algorithm is used for iterative analysis: first, the satellite image data in all temporary data sets are traversed, and the vector range (temp_2_range) of a scene of satellite image data is intersected with the actual effective coverage range (states_rest) using the ST_Intersection function in turn to obtain the range of the overlapping area (states_temp_2); then, the ST_Area function in the PostGIS function is used to calculate the overlapping area range, and it is determined whether the overlapping area range is greater than 0. If the overlapping area range is not greater than 0, the satellite image data is marked as invalid data. If the overlapping area range is greater than 0, the ST_D function in the PostGIS function is used. The ifference function calculates the remaining actual coverage (states_temp) after erasing the overlapping area (states_temp_2) from the current actual coverage (states_rest), and then uses the ST_Area function in the PostGIS function to calculate the remaining actual coverage area (states_temp_doub), and marks the satellite image data in the current loop as valid data. At the same time, the remaining actual coverage (states_temp) is used as the current actual coverage (states_rest) in the next loop; continue to use the next image in the temporary data set for the next round of calculation until the image in the temporary data set is marked as valid or invalid data, and finally return a valid data set.
[0035] The image vector range (temp_2_range) of the satellite image data is intersected with the actual effective coverage range (states_rest):
[0036] states_temp_2:=ST_intersection(states_rest,temp_2_range)
[0037] Use the ST_Difference function in the PostGIS function to calculate the remaining actual coverage (states_temp) after erasing the overlapping area (states_temp_2) from the current effective coverage (states_rest):
[0038] states_temp:=ST_difference(states_rest,states_temp_2);
[0039] The code for iterative analysis of satellite image spatial coverage screening using an approximate algorithm is as follows:
[0040]
[0041]
[0042] Using the above process, a PostgreSQL database and a custom PostGIS function based on an approximate algorithm were used to iteratively filter out a set of valid image datasets with a small number of scenes, low overlap, and high coverage. This example retained 12 satellite images of relatively good quality after screening. Figure 4 , significantly reducing the number of images and screening time.
[0043] The present invention is applied to the technical field of geographic information system (GIS) and database.
[0044] Although the embodiments of the present invention are described with practical solutions, they do not limit the meaning of the present invention. For those skilled in the art, it is obvious to modify the implementation scheme and combine it with other solutions based on this description.
Claims
1. A satellite image spatial coverage screening method based on an approximate algorithm and using PostGIS functions, characterized in that: It includes the following steps: Step 1: Receive the scope of the target area; Step 2: Obtain spatial vector data from the PostgreSQL database; Step 3: Use PostGIS functions to determine whether the image vector range in the PostgreSQL database intersects with the target area one by one in space, and store the datasets of several candidate satellite images that intersect in space into a temporary data set; Step 4: Perform vector union calculation on the temporary data set to obtain the union range covered by the temporary data set; Step 5: Perform intersection calculation on the target area and the union range covered by the temporary data set to obtain the actual effective coverage area; Step 6: Determine whether the actual effective coverage area is greater than 0. If the area is not greater than 0, return that there is no suitable satellite image data in the target area; if the area is greater than 0, use the approximate algorithm for iterative analysis: first, perform an intersection calculation on an image vector range in the temporary data set and the actual effective coverage range to obtain the range of the overlapping area; then determine whether the overlapping area range is greater than 0. If the overlapping area range is not greater than 0, mark the satellite image data as invalid data; if the overlapping area range is greater than 0, calculate the remaining actual coverage area after erasing the overlapping area range from the current actual effective coverage range, mark the satellite image data as valid data, and use the remaining actual coverage range as the current actual effective coverage range in the next cycle; continue to traverse the next image in the temporary data set for the next round of calculation until the image in the temporary data set is marked as valid or invalid data, and finally return a valid data set.
2. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: In the step 1, receiving the query range of the target area is to obtain the spatial vector surface data of the target area, which is the spatial vector data of the target area uploaded by the user in any format of Shapefile, GeoJSON, or KML.
3. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: Obtain spatial vector data from the PostgreSQL database. The spatial vector data is the image vector range of several satellite image data, and extract relevant attribute information of the spatial vector data.
4. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: In step 3, the ST_Intersects function in PostGIS is used to spatially determine whether the image vector range in the PostgreSQL database intersects with the target area one by one, and obtain a data set of several candidate satellite images that have a spatial intersection relationship, and store the data set in a temporary data set.
5. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: In step 4, the vector union calculation is performed on the temporary data set using the ST_Union function in the PostGIS function to obtain the union range covered by the temporary data set.
6. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: In step 5, the ST_Intersection function and the ST_Area function in the PostGIS function are used to perform intersection calculation on the target area and the union range covered by the temporary data set to obtain the actual effective coverage area.
7. The satellite image spatial coverage screening method based on an approximate algorithm and utilizing PostGIS functions according to claim 1, characterized in that: If the actual effective coverage area is greater than 0, an approximate algorithm is used for iterative analysis: first, the ST_Intersection function in the PostGIS function is used to intersect an image vector range in the temporary data set with the actual effective coverage range to obtain the range of the overlapping area; then the ST_Area function in the PostGIS function is used to calculate the area of the overlapping area and determine whether the area of the overlapping area is greater than 0. If the area of the overlapping area is not greater than 0, the satellite image data is marked as invalid data. If the area of the overlapping area is greater than 0, the ST_Difference function in the PostGIS function is used to calculate the remaining actual coverage area after erasing the overlapping area from the current actual effective coverage range, and then the ST_Area function in the PostGIS function is used to calculate the remaining actual coverage area, and the satellite image data is marked as valid data. At the same time, the remaining actual coverage area is used as the current actual effective coverage range in the next cycle.
Citation Information
Patent Citations
Real-time decryption method based on vector data front-end display
CN115114356A
Satellite image optimal full coverage image determination method and device based on greedy algorithm, electronic equipment and storage medium
CN118364038A