A method for analyzing the evolution of natural resource elements based on spatiotemporal cubes
By combining a spatiotemporal cube-based analysis method with GeoTools, Three.js, and ECharts, the problem of visualizing the dynamic evolution of natural resource elements was solved, achieving efficient analysis and visualization results.
Patent Information
- Application Number
- CN202310861555.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-13
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2043-07-13
AI Technical Summary
Existing technologies are inefficient at representing the dynamic evolution of natural resource elements, and visualization drawing is inefficient and provides a poor user experience.
We employ a spatiotemporal cube-based analysis method, using GeoTools to parse GIS data and construct spatiotemporal cubes and chains for the evolution of natural resource elements, and then visualize them using Three.js and ECharts tools.
It enables the analysis and visualization of the dynamic evolution process of natural resource elements, improving drawing efficiency and user experience.
Smart Images

Figure CN116881351B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for analyzing the evolution of natural resource elements based on spatiotemporal cubes. Background Technology
[0002] Research on Geographic Information Systems (GIS) began in the 1960s, initially focusing primarily on the processing and study of spatial data. However, with the rapid improvement of computer processing power and the increasing prominence of environmental and resource issues in the 1970s, GIS technology began to move towards practical application, leading to the development of GIS application systems. By the 1980s, the rapid development of GIS technology had led to its maturity, and commercially available practical systems produced by specialized manufacturers appeared on the market, significantly expanding the application areas of GIS. Although GIS research in my country started relatively late, beginning in the early 1980s, initially mainly involving the import of foreign GIS software, with the progress of domestic GIS basic research and the continuous expansion of application areas, my country began to independently develop GIS software products suitable for its national conditions. By the 1990s, several domestically produced GIS software products emerged in my country, such as MAPGIS, GEOSTAR, CITYSTAR, and MAPENGINE.
[0003] Hua Yixin once proposed that Geographic Information System (GIS) is a technological means of abstracting and describing the geographic world using geospatial data. It can collect, store, manage, analyze, and express various types of data information related to geographic distribution. He also believes that the core of GIS is to achieve the abstraction of the geographic world through geospatial data models.
[0004] Hagerstrand first proposed the spatiotemporal cube model, which was used to describe human migration. The model comprises three dimensions: two spatial dimensions and one temporal dimension. The temporal dimension is represented as the Z-axis, either continuous or discrete, while the spatial dimensions are represented as the X and Y axes. Through human understanding of the semantic geometry of time, this model intuitively describes the historical evolution of spatial entities. The development of the spatiotemporal cube model has had a significant impact on the research of temporal geographic information systems. This model has been extensively studied by researchers such as Rucker and Szego; for example, commercial software like ARC / INFO and ArcView are designed based on the spatiotemporal cube model and object-oriented thinking.
[0005] Natural resource elements are constantly evolving, exhibiting dynamic characteristics and strong spatiotemporal correlations. As people's demand for natural resources continues to grow and the intensity of their efforts to transform nature increases, the spatiotemporal evolution of natural resource elements is becoming increasingly dramatic and complex.
[0006] The spatiotemporal data of natural resource elements are diverse and constantly changing. Over time, the amount of data continues to grow, which brings certain challenges to the analysis and visualization of the spatiotemporal evolution of natural resource elements, such as the inability to show the dynamic evolution process, low efficiency of visualization drawing, and poor user experience. Summary of the Invention
[0007] In order to overcome the shortcomings of the existing technology, the present invention aims to provide a method for natural resource element evolution analysis based on spatiotemporal cubes.
[0008] The technical solution provided by this invention to solve the above-mentioned technical problems is: a method for natural resource element evolution analysis based on spatiotemporal cubes, comprising the following steps:
[0009] S1. Parse the GIS data file and store it in the database;
[0010] S2. Identify and locate the target element entity, and use GeoTools to overlay the target element entity with the set of all element entities in the time dimension to construct a spatiotemporal cube of natural resource element evolution.
[0011] S3. Analyze the relationships between all elements in adjacent sets of elements in the time dimension of the spatiotemporal cube, and construct the evolution chain of natural resource elements;
[0012] S4. Visualize the spatiotemporal cube of natural resource element evolution and the natural resource element evolution chain.
[0013] A further technical solution is that the specific steps of step S1 are as follows:
[0014] S11. Compress the GIS data of natural resource elements for each year into a separate zip file;
[0015] S12. Then import the files into the parsing program one by one;
[0016] S13. The parsing program performs validity verification on the imported file. If the imported file is invalid, the parsing program will automatically terminate. After the file passes the verification, the parsing program will decompress the zip file in the temporary file directory.
[0017] S14. The parser creates a data object for each natural resource element entity and stores these objects in a list;
[0018] S15. Use the .prj file in the temporary file directory and the CRS.lookupEpsgCode() method to obtain the projection coordinate system and geometric data and attribute data of natural resource element entities of GIS data, and save these data and projection coordinate system in the form of key-value pairs in a HashMap type data object.
[0019] S16. After the file parsing is completed, the data in each data object, along with the year to which the Shapefile belongs, is persisted to the MySQL database as a row record.
[0020] A further technical solution is that the verification items in step S3 include the import file naming format, file type, and file size.
[0021] A further technical solution is that the specific process of step S2 is as follows:
[0022] S21. Identify a target feature entity, and then use a database query statement to retrieve the geometric and attribute data of the target feature entity from the database.
[0023] S22. Construct a source file information set by querying file information for all years except the year to which the target element entity belongs;
[0024] S23. Using the year of the file as a parameter, traverse the source file information using the overlay analysis method;
[0025] S24. Store the return value of each thread in the result array and sort it in ascending order of the year.
[0026] A further technical solution is that, in step S21, the ST_asWKB() method is used in the query statement to convert the value of the geometry format inside the MySQL database into its WKB representation and return binary data, and then the returned geometric binary data is converted into a Geometry class object.
[0027] A further technical solution is that the specific process of step S23 is as follows:
[0028] S231. Query all feature entities in the input year based on the document information, and construct the source feature entity set;
[0029] S232. Then determine whether the projection space of the geometric data of the source feature entity is consistent with the projection space of the geometric data of the target feature entity; if they are inconsistent, use the JTS.transform() method to transform the geometric data of the target feature entity to the projection space of the geometric data of the source feature entity.
[0030] S233. Next, iterate through the source element entity set and use the intersects() method of the Geometry class to determine whether the target element entity intersects with the source element entity. If they intersect, use the intersection() method of the Geometry class to overlay the target element entity with each source element entity and return the geometric data of the intersection.
[0031] S234. Convert the returned results to the WGS84 projected coordinate system, and encapsulate the geometric data and attributes of each returned result into an internal object and store it in a temporary array. Store the source element entities that are intersecting with the target element entity in a two-dimensional array. Each row of the two-dimensional array represents the year, so source element entities in the same year are stored in the same row.
[0032] S235. Encapsulate the data in the temporary array into GeoJSON format and use it as the return value of the overlay analysis method.
[0033] A further technical solution is that the specific process of visualizing the spatiotemporal cube of natural resource element evolution in step S4 is as follows:
[0034] S41. Create a 3D canvas using Three.js;
[0035] S42. Use the moveTo() method of the Shape class in Three.js to connect each adjacent point of the geometric data of each feature entity in GeoJSON to obtain a two-dimensional image of the feature entity;
[0036] S43. Use the ExtrudeGeometry class in Three.js to stretch a 2D image along the z-axis.
[0037] S44. Use the render() method of the 3D canvas object to render the constructed 3D model of the element entity in the 3D canvas.
[0038] S45. Once all 3D models are rendered, the 3D visualization of the spatiotemporal cube of the natural resource element evolution is complete.
[0039] A further technical solution is that the specific process of visualizing the evolution chain of natural resource elements in step S4 is as follows: the natural resource element evolution chain diagram data constructed in step S3 is visualized directly using the Echarts tool.
[0040] The present invention has the following beneficial effects: The present invention utilizes a spatiotemporal cube model to construct a spatiotemporal cube and an evolutionary chain of natural resource elements based on years of accumulated natural resource element data, analyzes the dynamic evolution process of natural resource elements, uses Three.js to visualize the spatiotemporal cube of natural resource element evolution, constructs the evolutionary chain of natural resource elements using the spatiotemporal cube of natural resource element evolution, and uses ECharts to visualize the evolutionary chain of natural resource elements in the form of a graph structure, thereby realizing the evolutionary analysis and visualization of natural resource elements. Attached Figure Description
[0041] Figure 1 This is a flowchart of the method of the present invention;
[0042] Figure 2 This is a flowchart of the data file processing procedure;
[0043] Figure 3 To construct a spatiotemporal cube flowchart of the evolution of natural resource elements;
[0044] Figure 4 A visualization flowchart for the spatiotemporal cube of the evolution of natural resource elements;
[0045] Figure 5 A 3D visualization of the spatiotemporal cube of the evolution of natural resource elements;
[0046] Figure 6 A visualization of the evolutionary chain of natural resource elements. Implementation
[0047] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] like Figure 1 As shown, the present invention provides a method for natural resource element evolution analysis based on a spatiotemporal cube, comprising the following steps:
[0049] S1. Parse the GIS data file and store it in the database;
[0050] GIS data is often stored in ESRI Shapefile format, which contains both graphic and attribute data. However, ordinary computers cannot directly parse this data file, often requiring the use of other software or toolkits such as ArcGIS or GeoTools to parse it. Since ArcGIS is not open-source software and is difficult to extend, this invention uses GeoTools, an open-source GIS data analysis tool based on the Java platform, to perform file parsing and data analysis.
[0051] Data file processing flow as follows Figure 2 As shown.
[0052] Each year's natural resource element GIS data is compressed into a separate zip file, and then the files are imported into the parsing program one by one.
[0053] The parsing program first performs a validity check on the imported file. The validation items include the imported file naming format, file type, and file size. If the imported file is invalid, the parsing program will automatically terminate. Once the file passes the validation, the parsing program will unzip the zip file in a temporary file directory.
[0054] The projected coordinate system of the GIS data is obtained by using the ".prj" file in the temporary file directory and the CRS.lookupEpsgCode() method. This projected coordinate system is used to convert all GIS data to a unified projected coordinate system when analyzing GIS data.
[0055] The FileDataStoreFinder.getDataStore() method in GeoTools can parse the ".shp" file in the temporary file directory, and the getProperties() method can obtain the geometric data and attribute data of natural resource element entities, and store these data and projected coordinate systems in the form of key-value pairs in a HashMap type data object;
[0056] The parsing process creates a data object for each natural resource element entity and stores these objects in a list. After the file parsing is complete, the data in each data object, along with the year to which the Shapefile belongs, is persisted to the MySQL database as a row record. During persistence, the collection data of entities needs to be processed using the ST_MultiPolygonFromText() method in MySQL to convert the polygon text string into polygon bytecode data.
[0057] S2. Identify and locate the target element entity, and use GeoTools to overlay the target element entity with the set of all element entities in the time dimension to construct a spatiotemporal cube of natural resource element evolution.
[0058] Flowchart as follows Figure 3 As shown;
[0059] First, identify a target feature entity. Then, use a database query to retrieve the target feature entity's data from the database, including geometric and attribute data. The query needs to use the ST_asWKB() method to convert the values in the internal geometric format of the MySQL database into its WKB representation and return binary data. Furthermore, a data conversion processor needs to be written to convert the returned geometric binary data into Geometry class objects that can be used and processed by GeoTools.
[0060] The source file information set will be constructed by querying file information for all years except the year to which the target element entity belongs.
[0061] Then, the source file information is traversed, and the file year is passed as a parameter to the overlay analysis method, which is then executed using a Java thread pool.
[0062] In overlay analysis methods;
[0063] First, all feature entities from the input year are retrieved to construct the source feature entity set. Then, it is determined whether the projection space of the geometric data of the source feature entities is consistent with the projection space of the geometric data of the target feature entity. If they are inconsistent, the JTS.transform() method is used to transform the geometric data of the target feature entity to the projection space of the geometric data of the source feature entity.
[0064] Next, the source feature entity set is traversed, and the `intersects()` method of the `Geometry` class is used to determine whether the target feature entity intersects with the source feature entities. If they intersect, the `intersection()` method of the `Geometry` class is used to perform an overlay analysis between the target feature entity and each source feature entity. In fact, `intersection()` internally performs an intersection operation between the geometric data of the target feature entity and the geometric data of the source feature entities, and returns the geometric data of the intersection portion.
[0065] The returned results are converted to the WGS84 projected coordinate system, and the geometric data and attributes of each returned result are encapsulated into an internal object and stored in a temporary array. The source element entities that are intersecting with the target element entity are stored in a two-dimensional array. Each row of the two-dimensional array represents the year, so source element entities in the same year are stored in the same row.
[0066] Once all source element entities have been traversed, the data in the temporary array is encapsulated into GeoJSON format, which can be parsed by visualization tools, and used as the return value of the overlay analysis method.
[0067] Finally, after all threads have finished executing, the return value of each thread is stored in the result array and sorted in ascending order of the year of the data. Thus, the spatiotemporal cube of natural resource element evolution is constructed in the form of data, which can be used to visualize the spatiotemporal cube.
[0068] S3. Analyze the relationships between all elements in adjacent sets of elements in the time dimension of the spatiotemporal cube, and construct the evolution chain of natural resource elements;
[0069] In step S2, the evolution results of the target element entity are obtained by constructing a spatiotemporal cube. However, the evolution process of natural resource elements needs to be reflected through the natural resource element evolution chain. Constructing the natural resource element evolution chain requires determining the changing relationships in the natural resource element evolution process. The experimental data of this invention is land resource data. After analyzing the data, the land change relationships are classified into three categories: two element entities in two adjacent years have no change, two element entities in two adjacent years have a merging relationship, and two element entities in two adjacent years have a splitting relationship. To determine the relationship between two element entities, the overlay analysis method is used. This involves performing an intersection operation on the two element entities. If the two entities truly intersect and their areas are equal to the intersection result, then the two entities remain unchanged. If an element entity from the previous year truly intersects with an element entity from the following year, and the area of the previous year's element entity is larger than the area of the intersection result, then a portion of the previous year's element entity has been incorporated into the following year's element entity. If an element entity from the previous year truly intersects with an element entity from the following year, and the area of the previous year's element entity is smaller than the area of the intersection result, then the previous year's element entity has been directly merged into the following year's element entity.
[0070] Based on the two-dimensional array obtained in row traversal step S2, each element entity in the current row is intersected with each element entity in the next row, and the relationship between the entities is determined. This operation aims to explore the evolution process of element entities over two consecutive years. The result is saved as graph data in a data structure, with two truly intersecting element entities as nodes, and each node corresponding to an element entity is unique. The relationships between element entities are represented as edges. When the array traversal is complete, the resulting graph represents the evolution chain of natural resource elements.
[0071] S4. Visualize the spatiotemporal cube of natural resource element evolution and the natural resource element evolution chain.
[0072] The visualization flowchart of the spatiotemporal cube of natural resource element evolution is as follows: Figure 4 As shown.
[0073] First, a 3D canvas is created using Three.js. This canvas has three dimensions: the x and y axes represent planar geographical locations, and the z-axis represents the time dimension. Unfortunately, Three.js does not provide a tool for directly parsing GeoJSON. Therefore, this invention iterates through each element entity in the GeoJSON and performs a 3D model for each element entity.
[0074] Specifically, in GeoJSON, the geometric data of each element entity is two-dimensional and consists of a large number of points. Using the `moveTo()` method of the `Shape` class in Three.js to connect each adjacent point yields a two-dimensional image of the element entity. However, in a 3D canvas, the two-dimensional image "disappears" when the viewpoint is parallel to the two-dimensional image plane. Therefore, the `ExtrudeGeometry` class in Three.js can be used to stretch the two-dimensional image along the z-axis, allowing the two-dimensional image to be observed even when the viewpoint is parallel to the two-dimensional image plane. The `render()` method of the 3D canvas object is then used to render the constructed 3D model of the element entity onto the 3D canvas. Once all 3D models are rendered, the 3D visualization of the natural resource element evolution spatiotemporal cube is complete.
[0075] like Figure 5 As shown, in the 3D image of the spatiotemporal cube of natural resource element evolution, the 3D images of element entities in the same year are rendered on the same plane, and these planes are all perpendicular to the z-axis and arranged at certain intervals, which can reflect the changes of the target element entities in the time dimension.
[0076] In contrast, visualizing the evolutionary chain of natural resource elements is much simpler. With Echarts, you can directly visualize the natural resource element evolutionary chain data constructed in step S3.
[0077] like Figure 6 As shown in the diagram. Circles represent element entities, the numbers in the center of the circles represent the element entity's ID, and arrows indicate the relationship between an element entity and a specific element entity in the following year. For example, element entity ID 4252 in 2017 remained unchanged compared to element entity ID 8020 in 2018. However, element entity ID 8020 in 2018 was split into element entities IDs 4714 and 4761 in 2019, and element entity ID 4761 in 2019 was merged into element entity ID 5504 in 2020.
[0078] The above description is not intended to limit the present invention in any way. Although the present invention has been disclosed through the above embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the present invention shall still fall within the scope of the present invention.
Claims
1. A method for analyzing the evolution of natural resource elements based on spatiotemporal cubes, characterized in that, Includes the following steps: S1. Parse the GIS data file and store it in the database; S2. Identify and locate the target element entity, and use GeoTools to overlay the target element entity with the set of all element entities in the time dimension to construct a spatiotemporal cube of natural resource element evolution. S21. Identify a target feature entity, and then use a database query statement to retrieve the geometric and attribute data of the target feature entity from the database. S22. Construct a source file information set by querying file information for all years except the year to which the target element entity belongs; S23. Using the year of the file as a parameter, traverse the source file information using the overlay analysis method; S24. Store the return value of each thread in the result array and sort it in ascending order of the year of the data; S3. Analyze the relationships between all elements in adjacent sets of elements in the time dimension of the spatiotemporal cube, and construct the evolution chain of natural resource elements; S4. Visualize the spatiotemporal cube of natural resource element evolution and the natural resource element evolution chain.
2. The method for natural resource element evolution analysis based on spatiotemporal cubes according to claim 1, characterized in that, The specific steps of step S1 are as follows: S11. Compress the GIS data of natural resource elements for each year into a separate zip file; S12. Then import the files into the parsing program one by one; S13. The parsing program performs validity verification on the imported file. If the imported file is invalid, the parsing program will automatically terminate. After the file passes the verification, the parsing program will decompress the zip file in the temporary file directory. S14. The parser creates a data object for each natural resource element entity and stores these objects in a list; S15. Use the .prj file in the temporary file directory and the CRS.lookupEpsgCode() method to obtain the projection coordinate system and geometric data and attribute data of natural resource element entities of GIS data, and save these data and projection coordinate system in the form of key-value pairs in a HashMap type data object. S16. After the file parsing is completed, the data in each data object, along with the year to which the Shapefile belongs, is persisted to the MySQL database as a row record.
3. The method for analyzing the evolution of natural resource elements based on a spatiotemporal cube according to claim 2, characterized in that, The verification items in step S3 include the import file naming format, file type, and file size.
4. The method for analyzing the evolution of natural resource elements based on a spatiotemporal cube according to claim 1, characterized in that, In step S21, the ST_asWKB() method is used in the query statement to convert the values of the geometry format inside the MySQL database into its WKB representation and return binary data. Then, the returned geometric binary data is converted into a Geometry class object.
5. The method for natural resource element evolution analysis based on spatiotemporal cubes according to claim 1, characterized in that, The specific process of step S23 is as follows: S231. Query all feature entities in the input year based on the document information, and construct the source feature entity set; S232. Then determine whether the projection space of the geometric data of the source element entity is consistent with the projection space of the geometric data of the target element entity. If they are inconsistent, use the JTS.transform() method to transform the geometric data of the target feature entity to the projection space of the geometric data of the source feature entity; S233. Next, iterate through the source element entity set and use the intersects() method of the Geometry class to determine whether the target element entity intersects with the source element entity. If they intersect, use the intersection() method of the Geometry class to overlay the target element entity with each source element entity and return the geometric data of the intersection. S234. Convert the returned results to the WGS84 projected coordinate system, and encapsulate the geometric data and attributes of each returned result into an internal object and store it in a temporary array. Store the source element entities that are intersecting with the target element entity in a two-dimensional array. Each row of the two-dimensional array represents the year, so source element entities in the same year are stored in the same row. S235. Encapsulate the data in the temporary array into GeoJSON format and use it as the return value of the overlay analysis method.
6. The method for natural resource element evolution analysis based on spatiotemporal cubes according to claim 1, characterized in that, The specific process of visualizing the spatiotemporal cube of natural resource element evolution in step S4 is as follows: S41. Create a 3D canvas using Three.js; S42. Use the moveTo() method of the Shape class in Three.js to connect each adjacent point of the geometric data of each feature entity in GeoJSON to obtain a two-dimensional image of the feature entity; S43. Use the ExtrudeGeometry class in Three.js to stretch a 2D image along the z-axis. S44. Use the render() method of the 3D canvas object to render the constructed 3D model of the element entity in the 3D canvas. S45. Once all 3D models are rendered, the 3D visualization of the spatiotemporal cube of the natural resource element evolution is complete.
7. The method for natural resource element evolution analysis based on spatiotemporal cubes according to claim 1, characterized in that, The specific process of visualizing the evolution chain of natural resource elements in step S4 is as follows: the natural resource element evolution chain diagram data constructed in step S3 is visualized directly using the Echarts tool.
Citation Information
Patent Citations
Ecological space network optimization method considering rationality of planning layout and part configuration
CN113326593A
Town settlement spatial evolution simulation prediction method and computer equipment
CN113642764A