GIS vector data processing method, device and system and storage medium
The MVT data is obtained and rendered by custom layer loading classes, and the compatibility problem of GIS vector data among different visual GIS front-end engines is solved, and high-performance GIS vector data visualization is achieved.
Patent Information
- Application Number
- CN202510584579.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-05
AI Technical Summary
In the prior art, GIS vector data has poor compatibility between different visual GIS front-end engines, resulting in poor visualization effects and slow loading speed.
The layer loading request is obtained through a custom layer loading class, the MVT data and MVT style data corresponding to the request are loaded, and rendered, realizing high-performance visualization of GIS vector data in different visual GIS front-end engines.
It realizes high-performance visualization of GIS vector data in different visualization GIS front-end engines, solves the problem of poor visualization effects, and improves loading speed and front-end rendering efficiency.
Smart Images

Figure CN120429374A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of geographic information technology, and in particular to a GIS vector data processing method, device, system and storage medium. Background Art
[0002] With the continuous development of geographic information system (GIS) technology, the demand for acquiring, processing, and visualizing geographic data is growing. Slicing services are more user-friendly for image maps, but slicing GIS vector data results in larger file sizes, consumes significant server and front-end resources, and produces mediocre display quality.
[0003] Vector Tile Servers, which use vector layers (GIS vector data) as the core layers of 2D and 3D map scenes, feature small data volumes, excellent visualization, and high front-end loading performance. However, vector tile servers from related technologies cannot be loaded on another platform due to poor platform compatibility. This results in slow loading of vector layers by the visualization GIS front-end engine, resulting in poor visualization. Summary of the Invention
[0004] In order to solve or partially solve the problems existing in the related technologies, the present application provides a GIS vector data processing method, device, system and storage medium, which can realize high-performance visualization of GIS vector data in different visualization GIS front-end engines.
[0005] In a first aspect, the present application provides a GIS vector data processing method, the method comprising: Get the layer loading request through the custom layer loading class; According to the layer loading request, load the MVT data corresponding to the layer loading request, and load the back-end customized MVT style data corresponding to the MVT data; The MVT data is rendered according to the MVT style data to dynamically present the MVT data.
[0006] Preferably, loading the MVT data corresponding to the layer loading request according to the layer loading request includes: Sending the layer loading request to the backend, so that the backend obtains the MVT data corresponding to the layer loading request; The MVT data corresponding to the layer loading request obtained by the backend is loaded, and the MVT data corresponding to the layer loading request is cached in a database.
[0007] Preferably, the backend obtains the MVT data corresponding to the layer loading request, including: If the backend queries the MVT data corresponding to the layer loading request on the server of the backend according to the layer loading request, the backend obtains the MVT data corresponding to the layer loading request stored in the server.
[0008] Preferably, the method further comprises: If the back-end server does not find the MVT data corresponding to the layer loading request based on the layer loading request, the back-end queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in the geographic information database based on the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into the MVT data corresponding to the layer loading request.
[0009] Preferably, the backend queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in a geographic information database according to the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into MVT data corresponding to the layer loading request, including: The backend parses the vector file containing geographic information to obtain geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file; The backend stores the geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file into the geographic information database; The backend uses the range query function of the geographic information database to calculate the geometric query range according to the layer loading request; The backend uses the intersection function of the geographic information database to query and obtain the geometric data and attribute data of the geometric primitives in the geometric query range in the geographic information database; The backend converts the geometric data and attribute data of the geometric primitives within the geometric query range into MVT data corresponding to the layer loading request based on the coordinate system information and the MVT conversion function of the geographic information database.
[0010] Preferably, the loading of the MVT data corresponding to the layer loading request acquired by the backend, and caching the MVT data corresponding to the layer loading request in a database, includes: Compressing the MVT data corresponding to the layer loading request by the backend to obtain the MVT data corresponding to the layer loading request after the backend compression; The back-end compressed MVT data corresponding to the layer loading request is loaded, and the compressed MVT data corresponding to the layer loading request is cached in a database.
[0011] Preferably, the method further comprises: Through custom interaction mechanisms and layer loading classes, query and dynamically present attribute data and / or geometric data of geometric primitives.
[0012] A second aspect of the present application provides a GIS vector data processing device, the device comprising: Data request module, used to obtain layer loading requests through a custom layer loading class; A data loading module is used to load the MVT data corresponding to the layer loading request obtained by the data request module, and load the MVT style data corresponding to the MVT data customized by the backend; The data rendering module is used to render the MVT data according to the MVT style data loaded by the data loading module, and dynamically present the MVT data.
[0013] A third aspect of the present application provides a GIS vector data processing system, the system comprising a front end and a back end; The front end is used to obtain a layer loading request through a customized layer loading class, load the MVT data corresponding to the layer loading request according to the layer loading request, and load the MVT style data corresponding to the MVT data customized by the back end, render the MVT data according to the MVT style data, and dynamically present the MVT data; The backend is used to customize MVT style data corresponding to the MVT data.
[0014] A fourth aspect of the present application provides an electronic device, including: processor; and The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method described above.
[0015] A fifth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor, the processor is caused to execute the method described above.
[0016] A sixth aspect of the present application provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, implements the method described above.
[0017] The technical solution provided by this application may include the following beneficial results: The technical solution of this application is that the front end obtains a layer loading request through a customized layer loading class; based on the layer loading request, it loads the MVT data corresponding to the layer loading request, as well as the MVT style data corresponding to the MVT data customized by the back end; and the MVT data is rendered based on the MVT style data to dynamically present the MVT data. The front end obtains the layer loading request through a customized layer loading class, and is able to load MVT data in a universal MVT format and MVT style data corresponding to the MVT data based on the layer loading request, and dynamically present the MVT data based on the MVT style data, thereby achieving high-performance visualization of GIS vector data on different visualization GIS front-end engines and resolving the problem of poor visualization of GIS vector data on different visualization GIS front-end engines. It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0019] Figure 1 1 is a flow chart of a GIS vector data processing method according to an embodiment of the present application; Figure 2 1 is another flowchart of the GIS vector data processing method shown in an embodiment of the present application; Figure 3 This is a schematic diagram of the process of obtaining MVT data and MVT style data at the back end of the GIS vector data processing method shown in an embodiment of the present application; Figure 4 This is a flow chart of the GIS vector data processing method shown in the embodiment of the present application implemented based on the Cesium visual GIS front-end engine; Figure 5 This is a flow chart of the GIS vector data processing method shown in the embodiment of the present application implemented by a visual GIS front-end engine based on Arcgis JS; Figure 6 This is a flow chart of the GIS vector data processing method shown in the embodiment of the present application implemented based on the Deck.gl visual GIS front-end engine; Figure 7 1 is a flow chart of rendering MVT data of a GIS vector data processing method according to an embodiment of the present application; Figure 8 Schematic diagram of the structure of the GIS vector data processing device shown in the embodiment of the present application; Figure 9 Schematic diagram of the structure of the GIS vector data processing system shown in the embodiment of the present application; Figure 10 It is a structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although the accompanying drawings illustrate embodiments of the present application, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0021] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0022] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0023] The embodiment of the present application provides a GIS vector data processing method, which can achieve high-performance visualization of GIS vector data in different visualization GIS front-end engines.
[0024] The following are some of the professional terms mentioned in this article: GIS (Geographic Information Science) service: An interface that can be used to load and display 3D services on the web.
[0025] PostGIS: A geographic information database. PostGIS is an extension of PostgreSQL, transforming it into a powerful spatial database system. It supports the storage, indexing, querying, and analysis of geospatial data, providing a range of spatial functions and operations that allow users to efficiently manage and query geospatial data. It is an essential component of geographic information system development.
[0026] MVT: Mapbox Vector Tile, a uniquely defined vector tile specification, is renowned for its lightweight data architecture. Designed specifically for hosting geographic vector data, such as points, lines, and polygons, this technology simplifies data slicing and facilitates instant client-side rendering, providing users with a seamless map experience.
[0027] Cesium: Cesium is a high-performance, open-source JavaScript library designed for creating rich 3D globe and 2D map visualizations in web browsers. It supports multiple geospatial data formats, provides dynamic data loading, real-time rendering, and a highly interactive user interface, making it ideal for building Web GIS applications.
[0028] ArcGIS JS, short for ArcGIS API for JavaScript, is a JavaScript API for building Web GIS applications. It allows developers to create interactive map applications in a web browser and integrate them with geographic data and analysis tools on the ArcGIS platform.
[0029] Deck.gl: Deck.gl has gradually become an open source project. It is a high-performance geographic data visualization library based on WebGL, which allows developers to render large-scale geographic data sets in web browsers.
[0030] The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0031] Figure 1 It is a flow chart of the GIS vector data processing method shown in the embodiment of the present application.
[0032] See also Figure 1 , a GIS vector data processing method, comprising: Step 101: Obtain a layer loading request through a custom layer loading class.
[0033] In one embodiment, the front end may implement a custom layer loading class; through the custom layer loading class, a layer loading request is obtained according to the user's layer request.
[0034] Step 102 : According to the layer loading request, the MVT data corresponding to the layer loading request is loaded, and the MVT style data corresponding to the MVT data customized by the backend is loaded.
[0035] In one embodiment, the front end may send a layer loading request to the back end. Based on the layer loading request, the back end may obtain MVT data corresponding to the layer loading request; based on the MVT data corresponding to the layer loading request, obtain MVT style data corresponding to the MVT data; and return the MVT data corresponding to the layer loading request and the MVT style data corresponding to the MVT data to the front end. The front end then loads the MVT data corresponding to the layer loading request and the MVT style data corresponding to the MVT data.
[0036] Step 103 : Render the MVT data according to the MVT style data to dynamically present the MVT data.
[0037] In one embodiment, the front end can parse the MVT data according to the loaded MVT style data to obtain the geometric data, attribute data and coordinate system information of the MVT data geometric primitives; and render the geometric data, attribute data and coordinate system information of the MVT data geometric primitives according to the MVT style data to dynamically present the geometric primitives of the MVT data.
[0038] In the GIS vector data processing method of the embodiment of the present application, the front end obtains a layer loading request through a customized layer loading class; based on the layer loading request, the MVT data corresponding to the layer loading request is loaded, as well as the MVT style data corresponding to the MVT data customized by the back end; the MVT data is rendered based on the MVT style data to dynamically present the MVT data. The front end obtains the layer loading request through the customized layer loading class, and is able to load MVT data in a universal MVT format and MVT style data corresponding to the MVT data based on the layer loading request, and dynamically present the MVT data based on the MVT style data, thereby achieving high-performance visualization of GIS vector data on different visualization GIS front-end engines and solving the problem of poor visualization of GIS vector data on different visualization GIS front-end engines.
[0039] Figure 2 1 is another flowchart of the GIS vector data processing method shown in an embodiment of the present application; Figure 3 This is a schematic diagram of the process of obtaining MVT data and MVT style data at the back end of the GIS vector data processing method shown in an embodiment of the present application; Figure 4This is a flow chart of the GIS vector data processing method shown in the embodiment of the present application implemented based on the Cesium visual GIS front-end engine; Figure 5 This is a flow chart of the vector data processing method shown in the embodiment of the present application implemented by a visual GIS front-end engine based on Arcgis JS; Figure 6 This is a flow chart of the GIS vector data processing method shown in the embodiment of the present application implemented based on the Deck.gl visual GIS front-end engine; Figure 7 It is a flow chart of rendering MVT data of the GIS vector data processing method shown in an embodiment of the present application.
[0040] See also Figure 2-Figure 7 , a GIS vector data processing method, comprising: Step 201: Store the vector file containing geographic information into a geographic information database.
[0041] In one embodiment, the backend parses the vector file containing geographic information to obtain the geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file; and stores the geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file into a geographic information database.
[0042] In one embodiment, a vector file containing geographic information can be uploaded to a designated server. The vector file includes but is not limited to SHP (hapefile, a vector data storage format used in geographic information systems), GeoJSON (a JSON-based geospatial data exchange format), KML (Keyhole Markup Language, a geospatial data markup language based on XML), and other vector data formats. The vector file contains geometric data, attribute data, and coordinate system information of various geometric elements such as points, lines, and surfaces.
[0043] In one embodiment, the backend can parse vector files from the server using the GeoTools library (a Java-based open source geospatial data processing library) to obtain geometric data, attribute data, and coordinate system information for various geometric entities, such as points, lines, and surfaces, contained in the vector file. The geometric data, attribute data, and coordinate system information for various geometric entities, such as points, lines, and surfaces, contained in the vector file are stored in a PostGIS database (a geographic information database, an open source spatial extension of the PostgreSQL database). A PG database table is created and the geometric data, attribute data, and coordinate system information are stored in the PG database table to store and manage the vector file for subsequent data processing and querying. Parsing vector files using the GeoTools library ensures that the data is accurately stored in the PostGIS database.
[0044] In one embodiment, the backend may be a Java (object-oriented programming language) backend.
[0045] Step 202: Implement a custom layer loading class.
[0046] In one embodiment, a custom layer loading class can be implemented in a visual GIS front-end engine based on the geometric data, attribute data, and coordinate system information of a PostGIS database. The visual GIS front-end engine includes but is not limited to a visual GIS front-end engine based on Cesium, a visual GIS front-end engine based on Arcgis JS, and a visual GIS front-end engine based on Deck.gl.
[0047] In one embodiment, a Cesium-based visual GIS front-end engine can implement a custom MVTProvider layer loading class based on the geometry data, attribute data, and coordinate system information of a PostGIS database. This class also implements custom properties for the MVTProvider layer loading class, including but not limited to rendering styles and tokens (map service access credentials). The rendering style can be configured using JSON to define the layer's rendering style (e.g., fill color, line width, and annotation rules).
[0048] In one embodiment, a custom MVT Provider layer loading class can be implemented in a Cesium-based visual GIS front-end engine by implementing custom methods such as fromUrl, resquestImage, pickFeatures, and destroy. fromUrl is used to receive the address of a vector service; resquestImage is used to return the rendered canvas; pickFeatures is used to return feature attribute data in response to a click event; and destroy is used to handle transactions when a layer is destroyed.
[0049] In one embodiment, the click event attribute query of pickFeatures can be implemented by receiving the layer level, layer name, and position parameters of the geometric element where the user interaction operation (such as clicking) is located, querying and parsing the MVT data, and reading the attribute data of the MVT data element.
[0050] In one embodiment, a custom MVT Layer loader class can be implemented in an ArcGIS JS-based visual GIS front-end engine based on the geometry data, attribute data, and coordinate system information of a PostGIS database. BaseTileLayer (base layer class) can be used to create an MVTLayer subclass, and the properties of the custom MVT Layer loader class can be customized. The properties of the custom MVT Layer loader class include, but are not limited to, a URL (Uniform Resource Locator), rendering style, minimum and maximum layer levels, and a token.
[0051] In one embodiment, a custom MVT Layer loading class can be implemented in an ArcGIS JS-based visual GIS front-end engine by implementing custom methods such as initialize and fetchTile. initialize is used for events to be implemented during class initialization, and fetchTile is used for each tile request, returning a canvas or image.
[0052] In one embodiment, for a visual GIS front-end engine based on Deck.gl, a customized MVTLayer layer loading class can be implemented in the visual GIS front-end engine based on Deck.gl according to the geometric data, attribute data, and coordinate system information of the PostGIS database.
[0053] In one embodiment, the layer loading class of Deck.gl can be defined as the MVTLayer layer loading class of the visual GIS front-end engine.
[0054] Step 203: Obtain a layer loading request through a custom layer loading class.
[0055] In one embodiment, the visual GIS front-end engine can obtain a layer loading request through a custom layer loading class. The visual GIS front-end engine can obtain a layer loading request based on a user's layer request (user interaction) through the custom layer loading class implemented in the visual GIS front-end engine. The layer loading request may include a layer level, position parameters (X, Y position), and a layer name.
[0056] Step 204 : According to the layer loading request, the MVT data corresponding to the layer loading request is loaded, and the MVT style data corresponding to the MVT data customized by the backend is loaded.
[0057] In one embodiment, the visual GIS front-end engine can send a layer loading request to the back-end, so that the back-end obtains the MVT data corresponding to the layer loading request, and obtains customized MVT style data corresponding to the MVT data based on the MVT data corresponding to the layer loading request; loads the MVT data corresponding to the layer loading request and the MVT style data corresponding to the MVT data obtained by the back-end, and caches the MVT data corresponding to the layer loading request in the database.
[0058] In one embodiment, MVT data is a type of vector data, including geometric data and attribute data of geometric figures. MVT style data (Mapbox Vector Tile Style) is vector tile data based on the MVT format, containing geometric figures, attribute fields and associated style rules, and is used to realize dynamic rendering and interaction of vector tiles in the visual GIS front-end engine. Vector tiles are vector data that cut geographic data into small units at the tile level, supporting multi-resolution loading and efficient transmission. MVT style data defines the visualization rules such as color, line width, text annotation, etc. for MVT data visualization, and is dynamically bound to vector tile attributes.
[0059] In one embodiment, the backend can obtain the MVT data corresponding to the layer loading request based on the layer loading request, and obtain customized MVT style data corresponding to the MVT data based on the MVT data corresponding to the layer loading request. The backend can obtain the MVT data corresponding to the layer loading request based on the layer loading request; based on the MVT data corresponding to the layer loading request, query the backend server whether there is MVT style data corresponding to the MVT data; if the backend server finds that there is MVT style data corresponding to the MVT data, then obtain the MVT style data corresponding to the MVT data from the backend server; if the backend server does not find the MVT style data corresponding to the MVT data, then customize the MVT style data corresponding to the MVT data based on the MVT data and the style standard of Mapbox, and obtain customized MVT style data corresponding to the MVT data.
[0060] In one embodiment, the backend can query the backend server whether there is MVT data corresponding to the layer loading request based on the layer loading request; if the backend queries the backend server for MVT data corresponding to the layer loading request based on the layer loading request, the backend obtains the MVT data corresponding to the layer loading request stored on the server.
[0061] In one embodiment, if the backend receives the layer loading request and the backend server does not find the MVT data corresponding to the layer loading request, the backend queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in the geographic information database based on the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into the MVT data corresponding to the layer loading request.
[0062] In one embodiment, the back end uses the range query function of the geographic information database to calculate the geometric query range according to the layer loading request; the back end uses the intersection function of the geographic information database to query and obtain the geometric data and attribute data of the geometric primitives within the geometric query range in the geographic information database; the back end uses the MVT conversion function of the geographic information database according to the coordinate system information to convert the geometric data and attribute data of the geometric primitives within the geometric query range into MVT data corresponding to the layer loading request.
[0063] In one embodiment, the backend can query the PG library table based on the layer level, location parameters, and layer name included in the layer load request, and dynamically extract the geometric data, attribute data, and coordinate system information corresponding to the layer load request from the PG library table in the PostGIS database. The range query function (ST_TileEnvelope) is used to calculate the geometric query range based on the layer level and X, Y position to implement a range query. The intersection function (ST_Intersects) is used to implement an intersection query within the geometric query range, querying the geometric data within the geometric query range to obtain the geometric data corresponding to the layer load request. The attribute data and coordinate system information corresponding to the layer load request are obtained based on an attribute query statement, where the attribute query statement can be a PostGIS query string generated by logically assembling the X, Y position, layer level, layer name, and coordinate system information. The MVT conversion function (ST_AsMVT) is used to implement data conversion, converting the geometric data, attribute data, and coordinate system information corresponding to the layer load request into MVT data in MVT format, and storing the MVT data on the backend server.
[0064] In one embodiment, the backend can perform file compression on the MVT data corresponding to the layer loading request to obtain the MVT data corresponding to the layer loading request compressed by the backend; the MVT data corresponding to the layer loading request compressed by the backend is loaded, and the compressed MVT data corresponding to the layer loading request is cached in the database.
[0065] In one embodiment, the visual GIS front-end engine can send a layer loading request to the back-end, so that the back-end obtains MVT data corresponding to the layer loading request; the back-end performs file compression on the MVT data corresponding to the layer loading request (for example, the back-end performs GZIP compression on the MVT data corresponding to the layer loading request, GZIP is the abbreviation of several file compression programs), and obtains the MVT data corresponding to the layer loading request compressed by the back-end; the MVT data corresponding to the layer loading request compressed by the back-end is loaded, and the compressed MVT data corresponding to the layer loading request is cached in the front-end indexDB database (a database that stores a large amount of structured data in a Web browser). The next time the visual GIS front-end engine requests MVT data based on a layer loading request, the visual GIS front-end engine can query whether there is MVT data corresponding to the layer loading request in the front-end indexDB database based on the layer loading request; if there is MVT data corresponding to the layer loading request in the indexDB database, the MVT data corresponding to the layer loading request in the front-end indexDB database is read without requesting MVT data from the back-end; if there is no MVT data corresponding to the layer loading request in the indexDB database, the MVT data corresponding to the layer loading request compressed by the back-end is loaded, and the compressed MVT data corresponding to the layer loading request is cached in the front-end indexDB database.
[0066] In the embodiment of the present application, combined with the cache mechanism, the front end caches the loaded compressed MVT data in the front end indexDB database. The front end can directly read the compressed MVT data from the front end indexDB database, further speeding up the response speed.
[0067] In an embodiment of the present application, the backend performs file compression on the MVT data, and the frontend loads the compressed MVT data from the backend, which can increase the transmission speed between the frontend and the backend. By performing file compression on the MVT data from the backend, the volume of the MVT data is significantly reduced, and the compression process reduces the bandwidth pressure on the backend server, which can significantly improve the stability and performance of the backend server, especially in high-concurrency scenarios. At the same time, the compressed MVT data is transmitted faster, reducing the time and bandwidth consumption of network transmission. The frontend can receive and render the MVT data more quickly, improving the user experience.
[0068] Step 205 : Render the MVT data according to the MVT style data to dynamically present the MVT data.
[0069] In one embodiment, the visual GIS front-end engine can parse MVT data based on MVT style data, extract the geometric data and attribute data of the MVT data geometric primitives, render the geometric data and attribute data of the MVT data geometric primitives based on the coordinate system information, and dynamically present various geometric primitives such as points, lines, and surfaces of the MVT data.
[0070] In one embodiment, the visual GIS front-end engine can pass in MVT data and MVT style data corresponding to the MVT data, import the "mvt-basic-render" library, obtain the style, canvas, token (map service access certificate), request method and other parameters of the MVT style data to implement BasicRenderer; create slices, calculate the spatial information of the slices based on the layer level, position parameters, and layer name of the layer loading request, set the slice to the canvas, and specify the size of the canvas; obtain the context data of the canvas; render the slice canvas based on the coordinate system information of the MVT data, the geometric data of the geometric primitives, and the attribute data, render the geometric data on the canvas, render the canvas of the geometric data based on the style, render the vector layer, and dynamically present the geometric primitives of the MVT data on the canvas to realize map loading.
[0071] In one embodiment, the visual GIS front-end engine can adjust the zoom level and layer transparency of the canvas according to the display parameters input by the user.
[0072] Step 206: query and dynamically present the attribute data and / or geometric data of the geometric primitives through the customized interaction mechanism and layer loading class.
[0073] In one embodiment, a user can perform interactive operations (such as click queries) on geometric primitives dynamically presented on the front end through a customized interactive mechanism and layer loading class of a visual GIS front end engine. The visual GIS front end engine can obtain the layer level, layer name, and location parameters of the geometric primitives where the user interacts through the customized interactive mechanism and layer loading class; generate an attribute query statement based on the layer level, layer name, and location parameters of the geometric primitives; and send the attribute query statement to the back end through the back end query interface so that the back end queries and returns the attribute data and geometric data of the geometric primitives; dynamically present the attribute data and geometric data of the geometric primitives returned by the back end to implement geometric queries and attribute queries of the geometric primitives; wherein, the geometric query includes geometric relationship queries such as intersection, containment, intersection, and overlap.
[0074] In one embodiment, a visual GIS front-end engine sends an attribute query statement to a back-end. Based on the attribute query statement, the back-end queries the attribute data and geometry data of geometric primitives in a PostGIS database, obtaining the attribute data and geometry data of the geometric primitives corresponding to the attribute query statement. The back-end converts the attribute data and geometry data of the geometric primitives corresponding to the attribute query statement into MVT data and MVT style data corresponding to the attribute query statement. The MVT data includes the attribute data and geometry data of the geometric primitives corresponding to the attribute query statement. The back-end compresses the MVT data and MVT style data corresponding to the attribute query statement and returns the compressed MVT data and MVT style data to the front-end. The front-end loads the compressed MVT data and MVT style data corresponding to the attribute query statement and renders the MVT data based on the MVT style data, dynamically presenting the MVT data corresponding to the attribute query statement, thereby implementing geometric and attribute queries of the geometric primitives. The embodiments of this application leverage the powerful functionality of the PostGIS database to support complex geometric primitive query operations, such as geometric queries for equality, intersection, containment, and overlap relationships. By visualizing geometric primitive query operations within the GIS front-end engine, query results are presented clearly and dynamically to users through intuitive visualization, enabling deep data insight and utilization, and providing strong data support for further geospatial analysis and mining (such as spatial query and statistical analysis).
[0075] In the GIS vector data processing method of the embodiment of the present application, the front end obtains a layer loading request through a customized layer loading class; according to the layer loading request, loads the MVT data corresponding to the layer loading request, and loads the MVT style data corresponding to the MVT data customized by the back end; renders the MVT data according to the MVT style data, and dynamically presents the MVT data. The front end obtains the layer loading request through the customized layer loading class, and can load the MVT data with a universal MVT format and the MVT style data corresponding to the MVT data according to the layer loading request, and dynamically presents the MVT data according to the MVT style data. By dynamically loading and rendering the MVT data, the front end can not only achieve high-performance visualization of GIS vector data in different visualization GIS front-end engines, but also achieve loading and rendering of GIS vector data on multi-engine platforms, solving the problem of poor visualization of GIS vector data in different visualization GIS front-end engines, but also can efficiently process large amounts of geographic information data, reducing memory usage and GPU resource consumption.
[0076] Furthermore, the GIS vector data processing method of the embodiment of the present application loads the MVT data corresponding to the layer loading request obtained by the back-end, and caches the MVT data corresponding to the layer loading request in the database to form a front-end cache, thereby speeding up the reading speed of GIS vector data, making the front-end rendering faster and the visualization performance better, and also reducing the pressure on the back-end.
[0077] Furthermore, in the GIS vector data processing method of the embodiment of the present application, the front end obtains a layer loading request through a customized layer loading class; if the back end does not find the MVT data corresponding to the layer loading request on the back end server according to the layer loading request, the back end queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in the PostGis database according to the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into the MVT data corresponding to the layer loading request; based on the PostGIS database, the geographic vector data is stored in the PostGIS database, and according to the data requirements of the GIS front end engines such as Cesium, Arcgis JS, and Deck.gl, the MVT data and MVT style data are generated through the JAVA back end, and a front end layer loading class is developed, and the customized layer loading class is used to implement the MVT data based on Cesium, Arcgis JS, and Deck.gl. The JS visual GIS front-end engine loads MVT data and MVT style data, and other visual GIS front-end engines with built-in MVT layers automatically load MVT data and MVT style data, realizing universal cross-platform GIS vector data loading, which can meet the loading of GIS vector data in different visual GIS front-end engines, and realize high-performance visualization of GIS vector data in different visual GIS front-end engines. The GIS vector data processing method of the embodiment of the present application has universality and high commercial value, can freely implement more loading and optimization logic, break through the closed-source technical solutions of GIS commercial companies, can reduce the cost of using GIS vector data to a certain extent, and improve the autonomous and controllable security of GIS vector data. The GIS vector data processing method of the embodiment of the present application can be widely used in many fields such as urban planning, environmental monitoring, and resource management, and provide strong support for the popularization and application of geographic information systems.
[0078] Furthermore, the GIS vector data processing method of the embodiment of the present application stores the geometric data and attribute data of the GIS vector data in a PostGIS database; through the JAVA backend, based on the layer level, location parameters, and layer name, the geometric data and attribute data of the PostGIS database are called using geometric query functions and attribute query statements, and the visualization style of the stored layer is edited according to the style standards of Mapbox, and MVT data and MVT style data are output. Through custom layers based on Cesium and Arcgis JS and layers of Deck.gl, the custom layers use the front-end canvas to load and display geometric data, parse MVT data based on MVT style data, and render the geometric data and attribute data of the MVT data in real time, thereby enabling the loading of GIS vector data by multiple different visual GIS front-end engines to meet the needs of diverse map scenarios. Compared with the related technologies of WMS (Web Map Service) and WMTS (Web Map Tile Service), the GIS vector data processing method of the embodiment of the present application generates MVT data with accompanying attributes through the back-end, and customizes MVT style data according to the accompanying attributes of the MVT data; the way of loading MVT data and MVT style data on the front-end is far more flexible than the vector layers of WMS and WMTS, and has better visualization performance.
[0079] Furthermore, the GIS vector data processing method of the present embodiment, through a customized interaction mechanism and layer loading class, queries and dynamically presents attribute data and / or geometric data of geometric primitives, enabling high-performance visualization and query capabilities for GIS vector data. Users can intuitively view and interact with geographic information through the visual GIS front-end engine, enhancing the visualization and practicality of maps.
[0080] Furthermore, the GIS vector data processing method of the present embodiment generates a universal vector map service that can be used with a variety of different visual GIS front-end engines, providing users with more options for map solutions. The rich rendering styles of MVT data enhance the degree of map customization. MVT data contains not only geometric data but also attribute data, making the vector layer not only a visual layer but also an interactive and queryable layer, improving the map user experience.
[0081] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a GIS vector data processing device, system, electronic device and corresponding embodiments.
[0082] Figure 8It is a structural diagram of a GIS vector data processing device shown in an embodiment of the present application.
[0083] See also Figure 8 A GIS vector data processing device includes a data request module 801, a data loading module 802, and a data rendering module 803.
[0084] The data request module 801 is used to obtain a layer loading request through a custom layer loading class.
[0085] In one embodiment, the front end may implement a custom layer loading class. The data request module 801 obtains a layer loading request based on the user's layer request through the custom layer loading class.
[0086] The data loading module 802 is used to load the MVT data corresponding to the layer loading request obtained by the data request module 801, and load the backend customized MVT style data corresponding to the MVT data.
[0087] In one embodiment, the front end can send a layer loading request to the back end. The back end can receive the MVT data corresponding to the layer loading request; based on the MVT data corresponding to the layer loading request, receive the MVT style data corresponding to the MVT data; and return the MVT data corresponding to the layer loading request and the MVT style data corresponding to the MVT data to the front end. Based on the layer loading request received by the data request module 801, the data loading module 802 loads the MVT data corresponding to the layer loading request and the MVT style data corresponding to the MVT data.
[0088] The data rendering module 803 is configured to render the MVT data according to the MVT style data loaded by the data loading module 802 , and dynamically present the MVT data. In one embodiment, the data rendering module 803 can parse the MVT data according to the MVT style data loaded by the data loading module 802 to obtain the geometric data, attribute data and coordinate system information of the geometric primitives of the MVT data; and render the geometric data, attribute data and coordinate system information of the geometric primitives of the MVT data according to the MVT style data to dynamically present the geometric primitives of the MVT data.
[0089] The technical solution of the embodiment of the present application is that the front end obtains a layer loading request through a customized layer loading class; based on the layer loading request, the MVT data corresponding to the layer loading request is loaded, as well as the MVT style data corresponding to the MVT data customized by the back end; the MVT data is rendered based on the MVT style data, and the MVT data is dynamically presented. The front end obtains the layer loading request through the customized layer loading class, and is able to load MVT data in a universal MVT format and MVT style data corresponding to the MVT data based on the layer loading request, and dynamically present the MVT data based on the MVT style data, thereby achieving high-performance visualization of GIS vector data on different visualization GIS front-end engines and solving the problem of poor visualization of GIS vector data on different visualization GIS front-end engines.
[0090] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0091] Figure 9 It is a structural diagram of the GIS vector data processing system shown in an embodiment of the present application.
[0092] See also Figure 9 , a GIS vector data processing system includes a front end 901 and a back end 902.
[0093] The front end 901 is used to obtain a layer loading request through a customized layer loading class, load the MVT data corresponding to the layer loading request according to the layer loading request, and load the MVT style data corresponding to the MVT data customized by the back end 902, render the MVT data according to the MVT style data, and dynamically present the MVT data.
[0094] The backend 902 is used to customize MVT style data corresponding to the MVT data.
[0095] In one embodiment, the front end 901 may be a visual GIS front end engine.
[0096] In one embodiment, the backend 902 may be a Java backend.
[0097] Regarding the system in the above embodiment, the specific manner in which the front end 901 and the back end 902 perform operations has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0098] Figure 10 It is a structural diagram of an electronic device shown in an embodiment of the present application.
[0099] See also Figure 10, the electronic device 1000 includes a memory 1010 and a processor 1020.
[0100] The processor 1020 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor. Memory 1010 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. ROM may store static data or instructions required by processor 1020 or other computer modules. Permanent storage may be a readable and writable storage device. Permanent storage may be a non-volatile storage device that retains stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device utilizes a mass storage device (e.g., a magnetic or optical disk, flash memory). In other embodiments, the permanent storage device may be a removable storage device (e.g., a floppy disk, optical drive). System memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory (DRAM). System memory may store some or all instructions and data required by the processor during operation. Furthermore, memory 1010 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), as well as magnetic disks and / or optical disks. In some embodiments, the memory 1010 may include a readable and / or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0101] The memory 1010 stores executable codes. When the executable codes are processed by the processor 1020 , the processor 1020 may execute part or all of the above-mentioned methods.
[0102] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0103] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium), which stores executable code (or computer program or computer instruction code) and, when executed by a processor of an electronic device (or server, or GIS vector data processing system, or GIS vector data processing device, etc.), enables the processor to execute part or all of the steps of the above-mentioned method according to the present application.
[0104] The present application also provides a computer program product, which includes computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.
[0105] The embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.
Claims
1. A GIS vector data processing method, characterized in that: include: Get the layer loading request through the custom layer loading class; According to the layer loading request, load the MVT data corresponding to the layer loading request, and load the back-end customized MVT style data corresponding to the MVT data; The MVT data is rendered according to the MVT style data to dynamically present the MVT data.
2. The method according to claim 1, characterized in that The step of loading the MVT data corresponding to the layer loading request according to the layer loading request includes: Sending the layer loading request to the backend, so that the backend obtains the MVT data corresponding to the layer loading request; The MVT data corresponding to the layer loading request obtained by the backend is loaded, and the MVT data corresponding to the layer loading request is cached in a database.
3. The method according to claim 2, characterized in that The backend obtains MVT data corresponding to the layer loading request, including: If the backend queries the MVT data corresponding to the layer loading request on the server of the backend according to the layer loading request, the backend obtains the MVT data corresponding to the layer loading request stored in the server.
4. The method according to claim 3, characterized in that The method further comprises: If the back-end server does not find the MVT data corresponding to the layer loading request based on the layer loading request, the back-end queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in the geographic information database based on the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into the MVT data corresponding to the layer loading request.
5. The method according to claim 4, characterized in that The backend queries and obtains the geometric data, attribute data, and coordinate system information corresponding to the layer loading request in the geographic information database according to the layer loading request, and converts the geometric data, attribute data, and coordinate system information corresponding to the layer loading request into MVT data corresponding to the layer loading request, including: The backend parses the vector file containing geographic information to obtain geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file; The backend stores the geometric data, attribute data, and coordinate system information of the geometric primitives contained in the vector file into the geographic information database; The backend uses the range query function of the geographic information database to calculate the geometric query range according to the layer loading request; The backend uses the intersection function of the geographic information database to query and obtain the geometric data and attribute data of the geometric primitives in the geometric query range in the geographic information database; The backend converts the geometric data and attribute data of the geometric primitives within the geometric query range into MVT data corresponding to the layer loading request based on the coordinate system information and the MVT conversion function of the geographic information database.
6. The method according to claim 2, characterized in that The loading of the MVT data corresponding to the layer loading request acquired by the backend, and caching the MVT data corresponding to the layer loading request in a database, includes: Compressing the MVT data corresponding to the layer loading request by the backend to obtain the MVT data corresponding to the layer loading request after the backend compression; The back-end compressed MVT data corresponding to the layer loading request is loaded, and the compressed MVT data corresponding to the layer loading request is cached in a database.
7. The method according to claim 1, characterized in that The method further comprises: Through custom interaction mechanisms and layer loading classes, query and dynamically present attribute data and / or geometric data of geometric primitives.
8. A GIS vector data processing device, characterized in that: include: Data request module, used to obtain layer loading requests through a custom layer loading class; A data loading module is used to load the MVT data corresponding to the layer loading request obtained by the data request module, and load the MVT style data corresponding to the MVT data customized by the backend; The data rendering module is used to render the MVT data according to the MVT style data loaded by the data loading module, and dynamically present the MVT data.
9. A GIS vector data processing system, characterized in that: Including front-end and back-end; The front end is used to obtain a layer loading request through a customized layer loading class, load the MVT data corresponding to the layer loading request according to the layer loading request, and load the MVT style data corresponding to the MVT data customized by the back end, render the MVT data according to the MVT style data, and dynamically present the MVT data; The backend is used to customize MVT style data corresponding to the MVT data.
10. A computer-readable storage medium, characterized in that: Executable codes are stored thereon, and when the executable codes are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 7.