A method and system for multi-source GIS layer integration and visualization based on MCP
Patent Information
- Application Number
- CN202511289255.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-10
- Publication Date
- 2026-11-03
AI Technical Summary
Existing GIS service systems suffer from high user barriers, heterogeneous protocols, and a lack of intelligent interaction, making it difficult to achieve unified management and intelligent operation of multi-source GIS services.
Employing the MCP protocol and a large language model, and through a natural language interaction mechanism, it achieves unified access and intelligent management of multi-source GIS layers. It utilizes the large language model for semantic analysis and CQL filter construction to generate query conditions and filtering rules, supporting complex query logic.
It reduces the complexity of user operations, achieves protocol independence and intelligent interaction, supports multi-format sorting, and improves the availability and intelligence level of geographic information services.
Smart Images

Figure CN123030694A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of Geographic Information Systems (GIS) and Artificial Intelligence Interaction Technology, and more specifically, to a method and system for multi-source GIS layer integration and visualization based on MCP. Background Technology
[0002] With the deepening of digital transformation, Geographic Information Systems (GIS) are playing an increasingly important role in key areas such as smart city construction, environmental monitoring, natural resource management, emergency response, and urban planning. However, the integration and management of multi-source GIS service layers currently faces significant technical bottlenecks and challenges.
[0003] Traditional GIS services require users to have a professional geographic information technology background and must master complex parameter configuration methods, including technical details such as coordinate system settings, layer style configuration, and spatial query syntax. Ordinary users, relying only on basic information such as layer names, cannot complete basic operations such as service registration, layer queries, and data filtering through intuitive natural language commands, which severely limits the widespread application of GIS technology.
[0004] Furthermore, existing GIS service integration systems suffer from compatibility issues when handling OGC standard services from different vendors and versions. The lack of a unified access mechanism between different protocol standards such as WMS, WFS, and WMTS necessitates users mastering different operating methods for different service types, hindering integrated layer management and data access. Simultaneously, current GIS service integration systems generally lack deep integration with artificial intelligence technologies, failing to achieve intelligent service discovery, automated parameter configuration, and automatic generation of complex query conditions. Particularly when handling complex spatial query requirements, the system cannot understand users' natural language descriptions, nor can it automatically generate corresponding query conditions, filtering rules, and visualization results, thus limiting the system's level of intelligence.
[0005] In view of the above, this application is hereby submitted. Summary of the Invention
[0006] This invention aims to provide a method and system for multi-source GIS layer integration and visualization based on MCP, in order to solve the complex integration and management problems caused by heterogeneous protocols, high user thresholds, and lack of intelligent interaction in existing multi-source GIS services. By introducing the MCP protocol, unified access to multi-source GIS layers is achieved, and the user's operational complexity is significantly reduced by combining a natural language interaction mechanism driven by a large language model.
[0007] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution: A multi-source GIS layer integration and visualization method based on MCP, applied to an intelligent agent client, includes: S1, obtain user request information; S2, based on the MCP protocol, the user request information is identified through a large language model, a request for integrating multi-source GIS layers is formed, and the request is sent to the server. S3. Based on the user request information, obtain the basic layer information extracted by the server from the multi-source GIS layer, construct the layer request URL and send it to the server; S4. Obtain the map parameters and visualization results calculated by the server based on the layer request URL, and display the visualization results.
[0008] Preferably, it also includes applications on the server side: Based on the MCP protocol, the system receives requests for multi-source GIS layers from intelligent agent clients and accesses external GIS servers to call the services corresponding to the multi-source GIS layers. The multi-source GIS layers consist of links to several GIS services from different sources and using different protocols. The service types of the multi-source GIS layers include: WMS layers, and / or WMTS layers, and / or WFS layers. The multi-source GIS layers are batch input into the registration tool for preprocessing, the service type is identified, and the service address is parsed using the OGC parser to obtain the basic information of the layers. Based on the basic information of the layer, and in conjunction with the external GIS server, FastMCP is used to declare dynamic template resources to dynamically obtain layer access parameters, and these parameters are sent to the intelligent agent client along with the basic information of the layer. Receive the layer construction request URL sent by the intelligent agent client; The map parameters and visualization results are calculated based on the layer request URL and sent to the agent client.
[0009] Preferably, the basic information of the layer includes: service title, service address, service type, layer name, layer title and layer description.
[0010] Preferably, S3 specifically comprises: Based on the user request information, the large language model selects the required layer basic information, sets the parameter threshold, and encapsulates it into JSON query parameters in JSON format. Based on the selected layer's basic information, the layer tool is used for parsing. Combined with JSON query parameters, a CQL filter is used to convert the abstract query logic into parameters that the GIS service can recognize, generating the layer request URL and a preprocessed layer object containing complete information. The CQL filter is uniformly managed by the CQLFilterBuilder class, which is used to decompose complex query parameters and construct the final layer request URL through type recognition, operator mapping, and logical sorting.
[0011] Preferably, the layer request URL includes: The service type identifier, and / or request type, and / or bounding box, and / or coordinate system, and / or format, and / or legend URL of the WMS layer; The service type identifier, and / or request type, and / or bounding box, and / or tile matrix level, and / or coordinate system, and / or tile format of the WMTS layer; The WFS layer's service type identifier, and / or request type, and / or bounding box, and / or attribute type, and / or attribute name, and / or attribute actual value, and / or spatial reference system.
[0012] Preferably, the map parameters and visualization results are calculated based on the layer request URL, specifically as follows: Define a global layer list to store the preprocessed layer objects; The large language model selects the main layer from the global layer list for map configuration, extracts key spatial features from the basic information of the main layer as the basis for map parameter calculation, and calculates the map parameters. By combining the user request information with the map parameters, the built-in spatial calculation tool is invoked to generate a visualization result and a link to the visualization result is provided. The main layer is a preprocessed layer object selected from the global layer list, which serves as the core benchmark and configuration basis for map visualization and is used to provide a basic reference framework for the entire map scene. The map parameters include: center point coordinates, zoom level, projection method, viewport range, and resolution.
[0013] Preferably, the user request information includes layer integration and layer visualization.
[0014] This invention also provides a multi-source GIS layer integration and visualization system based on MCP, comprising: This includes both the agent client and server. The intelligent agent client is used to obtain user request information and, based on the MCP protocol, identify the user request information through a large language model to form a request for integrating multi-source GIS layers and send it to the server. The server is used to receive requests for multi-source GIS layers sent by intelligent agent clients based on the MCP protocol, and to access external GIS servers to call the services corresponding to the multi-source GIS layers; wherein, the multi-source GIS layer is composed of several GIS service links from different sources and with different protocols; the service types of the multi-source GIS layer include: WMS layer, and / or WMTS layer, and / or WFS layer; The multi-source GIS layers are then batch-input into the registration tool for preprocessing to identify the service type. The OGC parser is then used to parse the service address to obtain the basic information of the layer. In addition, based on the basic layer information, FastMCP is used to declare dynamic template resources to dynamically obtain layer access parameters and send them to the client; The client is also used to obtain the basic layer information sent by the server based on the user request information, construct the layer request URL and send it to the server; The server is also used to receive the layer construction request URL sent by the agent client, calculate the map parameters and visualization results based on the layer request URL, and send them to the agent client. The client is also used to obtain the map parameters and visualization results calculated by the server based on the layer request URL, and to display the visualization results.
[0015] The present invention also provides a multi-source GIS layer integration and visualization device based on MCP, including a processor and a memory. The memory stores a computer program that can be executed by the processor to realize the multi-source GIS layer integration and visualization method based on MCP as described above.
[0016] The present invention also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor of the device on which the computer-readable storage medium resides, implement the MCP-based multi-source GIS layer integration and visualization method described above.
[0017] In summary, compared with the prior art, the present invention has the following beneficial effects: This invention enables users to complete complex geographic information system services simply by inputting basic information such as layer names, through a large language model. It effectively addresses the limitations of existing technologies, such as high user barriers, heterogeneous protocols, and a lack of intelligent interaction. This provides strong technical support for building an intelligent and universal geographic information service ecosystem, specifically including: (1) Protocol independence: The unified access of multi-source GIS layers is achieved through the MCP protocol, and users do not need to worry about the differences in underlying protocols and complex layer parameter configurations; (2) Intelligent parameter parsing: Using a large language model to perform semantic analysis on the user's natural language input, automatically generating query conditions and filtering rules; (3) CQL filter construction: Flexible query condition construction is achieved through three levels: intelligent type recognition, operator mapping and logical combination, which supports complex query logic; (4) Natural language interaction: Through natural language interaction driven by a large language model, traditional GIS operations that require professional technical background are transformed into intuitive natural language commands.
[0018] Through the aforementioned technological innovations, this invention successfully solves key problems such as the decentralized management of multi-source GIS service layers, high user barriers, and lack of intelligent interaction, providing important technical support for building an intelligent geographic information service ecosystem. This invention is applicable to cross-domain GIS resource integration application scenarios such as smart cities, environmental monitoring, emergency management, and urban planning, significantly improving the availability and intelligence level of geographic information services. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a multi-source GIS layer integration and visualization method based on MCP, as provided in Example 1.
[0021] Figure 2 This is an overall architecture diagram of a multi-source GIS layer integration and visualization method based on MCP, provided in Example 1.
[0022] Figure 3 This is a schematic diagram of layer integration provided in Example 1.
[0023] Figure 4This is a schematic diagram illustrating the results of a user using the natural language integration service provided in Example 1.
[0024] Figure 5 This is a flowchart illustrating how a user views a layer using natural language, as provided in Example 1.
[0025] Figure 6 This is a visualization diagram of how a user views a layer using natural language, as provided in Example 1.
[0026] Figure 7 This is a flowchart illustrating how a user views a filter layer using natural language, as provided in Example 1.
[0027] Figure 8 This is a visualization diagram of how a user views a filter layer using natural language, as provided in Example 1.
[0028] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0030] Example 1 Embodiment 1 of the present invention provides a method for multi-source GIS layer integration and visualization based on MCP, which can be implemented by a multi-source GIS layer integration and visualization device based on MCP (hereinafter referred to as visualization device), and in particular, executed by one or more processors within the visualization device.
[0031] In this embodiment, the visualization device may be an electronic device equipped with a processor, which carries a computer program for the MCP-based multi-source GIS layer integration and visualization method and the computer program can be executed, such as a computer, smartphone, smart tablet, workstation, etc., without limitation.
[0032] In this embodiment, MCP (Model Context Protocol) is an open standard protocol launched by Anthropic in November 2024. It aims to provide a unified framework for the interaction between large language models (LLMs) and external data sources, tools, and systems, promoting the standardization and decentralization of AI applications. Its core objective is to reduce the complexity of integrating models with diverse resources, improve security, flexibility, and scalability, and become a "universal language" in the AI field by standardizing communication rules.
[0033] In this embodiment, the core interaction mechanism of the MCP protocol is to achieve collaborative work between the client and the server in the integration of multi-source GIS layers, parameter parsing, and visualization configuration through a standardized "request-parsing-integration-response" closed-loop process. Its core objective is to solve the protocol differences between heterogeneous GIS services (such as WMS, WMTS, and WFS) and achieve "one request, multi-source adaptation, and unified output".
[0034] like Figure 1 As shown, a multi-source GIS layer integration and visualization method based on MCP is applied to an intelligent agent client, which includes steps S1 to S4.
[0035] S1, obtain user request information.
[0036] The user request information includes requests for layer integration and layer visualization.
[0037] This step collects users' original requirements for GIS layer integration and visualization, providing input for subsequent processing.
[0038] like Figure 2 As shown, the system of this invention adopts a client-server architecture and includes the following key components: Intelligent Agent Client: The AI intelligent agent client running MCP (such as intelligent development tools, chatbots) is responsible for initializing the client, managing user authorization, aggregating context information, and initiating service requests (such as requesting map services from the GISMCP server framework) or subscribing to resource updates through the MCP protocol to obtain timely information on changes in relevant resources.
[0039] GIS MCP Server (Server-side): The bridge between the AI agent client and the external GIS server, handling protocol communication, message routing, capability management, and subscription management to ensure secure and efficient interaction. Its functions include maintaining connection status, parsing requests / responses, managing permissions, registering with external map services, data discovery, map data analysis and processing, and calculating and outputting visualization results.
[0040] External GIS Servers: Provide external online map data (such as GeoServer, ArcGIS Server, MapServer, QGIS Server, etc.). This online map data is published externally in the form of OGC standard map services and can be accessed by the GISMCP Server through standards such as WMS (Web Map Service), WFS (Web Feature Service), and WMTS (Web Map Tile Service).
[0041] The server is responsible for providing data acquisition and tool invocation functions, mainly including basic layer information, access parameters, layer list tools, WFS attribute retrieval tools, WMS layer addition tools, WMTS layer addition tools, WFS layer addition tools, and visualization tools. The client interacts with the user through natural language and fulfills the user's requests by invoking the aforementioned tools.
[0042] The client provides diverse interactive entry points, such as text input boxes (supporting natural language descriptions), graphical selection interfaces (such as "Add Layer" buttons and layer type dropdown menus), and voice input, making it convenient for users to express their needs.
[0043] Example: The user inputs "Overlay the building outline layer and traffic flow layer of Chaoyang District, Beijing, and display road sections with a traffic flow greater than 5000".
[0044] S2, based on the MCP protocol, identifies the user request information through a large language model, forms a request for integrating multi-source GIS layers, and sends it to the server.
[0045] The goal of this step is to analyze user requirements, integrate multi-source GIS layers through the MCP protocol, and submit them to the server for processing.
[0046] First, the client's built-in large language model performs semantic parsing of user requests to clarify the core requirements.
[0047] Before semantic parsing, user request information can be preprocessed and validated. Request preprocessing includes standardizing the format of the original request on the client side, removing redundant information (such as interjections and repetitive descriptions), and extracting key elements (geographical scope: Chaoyang District, Beijing; layer type: building outline, traffic flow; filtering conditions, such as traffic flow > 5000). Request validation includes verifying the validity of the request (such as whether it contains the necessary geographic scope or layer type), and prompting the user to supplement any missing key information (such as no geographic scope specified) via a pop-up window.
[0048] Next, the system analyzes and determines the type of GIS service the user needs (such as WMS, WMTS, WFS). For example, a "building outline layer" usually corresponds to WFS (vector features), while a "traffic flow layer" may correspond to WMS (rendered image).
[0049] The system recommends compatible multi-source GIS layers based on the built-in layer resource library (such as a directory of commonly used GIS services). For example, "Building outlines of Chaoyang District, Beijing" corresponds to Alibaba Cloud WFS service, and "Traffic flow" corresponds to Gaode WMS service. The types of multi-source GIS layers include: WMS layer (web map service), and / or WMTS layer (web map tile service), and / or WFS layer (web feature service).
[0050] The client, following the MCP protocol specification, converts the identified layer requirements into standardized multi-source GIS layer requirements and sends them to the server through the MCP protocol communication interface (such as HTTP / HTTPS).
[0051] like Figure 3 The layer integration diagram shown integrates all layers from different sources and protocols, so users don't need to worry about the source or protocol, but only about which layers are present. Figure 3 The numbers 1 and -10 represent the order of operations: "1" indicates that the external layer is registered with the registry center; "2" indicates that the layer information is converted into MCP Resources and MCP Tools call parameters; "3" indicates that MCP Resources and Tools are exposed to the agent; "4 / 7" indicates that the agent calls the MCP tool and returns the result to the agent; "5 / 6" indicates that the MCP tool calls the external layer service resources and returns the intermediate layer results and visualization results; "8" indicates that the agent generates the answer and visualization link in the chat window; "9 / 10" indicates that the final visualization result can be viewed through the map browsing service via the link in the chat window.
[0052] Specifically, based on the MCP protocol, the server receives requests for multi-source GIS layers sent by the intelligent agent client and accesses an external GIS server to call the services corresponding to the multi-source GIS layers.
[0053] On the server side, the multi-source GIS layers are batch-input into the registration tool for preprocessing. The registration tool preprocesses each URL to remove redundant parameters, such as removing the wfs endpoint from http: / / localhost:8090 / geoserver / wfs. Endpoint discovery is performed after link preprocessing, such as Figure 3As shown, the service types of endpoints such as WMS under the preprocessed service address are identified, and the service capability documents of the available endpoints under the service address are parsed using the OGC parser to obtain the basic information of the layer.
[0054] The basic information of the layers is stored in the database, and the database is deduplicated and cleaned. The basic information includes service title, service address, service type, layer name, layer title, and layer description.
[0055] For example, for the WMS layer, parameters such as service type identifier, request type, bounding box, coordinate system, format, and legend URL are parsed; for the WMTS layer, parameters such as service type identifier, request type, bounding box, tile matrix level, coordinate system, and tile format are parsed; for the WFS layer, parameters such as service type identifier, request type, bounding box, attribute type, attribute name, attribute actual value, and spatial reference system are parsed.
[0056] Use FastMCP to declare a static list resource URI: ogc: / / layers, connect to the database manager, create a resource repository instance to execute queries, obtain the object list and convert it into a dictionary, build the MCP resource response, convert the database layer information table such as service name, layer name, etc. into MCP resources, and return the basic information of all registered layer lists.
[0057] After the server extracts the basic layer information, it returns structured basic layer information (in a unified format based on the MCP protocol) to the client.
[0058] Specifically, based on the basic layer information, the server uses FastMCP to declare a dynamic template resource URI: ogc / / layer / {layer_name} to dynamically obtain layer access parameters and send them to the client.
[0059] like Figure 4 As shown, the final output of the large language model of the intelligent agent client shows that the registration was successful, with 4 services and 58 layers registered.
[0060] In this embodiment, the OGC parser is the core component of the server for processing multi-source GIS layers. It is mainly used to parse the metadata and service capabilities of GIS services (such as WMS, WMTS, WFS, etc.) that conform to the OGC (Open Geospatial Consortium) standard, and extract basic layer information (such as service address, layer range, supported operations, etc.) to provide standardized data support for subsequent layer integration and parameter generation.
[0061] S3. Based on the user request information, obtain the basic layer information extracted by the server from the multi-source GIS layer, construct the layer request URL, and send it to the server.
[0062] In this step, the agent client receives the basic layer information from the server.
[0063] The large language model of the intelligent agent client selects the required layer basic information, sets the parameter threshold, and encapsulates it into JSON query parameters in JSON format based on the filtering conditions in the user request (i.e., the user request information).
[0064] Specifically, the large language model first performs deep semantic analysis on the user request, breaking it down into core elements related to the layer query (such as geographical scope, attribute filtering, sorting method, etc.). The large language model then calls the "layer basic information" returned by the MCP server (including the layer's attribute fields, data types, value ranges, etc.) to match the core elements of the user's needs, determining which requirements can be supported by the current layer. For successfully matched constraints, reasonable thresholds are set based on the actual characteristics of the layer data (such as attribute value ranges, data distribution) to ensure that the query results are both user-relevant and practical. The large language model obtains statistical information about layer attributes (such as maximum, minimum, average, and common values) through the server interface to avoid setting unrealistic thresholds. Simultaneously, the large language model dynamically adjusts the threshold granularity based on the user's request scenario (such as daily browsing or professional analysis). Finally, it encapsulates the results into a standardized JSON format, providing a clear basis for subsequent layer request URL construction and data filtering. The JSON query parameters must include core fields such as filters, sorting, display attributes, result limits, and logic.
[0065] Based on the selected layer's basic information, the layer tool parses the data and combines it with JSON query parameters. Then, a CQL filter (server-side) is invoked to convert the abstract query logic into parameters recognizable by the GIS service, generating the layer request URL and a preprocessed layer object containing complete information. The CQL filter is uniformly managed by the CQLFilterBuilder class, which decomposes complex query parameters and constructs the final layer request URL through type recognition, operator mapping, and logical sorting.
[0066] Specifically, type recognition can leverage large language models to extract core information from user requests through named entity recognition and intent classification. For example, a user request might be: "Overlay building outlines and traffic flow layers of Pudong New Area, Shanghai, displaying buildings larger than 2000㎡ and road segments with traffic flow exceeding 5000, ranked by the top 10 from highest to lowest traffic flow." The key information extracted would be: Geographical range: Pudong New Area, Shanghai (BBOX: 121.50, 31.14, 121.80, 31.38). Attribute filtering: Building area > 2000㎡, traffic flow > 5000; Results restrictions: sorted by traffic in descending order, threshold limit=10; Visualization requirement: Overlay building outline (WFS) + traffic flow (WMS) layers.
[0067] Then, based on the "layer basic information" (including metadata such as attribute name, data type, and value range) returned by the MCP server, the precise association between requirements and attributes is achieved through keyword mapping and semantic similarity matching.
[0068] When selecting rules, if it is necessary to simultaneously meet the user's needs and the characteristics of layer attributes, the attribute selection rules and operator selection rules should be satisfied to ensure the rationality and feasibility of parameter settings.
[0069] The goal of intelligent type recognition is to automatically determine the data type (numeric, string, or date) corresponding to the attribute values input by the user (such as "2000", "community park", "2010-01-01"). Preprocessing can be done using a rule engine, such as using regular expressions and format matching to initially classify the attribute values, followed by a second judgment using a Naive Bayes classifier to unify the format of the identified types.
[0070] The goal of operator mapping is to map user natural language constraints (such as "greater than", "contains", "between") to standard operators supported by OGC. A "natural language keyword-constraint intent" mapping table can be constructed to determine the user's constraint type through keyword matching; combined with the results of "intelligent type recognition", the final operator is determined through a three-dimensional "data type-constraint intent-operator" mapping table; the "operator compatibility interface" of the MCP server is called to verify whether the mapped operator is supported by the current layer; if supported, the operator is directly output; if not supported, it is automatically downgraded to a compatible operator.
[0071] The layer request URL includes: the service type identifier, and / or request type, and / or bounding box, and / or coordinate system, and / or format, and / or legend URL for the WMS layer; the service type identifier, and / or request type, and / or bounding box, and / or tile matrix level, and / or coordinate system, and / or tile format for the WMTS layer; and the service type identifier, and / or request type, and / or bounding box, and / or attribute type, and / or attribute name, and / or attribute actual value, and / or spatial reference system for the WFS layer.
[0072] In this step, the large language model first calls the layer list tool to obtain the basic layer information of all WMS / WMTS / WFS layers on the server; the layer list tool uses ctx.read.resource to access the static list resource.
[0073] For example, constructing the WMS layer request URL: The Add WMS Layer tool uses ctx.read.resource to access dynamic template resources. The large language model, based on user needs, passes the basic information of the selected WMS layer as a parameter to the Add WMS Layer tool, which constructs the request URL of the WMS layer and generates a preprocessed layer object.
[0074] Constructing the WMTS layer request URL: The Add WMTS layer tool uses ctx.read.resource to access dynamic template resources. The large language model, based on user needs, passes the basic information of the selected WMTS layer as parameters to the Add WMTS layer tool, which constructs the request URL for the WMTS layer and generates a preprocessed layer object. Guide the construction of WFS layers in the large language model by requesting URLs: the WFS property tool and the WFS layer addition tool use ctx.read.resource to access dynamic template resources. Specifically, firstly, real values of non-repeating WFS layer attributes are collected as examples. These example values are then cleaned to construct a structured list of feature information. The large language model identifies key information based on user needs, matches user requirements with available attributes, selects appropriate attributes and operators, determines the sorting fields and direction, selects attribute fields of interest to the user, sets reasonable thresholds, and encapsulates all decisions into JSON-formatted query parameters. The layer name and JSON query parameters are input, and the server constructs a CQL (Common Query Language) filter, managed uniformly by the CQLFilterBuilder class. Complex query logic is decomposed into composable atomic operations, and query conditions are constructed through intelligent type recognition, operator mapping, and logical combination. During sorting, sorting conditions are processed by the SortBuilder class. When constructing the final URL, an intelligent parameter combination strategy is adopted. This strategy adapts user sorting requirements (e.g., ascending / descending order by a certain attribute) to GIS service protocol specifications (e.g., OGC WFS / WMTS standards), layer attribute characteristics (e.g., data types, supported sorting operations), and URL syntax rules to generate legal, efficient, and user-intended sorting parameters.
[0075] In this embodiment, the CQLFilterBuilder class is a utility class that encapsulates the CQL query construction logic. Its core function is to automatically convert "user requirements" or "structured parameters" into valid CQL filtering expressions, avoiding the complexity of manually writing CQL syntax. The CQLFilterBuilder class first needs to identify the data type of the attribute to be filtered and the data type of the user input value, and then match valid operators (such as ">" and "<" for numeric types, and "LIKE" and "=" for string types). If the "attribute type" does not match the "user input value type", CQLFilterBuilder will trigger the validation logic to avoid invalid queries.
[0076] In this embodiment, "logical sorting combination" means that when a user request contains multiple filtering conditions (such as "show areas built after 2023, located in Beijing, and are key schools"), the CQLFilterBuilder class combines these conditions into an ordered and valid CQL expression according to "logical priority + user intent". Its core is "processing single conditions first, then combining multiple conditions, and finally optimizing the sorting".
[0077] like Figure 5As shown, the user inputs "View population information for each state in the United States". First, the large language model calls the layer list tool to guide it in identifying the WFS layer containing US state boundaries and population attributes. Then, it calls the WFS attribute retrieval tool as a prerequisite for calling the WFS layer addition tool. Collect real values of WFS layer attributes that are not repeated as examples, such as real values of attributes like population and state. Clean the example values and build a structured list of feature information, including: attribute name, data type, array of example values, and usage examples. Based on user needs and these guidelines, the large language model encapsulates all decisions into JSON-formatted query parameters {"display_attributes":["STATE_NAME","POPULATION"]}, passes these parameters to the WFS layer addition tool, and finally stores the processed layer parameters in the server's global layer list.
[0078] like Figure 7 As shown, the user inputs "Display and visualize US states with a water area greater than 10,000 square kilometers and a population exceeding 5 million". The large language model, based on user needs and guidance, encapsulates all decisions into {"filters": [{"attribute":"WATER_AREA_KM","values":["10000"],"operator":">"},{"attribute":"POPULATION","values":["5000000"],"operator":">"}],"display_attributes":["STATE_NAME","WATER_AREA_KM","POPULATION","LAND_AREA_KM"],"sort":{"attribute":"WATER_AREA_KM","order":"desc"},"logic":"AND","limit":100} Pass the parameters to the Add WFS Layer tool and save the processed layer parameters to the global layer list.
[0079] S4. Obtain the map parameters and visualization results calculated by the server based on the layer request URL, and display the visualization results.
[0080] On the server side, a global layer list is defined to store the preprocessed layer objects; Select the main layer from the global layer list to configure the map, calculate map parameters based on the main layer configuration, generate visualization results, and provide a web link to the results; wherein, the main layer is a preprocessed layer object selected from the global layer list, which serves as the core benchmark and configuration basis for map visualization and is used to provide a basic reference framework for the entire map scene.
[0081] Specifically, a three-tiered algorithm framework of "user requirement analysis → main layer feature extraction → dynamic parameter calculation" is adopted to realize the transformation from abstract requirements to specific parameters: Demand parsing layer: Extracts the user's spatial intent (such as "view the center of Beijing" or "zoom in to a certain area") through natural language understanding, and determines the target of parameter calculation (such as "focus on a specific area" or "cover multiple layers"). Layer Feature Layer: Extracts key spatial features (such as boundary range, coordinate system, and precision level) from the basic information of the main layer as the basis for parameter calculation; Parameter calculation layer: Based on the information from the first two layers, it calls the built-in spatial calculation tools (such as bounding box analysis, scale conversion, and coordinate transformation) to generate map initialization parameters, and verifies the rationality of the parameters through the rule engine.
[0082] When calculating map parameters on the server side, it is necessary to ensure that the parameters meet user requirements and are adapted to the characteristics of the main layer. The core map parameters that need to be calculated include: center point coordinates, zoom level, projection method, viewport range, resolution, etc. Each parameter can be calculated using existing technologies, and no restrictions are imposed here.
[0083] After calculating the parameters, the rule engine can be used for multi-dimensional validation to ensure that the parameters are valid and meet user experience requirements. For example, boundary validation checks whether the center point is within the viewport range and whether the scaling level is within the range supported by the main layer; compatibility validation checks whether the calculated and transformed parameters are valid if the coordinate system of the overlay layer is different from that of the main layer.
[0084] The agent client calls a link to load the visualization results from the server and displays the visualization results. For example... Figure 6 and Figure 8 As shown, the blue area represents the WFS vector data for the US states. The highlighted information displays the attribute information preserved by the large language model. The number of blue areas varies depending on the different filtering conditions.
[0085] In actual operation, users input request information through the client, which then passes this information to a large language model for semantic analysis. For example, if a user inputs "integrate multiple GIS services and view the population distribution of a specific area," the client will parse this request using the large language model. The large language model will identify the user's key intent as "integrate" and / or "view," and extract "multiple GIS services" and "population distribution of a specific area" as parameters. Subsequently, based on the user's intent, the appropriate tools or services on the server will be invoked to complete the operation.
[0086] In summary, compared with the prior art, the present invention has the following beneficial effects: This invention achieves protocol independence, eliminating the need for users to concern themselves with underlying protocol differences and complex layer parameter configurations. Through intelligent parameter parsing and CQL filter construction, it supports complex query logic and multi-format sorting functions, significantly reducing user operational complexity. Simultaneously, through a natural language interaction mechanism driven by a large language model, it transforms traditional GIS operations requiring specialized technical backgrounds into intuitive natural language commands, making it suitable for cross-domain GIS resource integration applications such as smart cities, environmental monitoring, emergency management, and urban planning.
[0087] This invention enables users to complete complex geographic information system services simply by inputting basic information such as layer names, through a large language model. It effectively addresses the limitations of existing technologies, such as high user barriers, heterogeneous protocols, and a lack of intelligent interaction, providing strong technical support for building an intelligent and universal geographic information service ecosystem. Specifically, the beneficial effects include: (1) Protocol independence: The unified access of multi-source GIS layers is achieved through the MCP protocol, and users do not need to worry about the differences in underlying protocols and complex layer parameter configurations; (2) Intelligent parameter parsing: Using a large language model to perform semantic analysis on the user's natural language input, automatically generating query conditions and filtering rules; (3) CQL filter construction: Flexible query condition construction is achieved through three levels: intelligent type recognition, operator mapping and logical combination, which supports complex query logic; (4) Multi-format sorting support: Adopting a multi-format compatible design strategy, it supports sorting condition input in string format, dictionary format and array format; (5) Natural language interaction: Through natural language interaction driven by a large language model, traditional GIS operations that require professional technical background are transformed into intuitive natural language commands.
[0088] Through the aforementioned technological innovations, this invention successfully solves key problems such as the decentralized management of multi-source GIS service layers, high user barriers, and lack of intelligent interaction, providing crucial technical support for building an intelligent geographic information service ecosystem. In particular, this invention is applicable to cross-domain GIS resource integration application scenarios such as smart cities, environmental monitoring, emergency management, and urban planning, significantly improving the availability and intelligence level of geographic information services. Example 2 The second embodiment of the present invention also provides a multi-source GIS layer integration and visualization system based on MCP, comprising an intelligent agent client and a server; The intelligent agent client is used to obtain user request information and, based on the MCP protocol, identify the user request information through a large language model to form a request for integrating multi-source GIS layers and send it to the server. The server is used to receive requests for multi-source GIS layers sent by intelligent agent clients based on the MCP protocol, and to access external GIS servers to call the services corresponding to the multi-source GIS layers; wherein, the multi-source GIS layer is composed of several GIS service links from different sources and with different protocols; the service types of the multi-source GIS layer include: WMS layer, and / or WMTS layer, and / or WFS layer; The multi-source GIS layers are then batch-input into the registration tool for preprocessing to identify the service type. The OGC parser is then used to parse the service address to obtain the basic information of the layer. Furthermore, based on the basic layer information and in conjunction with an external GIS server, FastMCP is used to declare dynamic template resources to dynamically obtain layer access parameters, which are then sent to the intelligent agent client along with the basic layer information. The client is also used to obtain the basic layer information sent by the server based on the user request information, construct the layer request URL and send it to the server; The server is also used to receive the layer construction request URL sent by the agent client, calculate the map parameters and visualization results based on the layer request URL, and send them to the agent client. The client is also used to obtain the map parameters and visualization results calculated by the server based on the layer request URL, and to display the visualization results.
[0089] In the several embodiments provided in this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus and method embodiments described above are merely illustrative. For example, the flowcharts in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in the flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0090] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0091] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. In the absence of further restrictions, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0092] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0093] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0094] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0095] The use of "first" and "second" in the embodiments is merely to distinguish similar objects and does not represent a specific ordering of objects. It is understood that "first" and "second" can be interchanged in a specific order or sequence where permitted. It should be understood that the objects distinguished by "first" and "second" can be interchanged where appropriate so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0096] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for multi-source GIS layer integration and visualization based on MCP, applied to an intelligent agent client, characterized in that, include: S1, obtain user request information; S2, based on the MCP protocol, identifies the user request information through a large language model, forms a request for integrating multi-source GIS layers, and sends it to the server; S3. Based on the user request information, obtain the basic layer information extracted by the server from the multi-source GIS layer, construct the layer request URL and send it to the server. S4. Obtain the map parameters and visualization results calculated by the server based on the layer request URL, and display the visualization results.
2. The method for multi-source GIS layer integration and visualization based on MCP according to claim 1, characterized in that... It also includes applications on the server side: Based on the MCP protocol, the system receives requests for multi-source GIS layers from intelligent agent clients and accesses external GIS servers to call the services corresponding to the multi-source GIS layers. The multi-source GIS layers consist of links to several GIS services from different sources and using different protocols. The service types of the multi-source GIS layers include: WMS layers, and / or WMTS layers, and / or WFS layers. The multi-source GIS layers are batch input into the registration tool for preprocessing, the service type is identified, and the service address is parsed using the OGC parser to obtain the basic information of the layers. Based on the basic information of the layer, and in conjunction with the external GIS server, FastMCP is used to declare dynamic template resources to dynamically obtain layer access parameters, and these parameters are sent to the intelligent agent client along with the basic information of the layer. Receive the layer construction request URL sent by the intelligent agent client; The map parameters and visualization results are calculated based on the layer request URL and sent to the agent client.
3. The method for multi-source GIS layer integration and visualization based on MCP according to claim 2, characterized in that... The basic information of the layer includes: service title, service address, service type, layer name, layer title and layer description.
4. The method for multi-source GIS layer integration and visualization based on MCP according to claim 3, characterized in that... S3 specifically refers to: Based on the user request information, the large language model selects the required layer basic information, sets the parameter threshold, and encapsulates it into JSON query parameters in JSON format. Based on the selected layer's basic information, the layer tool parses the data and combines it with JSON query parameters. Then, it calls the server-side CQL filter to convert the abstract query logic into parameters that the GIS service can recognize, generating the layer request URL and a preprocessed layer object containing complete information. The CQL filter is uniformly managed by the CQLFilterBuilder class, which is used to decompose complex query parameters and construct the final layer request URL through type recognition, operator mapping, and logical sorting.
5. A method for multi-source GIS layer integration and visualization based on MCP according to claim 2, characterized in that... The layer request URL includes: The service type identifier, and / or request type, and / or bounding box, and / or coordinate system, and / or format, and / or legend URL of the WMS layer; The service type identifier, and / or request type, and / or bounding box, and / or tile matrix level, and / or coordinate system, and / or tile format of the WMTS layer; The WFS layer's service type identifier, and / or request type, and / or bounding box, and / or attribute type, and / or attribute name, and / or attribute actual value, and / or spatial reference system.
6. The method for multi-source GIS layer integration and visualization based on MCP according to claim 4, characterized in that... The map parameters and visualization results are calculated based on the layer request URL, specifically as follows: Define a global layer list to store the preprocessed layer objects; Select the main layer from the global layer list to configure the map, extract key spatial features from the basic information of the main layer as the basis for calculating map parameters, and calculate the map parameters. By combining the user request information with the map parameters, the built-in spatial calculation tool is invoked to generate a visualization result and a link to the visualization result is provided. The main layer is a preprocessed layer object selected from the global layer list, which serves as the core benchmark and configuration basis for map visualization and is used to provide a basic reference framework for the entire map scene. The map parameters include: center point coordinates, zoom level, projection method, viewport range, and resolution.
7. The method for multi-source GIS layer integration and visualization based on MCP according to claim 1, characterized in that... The user request information includes layer integration and layer visualization.
8. A multi-source GIS layer integration and visualization system based on MCP, characterized in that, This includes both the agent client and server. The intelligent agent client is used to obtain user request information and, based on the MCP protocol, identify the user request information through a large language model to form a request for integrating multi-source GIS layers and send it to the server. The server is used to receive requests for multi-source GIS layers sent by intelligent agent clients based on the MCP protocol, and to access external GIS servers to call the services corresponding to the multi-source GIS layers; wherein, the multi-source GIS layer is composed of several GIS service links from different sources and with different protocols; the service types of the multi-source GIS layer include: WMS layer, and / or WMTS layer, and / or WFS layer; The multi-source GIS layers are then batch-input into the registration tool for preprocessing to identify the service type. The OGC parser is then used to parse the service address to obtain the basic information of the layer. Furthermore, based on the basic layer information and in conjunction with an external GIS server, FastMCP is used to declare dynamic template resources to dynamically obtain layer access parameters, which are then sent to the intelligent agent client along with the basic layer information. The client is also used to obtain the basic layer information sent by the server based on the user request information, construct the layer request URL and send it to the server; The server is also used to receive the layer construction request URL sent by the agent client, calculate the map parameters and visualization results based on the layer request URL, and send them to the agent client. The client is also used to obtain the map parameters and visualization results calculated by the server based on the layer request URL, and to display the visualization results.
9. A multi-source GIS layer integration and visualization system based on MCP according to claim 8, characterized in that... Based on the user request information, obtain the basic layer information sent by the server, and construct the layer request URL, specifically: Based on the user request information, the large language model selects the required layer basic information, sets the parameter threshold, and encapsulates it into JSON query parameters in JSON format. Based on the selected layer's basic information, the layer tool is used for parsing. Combined with JSON query parameters, a CQL filter is used to convert the abstract query logic into parameters that the GIS service can recognize, generating the layer request URL and a preprocessed layer object containing complete information. The CQL filter is uniformly managed by the CQLFilterBuilder class, which is used to decompose complex query parameters and construct the final layer request URL through type recognition, operator mapping, and logical sorting.
10. A multi-source GIS layer integration and visualization system based on MCP according to claim 8, characterized in that... The map parameters and visualization results are calculated based on the layer request URL, specifically as follows: Define a global layer list to store the preprocessed layer objects; Select the main layer from the global layer list to configure the map, extract key spatial features from the basic information of the main layer as the basis for calculating map parameters, and calculate the map parameters. By combining the user request information with the map parameters, the built-in spatial calculation tool is invoked to generate a visualization result and a link to the visualization result is provided. The main layer is a preprocessed layer object selected from the global layer list, which serves as the core benchmark and configuration basis for map visualization and is used to provide a basic reference framework for the entire map scene. The map parameters include: center point coordinates, zoom level, projection method, viewport range, and resolution.
