Geospatial data processing method, device, equipment and storage medium
The GeoServer service framework is called by the server and layer permissions are dynamically configured, which solves the problem of separation of user management and permission configuration from GeoServer, improves flexibility and security, and simplifies the operation process.
Patent Information
- Application Number
- CN202411048354.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-08-01
AI Technical Summary
When publishing layers using GeoServer, user management and permission configuration are separated from GeoServer, making it difficult to dynamically configure layer permissions, affecting flexibility and security.
Through the server, we call the GeoServer service framework and dynamically configure layer permissions, including obtaining layer files and permission information, calling the layer publishing and permission management functions of the GeoServer service framework, configuring user permissions, and storing layer and permission information in the server.
It realizes dynamic configuration of layer permissions, improves the flexibility and security of publishing layers using GeoServer, and simplifies the user's operation process.
Smart Images

Figure CN118838976B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of map data processing technology, and in particular to a method, device, equipment and storage medium for processing geographic spatial data. Background Art
[0002] GeoServer is an open source server for publishing map data. It supports WMS and WFS features, allowing users to update, delete, and insert feature data, and quickly share spatial geographic information between users through GeoServer. Publishing layers is one of the core functions of GeoServer, which involves converting geographic data (vector or raster) into network-accessible map services.
[0003] In the related technology, when using GeoServer to publish a layer, it is necessary to select the data source to be published and configure the corresponding layer properties, such as the coordinate system and zoom level, and the corresponding access rights can also be configured. However, in the process of using GeoServer to publish a layer, user management and permission configuration are separated from GeoServer, and layer permissions need to be adjusted manually, which is difficult to configure dynamically. Summary of the invention
[0004] The purpose of this application is to provide a geospatial data processing method, apparatus, device and storage medium that can dynamically configure layer permissions and improve the flexibility and security of publishing layers using GeoServer.
[0005] The present application embodiment provides a method for processing geographic spatial data, which is applied to a server and includes:
[0006] Obtaining a layer file and permission information; the layer file includes the graphic style information of the geographic spatial data, and the permission information includes the user information with the viewing permission or the editing permission;
[0007] Calling the layer publishing function of the GeoServer service framework, and publishing the image style information in the layer file as a layer in the map server in the GeoServer service framework;
[0008] Calling the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result;
[0009] Performing user authority configuration in the server according to the authority information to obtain a second authority configuration result that matches the first authority configuration result;
[0010] According to the second permission configuration result, a service of viewing or dynamically editing the layer is provided to the user.
[0011] In some embodiments, before calling the layer publishing function of the GeoServer service framework to enable the GeoServer service framework to publish the image style information in the layer file as a layer in the map server, it also includes:
[0012] Performing file type identification on the layer file to obtain a file type identification result;
[0013] When the file type identification result indicates that the graphic style information in the layer file is used to update the published layer, the layer file is stored in a PostGIS database;
[0014] When the file type identification result indicates that the graphic style information in the layer file is used to publish a new layer, the layer file is stored in an object storage database.
[0015] In some embodiments, the calling of the layer publishing function of the GeoServer service framework so that the GeoServer service framework publishes the image style information in the layer file as a layer in the map server includes:
[0016] Call the corresponding interface to send the layer file to the GeoServer service framework or obtain the layer file from the storage warehouse of the GeoServer service framework;
[0017] Triggering the layer publishing function of the GeoServer service framework, so that the GeoServer service framework publishes the layer file as the layer in the workspace and storage warehouse corresponding to the user who uploaded the layer file;
[0018] The permission management function of the GeoServer service framework is triggered, so that the GeoServer service framework configures the layer so that only the user who uploaded the layer file can view or edit it.
[0019] In some embodiments, the calling of the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result includes:
[0020] Call the corresponding interface to send the permission information to the GeoServer service framework;
[0021] The permission management function of the GeoServer service framework is triggered, so that the GeoServer service framework uses the user permissions configured according to the permission information to overwrite the default user permissions of the layer, and obtains the first permission configuration result.
[0022] In some embodiments, performing user authority configuration in the server according to the authority information to obtain a second authority configuration result matching the first authority configuration result includes:
[0023] Storing the permission information and the layer in a corresponding storage space;
[0024] Establishing an association relationship between the user and the layer according to the permission information;
[0025] According to the association relationship, the permission of the user to view or edit the layer is configured to obtain the second permission configuration result.
[0026] In some embodiments, providing the user with a service of viewing or dynamically editing the layer according to the second permission configuration result includes:
[0027] Receiving a layer query request initiated by the user;
[0028] Determining, according to the second permission configuration result, whether the user has the query permission for the layer corresponding to the layer query request;
[0029] When it is determined that the user has the query authority, a target authority identifier is obtained, and a target request interface having the target authority identifier is intercepted;
[0030] Obtaining a permission statement corresponding to the target request interface, a permission field corresponding to the permission statement, and a target database statement corresponding to the permission field;
[0031] Concatenate the permission statement and the target database statement to obtain a permission-filtered concatenated statement;
[0032] According to the concatenated statements filtered by the permission, the corresponding layers are displayed to the user so that the user can view or edit the layers.
[0033] In some embodiments, the server is configured with a service framework built based on Spring Boot.
[0034] The present application also provides a geospatial data processing device, including:
[0035] The first module is used to obtain a layer file and permission information; the layer file contains the graphic style information of the geographic spatial data, and the permission information contains the user information with the viewing permission or the editing permission;
[0036] The second module is used to call the layer publishing function of the GeoServer service framework, and publish the image style information in the layer file as a layer in the map server in the GeoServer service framework;
[0037] The third module is used to call the permission management function of the GeoServer service framework, perform user permission configuration in the GeoServer service framework according to the permission information, and obtain a first permission configuration result;
[0038] A fourth module is used to perform user authority configuration in the server according to the authority information to obtain a second authority configuration result matching the first authority configuration result;
[0039] The fifth module is used to provide the user with a service of viewing or dynamically editing the layer according to the second permission configuration result.
[0040] An embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned geospatial data processing method when executing the computer program.
[0041] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned geospatial data processing method is implemented.
[0042] The beneficial effects of this application are as follows: by calling the GeoServer service framework through the server, the GeoServer service framework publishes the illustration style information in the layer file as a layer in the map server and performs user authority configuration, stores the published layer and the corresponding authority information in the server, configures the user authority according to the authority information in the server, and provides users with the service of consulting or dynamically editing the layer when the user interacts with the server. Since the layer publishing and authority configuration are performed by calling the GeoServer service framework, the process of users publishing layers through the GeoServer service framework and the process of consulting or editing layers can be simplified. In addition, since authority management, layer management and user management are performed on the server side, users can interact with the server to make the server perform corresponding calling operations or provide services for consulting or dynamically editing layers. Layer permissions can be dynamically configured to improve the flexibility and security of using GeoServer to publish layers. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of the geospatial data processing method provided in an embodiment of the present application.
[0044] Figure 2 It is a flowchart of the method before step S102 provided in an embodiment of the present application.
[0045] Figure 3 It is a flowchart of the specific method of step S102 provided in an embodiment of the present application.
[0046] Figure 4 It is a flowchart of the specific method of step S104 provided in an embodiment of the present application.
[0047] Figure 5 It is a flowchart of the specific method of step S105 provided in an embodiment of the present application.
[0048] Figure 6 It is a structural diagram of a geospatial data processing device provided in an embodiment of the present application.
[0049] Figure 7 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown can be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second" and the like in the specification, claims and drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] See also Figure 1 , Figure 1 is a flow chart of a method for processing geospatial data provided by an embodiment of the present application. In some embodiments of the present application, Figure 1 The method is applied to the server, which may include but is not limited to steps S101 to S105. Figure 1 These five steps are introduced in detail.
[0054] Step S101, obtaining layer files and permission information.
[0055] The layer file contains the graphic style information of the geospatial data, and the permission information contains the user information with the access permission or the editing permission. It can be understood that the permission information limits the users who can access or edit the graphic style information in the layer file. The layer file is a layer style file that can be supported and recognized by GeoServer, which stores the graphic style information of the geospatial data. The graphic style information in the layer file can be published as a layer in the map server through GeoServer, and the user information contained in the permission information corresponds to the user who has the permission to access or edit the layer.
[0056] In step S101, the user interacts with the server through the user-side terminal and uploads the prepared layer file and permission information to the server through the user-side terminal. The server obtains the layer file and permission information uploaded by the user, and parses the layer file and permission information to obtain the graphic style information of the geographic spatial data in the layer file and the user information in the permission information.
[0057] In a specific embodiment, the server is configured with a service framework based on Spring Boot. Spring Boot is a new framework provided by the Pivotal team. It encapsulates the complexity of the underlying framework through some built-in firmware. In many ways, it is also a "microframework" that allows developers to choose the part they need in the entire framework without using large or unnecessary runtime dependencies, and most Spring Boot projects only require a few configuration files.
[0058] Step S102, calling the layer publishing function of the GeoServer service framework, and publishing the image style information in the layer file as a layer in the map server in the GeoServer service framework.
[0059] In step S102, the server triggers the layer publishing function of the GeoServer service framework by calling the corresponding interface of the GeoServer service framework. The GeoServer service framework obtains the layer file from the server, parses the graphic style information in the layer file, publishes the graphic style information in the layer file as a layer in the map server, and sets the access rights of the layer to the default access rights.
[0060] See also Figure 2 In a specific embodiment, before step S102, steps S201 to S203 may also be included but are not limited to the following. Figure 2 These three steps are introduced in detail.
[0061] Step S201, performing file type identification on the layer file to obtain a file type identification result.
[0062] Step S202: When the file type identification result indicates that the graphic style information in the layer file is used to update the published layer, the layer file is stored in the PostGIS database.
[0063] Step S203, when the file type identification result indicates that the graphic style information in the layer file is used to publish a new layer, the layer file is stored in the object storage database.
[0064] In step S201 to step S203, the server identifies the file type of the layer file by identifying the file format of the layer file, uses the identification result of the file format as the file type identification result, and parses the layer file and stores it in the corresponding database according to the file type identification result.
[0065] Specifically, the file format of the layer file can be Shapfile format, GeoTIFF format and GeoJSON format. If the user needs to publish a new layer, a layer file in Shapfile format or GeoTIFF format can be created. If the user needs to update the published layer, a layer file in GeoJSON format can be created. After the server recognizes the file format of the layer file, it stores the layer files in Shapfile format and GeoTIFF format in the object storage database, and stores the layer files in GeoJSON format in the PostGIS database. When the server calls the layer publishing function of the GeoServer service framework, the GeoServer service framework obtains the corresponding layer file from the PostGIS database or object storage database, and publishes the image style information in the layer file as a layer in the map server in the GeoServer service framework.
[0066] See also Figure 3 In a specific embodiment, step S102 may specifically include but is not limited to steps S301 to S303. Figure 3 These three steps are introduced in detail.
[0067] Step S301, calling the corresponding interface, sending the layer file to the GeoServer service framework or obtaining the layer file from the storage warehouse of the GeoServer service framework.
[0068] Step S302, triggering the layer publishing function of the GeoServer service framework, so that the GeoServer service framework publishes the layer file as a layer in the workspace and storage warehouse corresponding to the user who uploaded the layer file.
[0069] Step S303, triggering the permission management function of the GeoServer service framework, so that the GeoServer service framework configures the layer so that only the user who uploaded the layer file can view or edit it.
[0070] In step S301, the server calls the corresponding interface to connect to the GeoServer service framework, logs in to the corresponding user account in the GeoServer service framework using the preset URL, user name and password, and sends the layer file uploaded by the user to the server to the GeoServer service framework, or receives the user's configuration instructions, configures the link source information in the storage warehouse of the GeoServer service framework, and obtains the layer file from the storage warehouse of the GeoServer service framework.
[0071] In step S302, the server calls the corresponding interface and initiates a layer publishing instruction to the GeoServer service framework, so that the GeoServer service framework publishes the graphic style information in the layer file as a layer in the map server. Before publishing the layer, first check whether the user's workspace and storage warehouse exist in the GeoServer service framework. If so, the GeoServer service framework publishes it as a layer in the workspace and storage warehouse corresponding to the user who uploaded the layer file. If not, create the user's workspace and storage warehouse, and then publish it as a layer in the workspace and storage warehouse corresponding to the user who uploaded the layer file.
[0072] In step S303, the server calls the corresponding interface and initiates a permission configuration instruction to the GeoServer service framework, so that the GeoServer service framework configures permissions for the layer and configures the layer so that only the user who uploaded the layer file can view or edit it, as the default permission configuration each time the layer is published.
[0073] Step S103, calling the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result.
[0074] In step S103, the server triggers the permission management function of the GeoServer service framework by calling the corresponding interface of the GeoServer service framework. The GeoServer service framework obtains permission information from the server and configures user permissions based on the permission information, so that the user corresponding to the permission information can view or modify the corresponding published layer, and obtain the first permission configuration result.
[0075] In a specific embodiment, step S103 may specifically include:
[0076] Call the corresponding interface and send the permission information to the GeoServer service framework;
[0077] The permission management function of the GeoServer service framework is triggered, so that the GeoServer service framework uses the user permissions configured according to the permission information to overwrite the default user permissions of the layer, and obtains the first permission configuration result.
[0078] More specifically, the server calls the corresponding interface to connect to the GeoServer service framework and sends the permission information to the GeoServer service framework. The server initiates a permission management instruction to the GeoServer service framework, triggering the permission management function of the GeoServer service framework, so that the GeoServer service framework configures user permissions according to the permission information, so that the user corresponding to the permission information can view or modify the corresponding published layers, and obtain the first permission configuration result.
[0079] Step S104: Perform user authority configuration in the server according to the authority information to obtain a second authority configuration result that matches the first authority configuration result.
[0080] In step S104, the server performs user authority configuration matching the GeoServer service framework according to the authority information, so that the second authority configuration result obtained by the user authority configuration matches the first authority configuration result obtained by the GeoServer service framework.
[0081] Specifically, the server stores each generated or updated layer and the corresponding permission information, and configures user permissions based on the permission information, so that users corresponding to the permission information can view or modify the corresponding published layers, and obtain the second permission configuration result, so that users can directly query the generated or updated layers at the server level.
[0082] See also Figure 4 In a specific embodiment, step S104 may specifically include but is not limited to steps S401 to S403. Figure 4 These three steps are introduced in detail.
[0083] Step S401, storing permission information and layers into corresponding storage space.
[0084] Step S402: establishing an association relationship between the user and the layer based on the permission information.
[0085] Step S403: According to the association relationship, the user's permission to view or edit the layer is configured to obtain a second permission configuration result.
[0086] In step S401 to step S403, the user information of the layer and the user is written into different tables respectively, and then according to the permission information, the user information of the user who can view or edit the corresponding layer is written into a separate table, so as to determine the association relationship between the user and the layer, and then according to the association relationship between the user and the layer, the user's permission to view or edit the layer is configured to obtain a second permission configuration result.
[0087] Exemplarily, a user information table, a resource information table, and a resource visible user table may be established, user information of each user may be written into the user information table, and the published layer may be written into the resource information table, and then, according to the permission information, the user information of the user who can view or edit the corresponding layer may be written into the resource visible user table, thereby establishing an association relationship between the user and the layer, and the permission of the user to view or edit the layer may be configured according to the user information table, the resource information table, and the resource visible user table. Further, on the basis of the above exemplary embodiment, group management may be performed on the users, and a user group table, a resource visible group table, and a user record table within the group may be additionally established, and user information of several users may be written into the user group table as a group, and according to the permission information, the user information of the group that can view or edit the corresponding layer may be written into the resource visible group table, and the viewing or editing behavior of the users within the group may be written into the user record table within the group, thereby configuring the permission of the user to view or edit the layer according to the user information table, the resource information table, the resource visible user table, the user group table, the resource visible group table, and the user record table within the group.
[0088] Step S105: providing the user with a service of viewing or dynamically editing the layer according to the second permission configuration result.
[0089] In step S105, the server provides a service of viewing or dynamically editing the layer at the server level to users who meet the permission conditions according to the second permission configuration result.
[0090] Specifically, the user interacts with the server through the user-side terminal. The user initiates a layer query request to the server through the user-side terminal. The server verifies the layer query request and displays the layers that the user has the right to view or edit based on the user's permission configuration in the second permission configuration result.
[0091] See also Figure 5 In a specific embodiment, step S105 may specifically include but is not limited to steps S501 to S506. Figure 5 These six steps are introduced in detail.
[0092] Step S501, receiving a layer query request initiated by a user.
[0093] Step S502: Determine whether the user has the query permission for the layer corresponding to the layer query request based on the second permission configuration result.
[0094] Step S503, when it is determined that the user has the query authority, the target authority identifier is obtained, and the target request interface with the target authority identifier is intercepted.
[0095] Step S504, obtaining the permission statement corresponding to the target request interface, the permission field corresponding to the permission statement, and the target database statement corresponding to the permission field.
[0096] Step S505, concatenating the permission statement and the target database statement to obtain a permission-filtered concatenated statement.
[0097] Step S506, based on the concatenated statement after the permission filtering, the corresponding layer is displayed to the user for the user to view or edit the layer.
[0098] In step S501, the query permission refers to the set of layers for viewing or editing, and the layer query request is a request issued by the user to view or edit the layer. Based on the server receiving the layer query request, when the server receives the layer query request, it is determined according to the preset filter whether the user who sends the layer query request has the query permission of the layer. Specifically, when the layer query request for the layer arrives at the server, the layer query request is parsed to obtain the layer of the URL (Uniform Resource Locator); then, it is searched from the target chart whether there is a keyword matching the layer, if there is such a keyword, the key value corresponding to the keyword is read, and the key value is referenced to the array; then, it continues to search backward until the target chart is searched. As a result, there will be permission filter references arranged in the search order in the array, and when all permission filters in the array are executed, jump to the layer corresponding to the layer query request. It is determined by the permission filter whether the URL address can be accessed by the user, and if not, it jumps to the login interface.
[0099] In step S502, when it is determined that the user has the query permission, the target permission identifier is obtained. The target permission identifier is a pre-set data permission identifier. For the target request interface that needs to be processed by permission, the target request interface will be identified in advance by the target permission identifier. When the target permission identifier is obtained, the request interface with the target permission identifier is intercepted by a preset aspect interceptor, such as an aspect interceptor based on AOP (Aspect Oriented Programming). Specifically, AOP (Aspect Oriented Programming) is a technology that implements unified maintenance of program functions through pre-compilation and dynamic proxy during operation. When the target permission identifier is obtained, the pre-compiled interception code is obtained, and all the total request interfaces are intercepted according to the interception code corresponding to the aspect interceptor, and it is determined whether each total request interface has the target permission identifier. If it has the target permission identifier, the total request interface is determined to be the target request interface, and the target request interface is intercepted; for the total request interface that does not have the target permission identifier, the total request interface is passed.
[0100] In step S503, the permission statement includes a role and a permission list. When a target request interface with a target permission filter identifier is intercepted, the request parameter corresponding to the target request interface is obtained. The request parameter is filled with the permission statement obtained in advance through the permission center. The permission statement corresponding to the target request interface can be obtained according to the request parameter. Then, the permission field and the target database statement corresponding to the permission field are obtained through a preset permission interceptor (such as mybatis interceptor). Among them, the permission field is the pre-set field information for permission filtering, and the target database statement is the target spliced database statement, which is generally a business statement.
[0101] In step S504, after obtaining the permission statement and the target database statement, the permission statement is spliced into the target database statement as a subquery, thereby achieving permission filtering of the target database statement. Specifically, in SQL, a SELECT-FROM-WHERE statement is called a query block. A query block nested in the WHERE clause or HAVING phrase of another query block is called a subquery or inner query. The upper query block is the parent query or outer query. The result of the subquery is passed back to the "parent query" or "outer query" as input. The subquery is essentially a complete SELECT statement. The target database statement is the database statement corresponding to the field in the current permission statement.
[0102] In step S505, when the permission statement and the target database statement corresponding to the permission statement are obtained, the permission statement is spliced into the target database statement as a subquery of the target database statement, that is, the spliced statement after permission filtering is obtained. The spliced statement is stored in the database, and when the user queries the data with permission, the corresponding data can be obtained from the database according to the spliced statement.
[0103] In step S506, when the user queries the layer for which he has query permission, the server can obtain the corresponding layer from the database according to the concatenated statement after permission filtering, and display the layer that the user wants to query to the user so that the user can view or edit the layer.
[0104] See also Figure 6 The embodiment of the present application further provides a geospatial data processing device, which can implement the above-mentioned geospatial data processing method, and the device includes:
[0105] The first module 601 is used to obtain a layer file and permission information; the layer file includes the graphic style information of the geographic spatial data, and the permission information includes the user information with the viewing permission or the editing permission;
[0106] The second module 602 is used to call the layer publishing function of the GeoServer service framework, and publish the image style information in the layer file as a layer in the map server in the GeoServer service framework;
[0107] The third module 603 is used to call the permission management function of the GeoServer service framework, perform user permission configuration according to the permission information in the GeoServer service framework, and obtain a first permission configuration result;
[0108] The fourth module 604 is used to perform user authority configuration in the server according to the authority information, and obtain a second authority configuration result that matches the first authority configuration result;
[0109] The fifth module 605 is used to provide the user with a service of viewing or dynamically editing the layer according to the second permission configuration result.
[0110] The specific implementation of the geospatial data processing device is substantially the same as the specific implementation of the above-mentioned geospatial data processing method, and will not be described in detail herein.
[0111] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.
[0112] Refer to the following Figure 7 An electronic device 700 according to this embodiment of the present disclosure is described. Figure 7The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0113] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), a display unit 740, etc.
[0114] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 executes the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned geospatial data processing method section of this specification.
[0115] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 7201 and / or a cache storage unit 7202 , and may further include a read-only storage unit (ROM) 7203 .
[0116] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0117] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0118] The electronic device 700 may also communicate with one or more external devices 700' (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 750. Furthermore, the electronic device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0119] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned geospatial data processing method is implemented.
[0120] The geospatial data processing method, device, equipment and storage medium provided in the embodiment of the present application call the GeoServer service framework through the server, so that the GeoServer service framework publishes the illustration style information in the layer file as the layer in the map server and performs user authority configuration, stores the published layer and the corresponding authority information in the server, performs user authority configuration according to the authority information in the server, and provides users with the service of viewing or dynamically editing the layer when the user interacts with the server. Since the layer publishing and authority configuration are performed by calling the GeoServer service framework, the process of users publishing layers through the GeoServer service framework and the process of viewing or editing layers can be simplified. In addition, since authority management, layer management and user management are performed on the server side, users can interact with the server to make the server perform corresponding call operations or provide services for viewing or dynamically editing layers. Layer permissions can be dynamically configured to improve the flexibility and security of using GeoServer to publish layers.
[0121] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.
[0122] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0123] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0124] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0125] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0126] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0127] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A method for processing geographic spatial data, applied to a server, characterized in that: include: Obtaining a layer file and permission information; the layer file includes the graphic style information of the geographic spatial data, and the permission information includes the user information with the viewing permission or the editing permission; Calling the layer publishing function of the GeoServer service framework, and publishing the image style information in the layer file as a layer in the map server in the GeoServer service framework; Calling the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result; Performing user authority configuration in the server according to the authority information to obtain a second authority configuration result that matches the first authority configuration result; According to the second permission configuration result, providing the user with a service of viewing or dynamically editing the layer; The calling of the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result includes: Call the corresponding interface to send the permission information to the GeoServer service framework; Triggering the permission management function of the GeoServer service framework, so that the GeoServer service framework uses the user permission configured according to the permission information to overwrite the default user permission of the layer, and obtains the first permission configuration result; Performing user authority configuration in the server according to the authority information to obtain a second authority configuration result matching the first authority configuration result includes: Storing the permission information and the layer in a corresponding storage space; Establishing an association relationship between the user and the layer according to the permission information; According to the association relationship, the permission of the user to view or edit the layer is configured to obtain the second permission configuration result.
2. The method for processing geospatial data according to claim 1, characterized in that: Before calling the layer publishing function of the GeoServer service framework to make the GeoServer service framework publish the image style information in the layer file as a layer in the map server, it also includes: Performing file type identification on the layer file to obtain a file type identification result; When the file type identification result indicates that the graphic style information in the layer file is used to update the published layer, the layer file is stored in a PostGIS database; When the file type identification result indicates that the graphic style information in the layer file is used to publish a new layer, the layer file is stored in an object storage database.
3. The method for processing geospatial data according to claim 1, characterized in that: The calling of the layer publishing function of the GeoServer service framework enables the GeoServer service framework to publish the image style information in the layer file as a layer in the map server, including: Call the corresponding interface to send the layer file to the GeoServer service framework or obtain the layer file from the storage warehouse of the GeoServer service framework; Triggering the layer publishing function of the GeoServer service framework, so that the GeoServer service framework publishes the layer file as the layer in the workspace and storage warehouse corresponding to the user who uploaded the layer file; The permission management function of the GeoServer service framework is triggered, so that the GeoServer service framework configures the layer so that only the user who uploaded the layer file can view or edit it.
4. The method for processing geospatial data according to claim 1, characterized in that: The providing the user with a service of viewing or dynamically editing the layer according to the second permission configuration result includes: Receiving a layer query request initiated by the user; Determining, according to the second permission configuration result, whether the user has the query permission for the layer corresponding to the layer query request; When it is determined that the user has the query authority, a target authority identifier is obtained, and a target request interface having the target authority identifier is intercepted; Obtaining a permission statement corresponding to the target request interface, a permission field corresponding to the permission statement, and a target database statement corresponding to the permission field; Concatenate the permission statement and the target database statement to obtain a permission-filtered concatenated statement; According to the concatenated statements filtered by the permission, the corresponding layers are displayed to the user so that the user can view or edit the layers.
5. The method for processing geospatial data according to any one of claims 1 to 4, characterized in that: The server is configured with a service framework built based on Spring Boot.
6. A geospatial data processing device, characterized in that: include: The first module is used to obtain a layer file and permission information; the layer file contains the graphic style information of the geographic spatial data, and the permission information contains the user information with the viewing permission or the editing permission; The second module is used to call the layer publishing function of the GeoServer service framework, and publish the image style information in the layer file as a layer in the map server in the GeoServer service framework; The third module is used to call the permission management function of the GeoServer service framework, perform user permission configuration in the GeoServer service framework according to the permission information, and obtain a first permission configuration result; A fourth module is used to perform user authority configuration in the server according to the authority information to obtain a second authority configuration result matching the first authority configuration result; A fifth module, configured to provide the user with a service of viewing or dynamically editing the layer according to the second permission configuration result; The calling of the permission management function of the GeoServer service framework, performing user permission configuration in the GeoServer service framework according to the permission information, and obtaining a first permission configuration result includes: Call the corresponding interface to send the permission information to the GeoServer service framework; Triggering the permission management function of the GeoServer service framework, so that the GeoServer service framework uses the user permission configured according to the permission information to overwrite the default user permission of the layer, and obtains the first permission configuration result; Performing user authority configuration in the server according to the authority information to obtain a second authority configuration result matching the first authority configuration result includes: Storing the permission information and the layer in a corresponding storage space; Establishing an association relationship between the user and the layer according to the permission information; According to the association relationship, the permission of the user to view or edit the layer is configured to obtain the second permission configuration result.
7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the geospatial data processing method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the geospatial data processing method according to any one of claims 1 to 5 is implemented.