Nothing Special   »   [go: up one dir, main page]

CN107239531B - Implementation method for expanding WMS service of GeoServer releasing custom tiles - Google Patents

Implementation method for expanding WMS service of GeoServer releasing custom tiles Download PDF

Info

Publication number
CN107239531B
CN107239531B CN201710397079.XA CN201710397079A CN107239531B CN 107239531 B CN107239531 B CN 107239531B CN 201710397079 A CN201710397079 A CN 201710397079A CN 107239531 B CN107239531 B CN 107239531B
Authority
CN
China
Prior art keywords
tile
map
custom
information
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710397079.XA
Other languages
Chinese (zh)
Other versions
CN107239531A (en
Inventor
何源
王民昆
苏运光
伍凌云
房彩申
汪燕
莫婷
孙文成
杨鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NANJING NANRUI GROUP CO
Nari Technology Co Ltd
NARI Nanjing Control System Co Ltd
Southwest Branch of State Grid Corp
Original Assignee
NANJING NANRUI GROUP CO
Nari Technology Co Ltd
NARI Nanjing Control System Co Ltd
Southwest Branch of State Grid Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NANJING NANRUI GROUP CO, Nari Technology Co Ltd, NARI Nanjing Control System Co Ltd, Southwest Branch of State Grid Corp filed Critical NANJING NANRUI GROUP CO
Priority to CN201710397079.XA priority Critical patent/CN107239531B/en
Publication of CN107239531A publication Critical patent/CN107239531A/en
Application granted granted Critical
Publication of CN107239531B publication Critical patent/CN107239531B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Remote Sensing (AREA)
  • Processing Or Creating Images (AREA)
  • Instructional Devices (AREA)

Abstract

本发明公开了一种扩展GeoServer发布自定义瓦片WMS服务的实现方法,包括:预下载地图瓦片并存储在对应的自定义文件夹中;在自定义文件夹中建立地图参数信息的配置文件;在GeoServer的数据目录配置与自定义文件夹对应的图层;根据接收到的获取网络地图请求,解析出自定义瓦片数据源信息文件,定位到所需自定义瓦片数据源;利用自定义瓦片特征类解析出地图瓦片的地图参数信息;根据接收到的地图参数信息、瓦片切片规则和瓦片命名规则调用相应的索引号计算方法,返回所需的地图瓦片。本发明能够对不同类型的自定义瓦片数据源以WMS服务的方式提供给电力业务系统,满足电力GIS对高分辨率影像地图数据的展示需求。

Figure 201710397079

The invention discloses an implementation method for extending GeoServer to publish a custom tile WMS service, including: pre-downloading map tiles and storing them in a corresponding custom folder; establishing a configuration file of map parameter information in the custom folder ;Configure the layer corresponding to the custom folder in the data directory of GeoServer; parse out the custom tile data source information file according to the received request to obtain the network map, and locate the required custom tile data source; use the custom tile data source The tile feature class parses the map parameter information of the map tile; calls the corresponding index number calculation method according to the received map parameter information, tile slicing rules and tile naming rules, and returns the required map tiles. The invention can provide different types of custom tile data sources to the electric power business system in the form of WMS service, so as to meet the display requirements of electric power GIS for high-resolution image map data.

Figure 201710397079

Description

一种扩展GeoServer发布自定义瓦片WMS服务的实现方法An implementation method of extending GeoServer to publish custom tiled WMS service

技术领域technical field

本发明属于智能电力GIS技术领域,具体涉及一种扩展GeoServer发布自定义瓦片WMS服务的实现方法,能够满足电力系统中展示多类型、更高分辨率、更新时效性地理底图的需求。The invention belongs to the technical field of intelligent power GIS, and in particular relates to an implementation method of extending GeoServer to publish custom tile WMS services, which can meet the needs of displaying multi-type, higher resolution, and updating timeliness geographic basemaps in power systems.

背景技术Background technique

随着配电、用电项目的开展,低压设备的持续录入,电力GIS对项目所在区域的地图精度和详细程度都提出了更高的要求。Web系统向面向服务的体系架构发展,GIS也逐步以服务的方式提供空间数据及空间功能的服务,在Web环境下展示更高分辨率的影像地图数据所需要的费用和空间处理资源更大,需要瓦片化、缓存、索引优化等机制来实现以轻量级、服务化的方式提供电力GIS服务。With the development of power distribution and power consumption projects and the continuous input of low-voltage equipment, power GIS has put forward higher requirements for the map accuracy and detail of the project area. The Web system is developing towards a service-oriented architecture, and GIS is gradually providing services of spatial data and spatial functions in the form of services. The cost and spatial processing resources required to display higher-resolution image map data in the Web environment are greater. Mechanisms such as tiling, caching, and index optimization are required to provide power GIS services in a lightweight and service-oriented manner.

发明内容SUMMARY OF THE INVENTION

针对上述问题,本发明提出一种扩展GeoServer发布自定义瓦片WMS服务的实现方法,对不同类型的自定义瓦片数据源以遵循OGC规范的WMS服务的方式提供给电力业务系统,实现地图服务与业务系统的松耦合,满足电力GIS对多类型、高分辨率影像地图数据的展示需求。In view of the above problems, the present invention proposes an implementation method of extending GeoServer to publish custom tile WMS services, providing different types of custom tile data sources to the power business system in the form of WMS services that follow the OGC specification, and realizing map services The loose coupling with the business system meets the display requirements of power GIS for multi-type, high-resolution image map data.

实现上述技术目的,达到上述技术效果,本发明通过以下技术方案实现:To achieve the above-mentioned technical purpose and achieve the above-mentioned technical effect, the present invention is realized through the following technical solutions:

一种扩展GeoServer发布自定义瓦片WMS服务的实现方法,包括以下步骤:An implementation method for extending GeoServer to publish custom tile WMS services, including the following steps:

S1:预下载不同比例尺下的地图瓦片,根据设定的瓦片切分规则、瓦片命名规则和组织规则存储在对应的自定义文件夹中,以形成自定义瓦片数据源;S1: Pre-download map tiles at different scales, and store them in corresponding custom folders according to the set tile segmentation rules, tile naming rules and organization rules to form a custom tile data source;

S2:在自定义文件夹中建立用于记录位于其内的地图瓦片的地图参数信息的配置文件;S2: Create a configuration file in the custom folder for recording the map parameter information of the map tiles located in it;

S3:在GeoServer的数据目录配置与自定义瓦片数据源对应的图层,用于存储自定义瓦片数据源信息文件;S3: Configure the layer corresponding to the custom tile data source in the GeoServer data directory to store the custom tile data source information file;

S4:根据接收到的获取网络地图GetMap请求,首先利用自定义瓦片数据源信息解析类解析自定义瓦片数据源信息文件,然后利用自定义瓦片读取类定位到需要读取的自定义瓦片数据源;最后利用自定义瓦片特征类解析出地图瓦片的地图参数信息,并传送给自定义瓦片读取类;S4: According to the received GetMap request for obtaining the network map, first use the custom tile data source information parsing class to parse the custom tile data source information file, and then use the custom tile read class to locate the custom tile that needs to be read Tile data source; finally, use the custom tile feature class to parse out the map parameter information of the map tile, and send it to the custom tile read class;

S5:自定义瓦片读取类根据接收到的地图参数信息、瓦片切片规则和瓦片命名规则调用相应的索引号计算方法,响应获取网络地图GetMap请求,返回所需的地图瓦片。S5: The custom tile reading class calls the corresponding index number calculation method according to the received map parameter information, tile slicing rules and tile naming rules, and returns the required map tiles in response to the GetMap request for obtaining the network map.

进一步地,所述自定义瓦片数据源是一组具有同样的自定义瓦片切分规则、瓦片命名规则和组织规则的地图瓦片文件,其中,所述的组织规则为各地图瓦片的组合顺序。Further, the custom tile data source is a group of map tile files with the same custom tile segmentation rule, tile naming rule and organization rule, wherein the organization rule is each map tile combination sequence.

进一步地,所述自定义瓦片数据源信息文件包括:用于定义地图瓦片基本描述信息的info.xml文件、用于定义地图瓦片存储路径的tiledata.its文件和用于定义地图瓦片坐标系及投影信息的tiledata.prj文件。Further, the custom tile data source information file includes: an info.xml file for defining basic description information of map tiles, a tiledata.its file for defining a storage path of map tiles, and a file for defining map tiles The tiledata.prj file for the coordinate system and projection information.

进一步地,所述地图参数信息包括:该组地图瓦片所在全球地图的坐标范围、初始比例尺级别下全球范围对应的瓦片行列数、最小和最大比例尺级别、瓦片像素大小及扩展信息,所述扩展信息包括瓦片类型名称信息,用于当出现两组或多组不同类型的地图瓦片数据时,利用不同的瓦片类型名称区别开。Further, the map parameter information includes: the coordinate range of the global map where the group of map tiles is located, the number of tile rows and columns corresponding to the global range under the initial scale level, the minimum and maximum scale levels, tile pixel size and extension information, so The extended information includes tile type name information, which is used to distinguish between two or more sets of map tile data of different types by using different tile type names.

进一步地,所述网络地图GetMap请求中包括:图层名称、请求地理坐标范围、像素大小、请求坐标系信息。Further, the network map GetMap request includes: layer name, requested geographic coordinate range, pixel size, and requested coordinate system information.

进一步地,所述步骤S4中具体为:利用自定义瓦片数据源信息解析类读取info.xml文件、tiledata.its文件、tiledata.prj文件中地图瓦片基本描述信息、地图瓦片坐标系及投影信息、地图瓦片存储路径,读取类根据地图瓦片存储路径信息,定位到需要读取的自定义瓦片数据源;由自定义瓦片特征类解析对应的自定义文件夹中的地图参数信息的配置文件,解析出地图瓦片的地图参数信息,并传送给自定义瓦片读取类。Further, the step S4 is specifically: using a custom tile data source information parsing class to read the basic description information of map tiles and the coordinate system of map tiles in the info.xml file, tiledata.its file, and tiledata.prj file And projection information, map tile storage path, the read class locates the custom tile data source that needs to be read according to the map tile storage path information; the custom tile feature class parses the corresponding custom folder The configuration file of the map parameter information, parses out the map parameter information of the map tile, and transmits it to the custom tile reading class.

进一步地,所述步骤S5具体为:自定义瓦片读取类依据接收到的地图参数信息、自定义切片规则和瓦片命名规则调用相应的索引号计算方法,得到地理坐标和瓦片索引号之间的换算关系以及瓦片数据各级比例尺的像素分辨率;自定义瓦片读取类依据接收到的网络地图GetMap请求中的参数,将网络地图GetMap请求中的在请求坐标系下请求地理坐标范围转换为tiledata.prj文件中的地图瓦片坐标系的地理坐标范围,并根据网络地图GetMap请求中的地理范围、几何像素范围计算理论上的瓦片像素分辨率,进而与瓦片数据各级比例尺的像素分辨率进行比较,取最接近的瓦片数据比例尺为显示比例尺,根据该比例尺分辨率和几何像素范围计算得到新的地理坐标范围,使用该显示比例尺和地理坐标范围计算瓦片索引号,得到瓦片文件。Further, the step S5 is specifically as follows: the custom tile reading class invokes the corresponding index number calculation method according to the received map parameter information, custom slicing rules and tile naming rules, and obtains geographic coordinates and tile index numbers. The conversion relationship between them and the pixel resolution of the scale of tile data at all levels; the custom tile reading class requests the geographic location in the request coordinate system in the GetMap request of the network map according to the parameters in the received network map GetMap request The coordinate range is converted into the geographic coordinate range of the map tile coordinate system in the tiledata.prj file, and the theoretical tile pixel resolution is calculated according to the geographic range and geometric pixel range in the GetMap request of the network map, which is then different from the tile data. Compare the pixel resolution of the scale scale, take the closest tile data scale as the display scale, calculate the new geographic coordinate range based on the scale resolution and geometric pixel range, and use the display scale and geographic coordinate range to calculate the tile index. No. to get the tile file.

本发明的有益效果:Beneficial effects of the present invention:

本发明解决了电力WebGIS显示更高分辨率、数据量更大的地理底图的要求,通过预缓存网络地图瓦片,扩展WebGIS服务端支持以WMS服务的方式对自定义瓦片数据进行访问,减少对在线商用地图API的依赖,改善了电力GIS的展示效率,提高了电力GIS的用户体验。The invention solves the requirement of displaying geographic basemaps with higher resolution and larger data volume in the electric WebGIS, and extends the WebGIS server to support access to custom tile data in the form of WMS services by pre-cache network map tiles. Reduce the dependence on the online commercial map API, improve the display efficiency of electric power GIS, and improve the user experience of electric power GIS.

附图说明Description of drawings

图1为扩展GeoServer发布自定义瓦片WMS服务的框架图;Figure 1 is a framework diagram of extending GeoServer to publish custom tile WMS services;

图2为配置和解析自定义地图瓦片、返回WMS获取网络地图请求所需地图瓦片的流程图;Figure 2 is a flowchart of configuring and parsing custom map tiles, and returning to WMS to obtain map tiles required by a network map request;

图3为计算所需瓦片索引号的流程图。FIG. 3 is a flow chart of calculating the required tile index number.

具体实施方式Detailed ways

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.

下面结合附图对本发明的应用原理作详细的描述。The application principle of the present invention will be described in detail below with reference to the accompanying drawings.

如图1-3所示,一种扩展GeoServer发布自定义瓦片WMS服务的实现方法,包括以下步骤:As shown in Figure 1-3, an implementation method for extending GeoServer to publish custom tile WMS services includes the following steps:

S1:预下载不同比例尺下的地图瓦片,根据设定的瓦片切分规则、瓦片命名规则和组织规则存储在对应的自定义文件夹中,以形成自定义瓦片数据源;S1: Pre-download map tiles at different scales, and store them in corresponding custom folders according to the set tile segmentation rules, tile naming rules and organization rules to form a custom tile data source;

所述自定义瓦片数据源是一组具有同样的自定义瓦片切分规则、瓦片命名规则和组织规则的地图图片文件,其中,所述的组织规则为各地图瓦片的组合顺序;The custom tile data source is a group of map image files with the same custom tile segmentation rule, tile naming rule and organization rule, wherein the organization rule is the combination order of each map tile;

S2:在自定义文件夹中建立用于记录位于其内的地图瓦片的地图参数信息的配置文件;S2: Create a configuration file in the custom folder for recording the map parameter information of the map tiles located in it;

所述地图参数信息包括:该组地图瓦片所在全球地图的坐标范围、初始比例尺级别下全球范围对应的瓦片行列数、最小和最大比例尺级别、瓦片像素大小及扩展信息,所述扩展信息包括瓦片类型名称信息(比如:google、worldwind),用于当出现两组或多组不同类型的地图瓦片数据时,利用不同的瓦片类型名称区别开。The map parameter information includes: the coordinate range of the global map where the group of map tiles is located, the number of tile rows and columns corresponding to the global range at the initial scale level, the minimum and maximum scale levels, the tile pixel size, and extension information. Including tile type name information (for example: google, worldwind), which is used to distinguish between two or more sets of map tile data of different types by using different tile type names.

S3:在GeoServer的数据目录配置与各自定义瓦片数据源对应的图层,用于存储自定义瓦片数据源信息文件;S3: Configure the layer corresponding to each custom tile data source in the GeoServer data directory to store the custom tile data source information file;

所述自定义瓦片数据源信息文件包括:用于定义地图瓦片基本描述信息的info.xml文件、用于定义地图瓦片存储路径的tiledata.its文件和用于定义地图瓦片坐标系及投影信息的tiledata.prj文件。The custom tile data source information file includes: an info.xml file for defining basic description information of map tiles, a tiledata.its file for defining map tile storage paths, and a map tile coordinate system for defining map tiles and The tiledata.prj file for projection information.

S4:根据接收到的获取网络地图GetMap请求,首先利用自定义瓦片数据源信息解析类解析自定义瓦片数据源信息文件,然后利用自定义瓦片读取类定位到需要读取的自定义瓦片数据源;最后利用自定义瓦片特征类解析出地图瓦片的地图参数信息,并传送给自定义瓦片读取类;S4: According to the received GetMap request for obtaining the network map, first use the custom tile data source information parsing class to parse the custom tile data source information file, and then use the custom tile read class to locate the custom tile that needs to be read Tile data source; finally, use the custom tile feature class to parse out the map parameter information of the map tile, and send it to the custom tile read class;

所述步骤S4中具体为:利用自定义瓦片数据源信息解析类读取info.xml文件、tiledata.its文件、tiledata.prj文件中地图瓦片基本描述信息、地图瓦片坐标系及投影信息、地图瓦片存储路径,读取类根据地图瓦片存储路径信息,定位到需要读取的自定义瓦片数据源;由自定义瓦片特征类解析对应的自定义文件夹中的地图参数信息的配置文件,解析出地图瓦片的地图参数信息,并传送给自定义瓦片读取类;The step S4 is specifically: using the custom tile data source information parsing class to read the basic description information of the map tiles, the coordinate system of the map tiles and the projection information in the info.xml file, the tiledata.its file and the tiledata.prj file , map tile storage path, the read class locates the custom tile data source that needs to be read according to the map tile storage path information; the map parameter information in the corresponding custom folder is parsed by the custom tile feature class configuration file, parse out the map parameter information of the map tile, and send it to the custom tile reading class;

S5:自定义瓦片读取类根据接收到的地图参数信息、瓦片切片规则和瓦片命名规则调用相应的索引号计算方法,响应获取网络地图GetMap请求,返回所需的地图瓦片;S5: The custom tile reading class calls the corresponding index number calculation method according to the received map parameter information, tile slicing rules and tile naming rules, and returns the required map tiles in response to the GetMap request for obtaining the network map;

所述步骤S5具体为:自定义瓦片读取类依据接收到的地图参数信息、自定义切片规则和瓦片命名规则调用相应的索引号计算方法,得到地理坐标和瓦片索引号之间的换算关系以及瓦片数据各级比例尺的像素分辨率;自定义瓦片读取类依据接收到的网络地图GetMap请求中的参数,将网络地图GetMap请求中的在请求坐标系下请求地理坐标范围转换为在tiledata.prj文件中的地图瓦片坐标系下的地理坐标范围,并根据网络地图GetMap请求中的地理范围、几何像素范围计算理论上的瓦片像素分辨率,进而与瓦片数据各级比例尺的像素分辨率进行比较,取最接近的瓦片数据比例尺为显示比例尺,根据该比例尺分辨率和几何像素范围计算得到新的地理坐标范围,使用该显示比例尺和地理坐标范围计算瓦片索引号,得到瓦片文件。The step S5 is specifically as follows: the custom tile reading class invokes the corresponding index number calculation method according to the received map parameter information, the custom slicing rule and the tile naming rule, and obtains the difference between the geographic coordinates and the tile index number. Conversion relationship and pixel resolution of tile data at all scales; the custom tile reading class converts the geographic coordinate range requested in the request coordinate system in the GetMap request of the network map according to the parameters in the received network map GetMap request It is the geographic coordinate range under the map tile coordinate system in the tiledata.prj file, and calculates the theoretical tile pixel resolution according to the geographic range and geometric pixel range in the GetMap request of the network map, and then matches the tile data at all levels. Compare the pixel resolution of the scale, take the closest tile data scale as the display scale, calculate the new geographic coordinate range based on the scale resolution and geometric pixel range, and use the display scale and geographic coordinate range to calculate the tile index number , get the tile file.

下面以谷歌地图瓦片为例来说明本发明的扩展GeoServer发布自定义瓦片WMS服务的实现方法的实现过程:The following uses Google map tiles as an example to illustrate the implementation process of the implementation method of the extended GeoServer publishing custom tile WMS service of the present invention:

本实施例中的自定义瓦片数据源信息解析类、自定义瓦片读取类、自定义瓦片特征类均设于NariImageTileSource模块中,其中NariImageTileSource是自定义的模块。The custom tile data source information parsing class, the custom tile reading class, and the custom tile feature class in this embodiment are all set in the NariImageTileSource module, where the NariImageTileSource is a custom module.

步骤1:预下载不同比例尺下的谷歌地图瓦片,所有地图瓦片均存储在TileMap文件夹中,形成自定义瓦片数据源,此实施例中约定地图瓦片的命名按照“比例尺级别/行号/列号.png”的规则命名;在GeoServer数据目录的coverages文件夹中建立googletile文件夹,并在googletile文件夹中配置info.xml文件、tiledata.its文件和tiledata.prj文件;所述info.xml文件用于定义地图瓦片基本描述信息,包括:数据名称、数据来源及更新日期等描述信息;所述tiledata.its文件用于定义地图瓦片存储路径,所述tiledata.prj文件用于定义地图瓦片坐标系及投影信息,tiledata.prj文件采用EPSG系统的WKT文本描述方式。Step 1: Pre-download Google map tiles at different scales. All map tiles are stored in the TileMap folder to form a custom tile data source. In this embodiment, it is agreed that map tiles are named according to "scale level/row. No./column No. The .xml file is used to define the basic description information of map tiles, including: data name, data source and update date and other description information; the tiledata.its file is used to define the map tile storage path, and the tiledata.prj file is used to Define the map tile coordinate system and projection information. The tiledata.prj file adopts the WKT text description method of the EPSG system.

步骤2:在TileMap文件夹中,建立用于记录位于其内的地图瓦片的地图参数信息的配置文件config.xml,所述的地图参数信息包括:该该组地图瓦片所在全球地图的坐标范围、初始比例尺级别下全球范围对应的瓦片行列数、最小和最大比例尺级别、瓦片像素大小及扩展信息,所述扩展信息包括瓦片类型名称信息,用于当出现两组或多组不同类型的地图瓦片数据时,利用不同的瓦片类型名称区别开,例如可按切分规则命名,将与谷歌地图切分规则一致的地图瓦片的瓦片类型名称定义为“google”,将与WorldWind地图切分规则一致的地图瓦片的瓦片类型名称定义为“worldwind”,或者用自定义的名字。Step 2: In the TileMap folder, create a configuration file config.xml for recording the map parameter information of the map tiles located therein. The map parameter information includes: the coordinates of the global map where the group of map tiles is located Scope, the number of tile rows and columns corresponding to the global scope under the initial scale level, the minimum and maximum scale level, the pixel size of the tile, and the extension information, the extension information includes the tile type name information, which is used when two or more groups of different When using different types of map tile data, use different tile type names to distinguish them. For example, they can be named according to the segmentation rules. The tile type name of a map tile that is consistent with the WorldWind map segmentation rules is defined as "worldwind", or with a custom name.

步骤3:GeoServer接收并解析网络地图GetMap请求,获得请求条件参数,具体包括:图层名称、请求地理坐标范围、像素大小、请求坐标系信息等;当GeoServer判断出需要访问的图层是以步骤1中配置的自定义瓦片为数据源时,读取GeoServer数据目录中的coverages文件夹中建立的info.xml文件、tiledata.its文件和tiledata.prj文件,利用自定义瓦片数据源信息解析类读取info.xml文件、tiledata.its文件和tiledata.prj文件中地图瓦片基本描述信息、地图瓦片坐标系及投影信息、地图瓦片存储路径;然后利用自定义瓦片读取类根据地图瓦片存储路径定位到需要读取的自定义瓦片数据源;再然后通过自定义瓦片特征类解析该地图瓦片存储路径信息下的config.xml文件,获得相应的地图参数信息,具体包括:该组地图瓦片所在全球地图的坐标范围、初始比例尺级别下全球范围对应的瓦片行列数、最小和最大比例尺级别、瓦片像素大小及扩展信息;Step 3: GeoServer receives and parses the network map GetMap request, and obtains request condition parameters, including: layer name, requested geographic coordinate range, pixel size, requested coordinate system information, etc.; when GeoServer determines that the layer to be accessed is the step When the custom tile configured in 1 is the data source, read the info.xml file, tiledata.its file and tiledata.prj file created in the coverages folder in the GeoServer data directory, and use the custom tile data source information to parse The class reads the basic description information of map tiles, the coordinate system and projection information of map tiles, and the storage path of map tiles in the info.xml file, tiledata.its file and tiledata.prj file; and then uses the custom tile to read the class according to the The map tile storage path locates the custom tile data source that needs to be read; and then parses the config.xml file under the map tile storage path information through the custom tile feature class to obtain the corresponding map parameter information. Including: the coordinate range of the global map where the group of map tiles is located, the number of tile rows and columns corresponding to the global range under the initial scale level, the minimum and maximum scale levels, the pixel size of the tile and extension information;

步骤4、所述步骤S5具体为:自定义瓦片读取类依据接收到的地图参数信息、自定义切片规则和瓦片命名规则调用相应的索引号计算方法,得到地理坐标和瓦片索引号之间的换算关系以及瓦片数据各级比例尺的像素分辨率;自定义瓦片读取类依据接收到的网络地图GetMap请求中的参数,将网络地图GetMap请求中的在请求坐标系下请求地理坐标范围转换为在tiledata.prj文件中的地图瓦片坐标系下的地理坐标范围,并根据网络地图GetMap请求中的地理范围、几何像素范围计算理论上的瓦片像素分辨率,进而与瓦片数据各级比例尺的像素分辨率进行比较,取最接近的瓦片数据比例尺为显示比例尺,根据该比例尺分辨率和几何像素范围计算得到新的地理坐标范围,使用该显示比例尺和地理坐标范围计算瓦片索引号,得到瓦片文件。Step 4. The step S5 is specifically: the custom tile reading class invokes the corresponding index number calculation method according to the received map parameter information, custom slicing rules and tile naming rules, and obtains geographic coordinates and tile index numbers The conversion relationship between them and the pixel resolution of the scale of tile data at all levels; the custom tile reading class requests the geographic location in the request coordinate system in the GetMap request of the network map according to the parameters in the received network map GetMap request The coordinate range is converted into the geographic coordinate range under the map tile coordinate system in the tiledata.prj file, and the theoretical tile pixel resolution is calculated according to the geographic range and geometric pixel range in the GetMap request of the network map, and then the pixel resolution is compared with the tile. Compare the pixel resolutions of the scales at all levels of the data, take the closest tile data scale as the display scale, and calculate the new geographic coordinate range based on the scale resolution and geometric pixel range, and use the display scale and geographic coordinate range to calculate the tile scale. The tile index number to get the tile file.

例如谷歌地图瓦片数据源的config.xml中配置type信息为“google”,谷歌地图瓦片切分规则为:以左上角为起始原点,全球地图范围为:x轴取值范围为[-20037508.3427892,20037508.3427892],y轴取值范围为[-20037508.3427892,20037508.3427892],在该正方形投影平面上进行瓦片划分,每层全球影像瓦片数量为4的level幂次方,即第0层为1张、第1层为4张、第二层为16张,如此循环,可计算出每一张瓦片在每个层级下都有其所对应的行号和列号。在进行预下载时以“EPSG900193_比例尺级别数/行号/列号.png”的方式对谷歌瓦片进行自定义组织。WorldWind瓦片数据源的config.xml中配置type信息为“worldwind”,WorldWind瓦片切分规则为:以左下角为起始原点,全球地图范围为:(-90,-180)至(90,180),每张瓦片的像素大小为512*512,第0层为10张瓦片,每下一层将上一层瓦片一分为四,在进行预下载时以“比例尺级别数/行号/列号.png”的方式对WorldWind瓦片进行自定义组织。For example, the configuration type information in the config.xml of the Google Map tile data source is "google", the Google Map tile segmentation rule is: the upper left corner is the starting point, and the global map range is: the value range of the x-axis is [- 20037508.3427892, 20037508.3427892], the value range of the y-axis is [-20037508.3427892, 20037508.3427892], the tiles are divided on the square projection plane, and the number of global image tiles in each layer is the level power of 4, that is, the 0th layer is 1 The first layer is 4, and the second layer is 16. In this cycle, it can be calculated that each tile has its corresponding row number and column number under each layer. When pre-downloading, customize the organization of Google tiles in the form of "EPSG900193_scale level number/row number/column number.png". The configuration type information in the config.xml of the WorldWind tile data source is "worldwind". The WorldWind tile segmentation rule is: starting from the lower left corner, and the global map range is: (-90,-180) to (90,180) , the pixel size of each tile is 512*512, the 0th layer is 10 tiles, and each next layer divides the tiles of the previous layer into four. /column number.png" to customize the organization of WorldWind tiles.

当需要新增自定义类型的瓦片,如图2中的流程所示,在GeoServer数据目录coverages文件夹中新增图层及相应的自定义瓦片数据源配置文件,在瓦片数据目录中部署新增的瓦片文件,并建立相应的config.xml,其中扩展信息中自定义瓦片类型名称和已有的自定义瓦片类型名称区别开。在程序部分,更新自定义瓦片特征类中增加识别新的类型名称,自定义瓦片读取类中增加计算该自定义瓦片切分和索引规则的方法,NariImageTileSource模块在GeoServer中的自定义瓦片数据源信息解析类、自定义瓦片读取类、自定义瓦片特征类的调用方式不发生改变,有利于定制和扩展所需的地图瓦片数据源。When you need to add a custom type of tile, as shown in the process in Figure 2, add a new layer and the corresponding custom tile data source configuration file in the GeoServer data directory coverages folder, in the tile data directory Deploy the newly added tile file and create the corresponding config.xml, in which the name of the custom tile type in the extended information is distinguished from the name of the existing custom tile type. In the program part, update the custom tile feature class to add a new type name to identify, add a method to calculate the custom tile segmentation and indexing rules in the custom tile read class, and customize the NariImageTileSource module in GeoServer. The calling methods of the tile data source information parsing class, the custom tile reading class, and the custom tile feature class remain unchanged, which is conducive to customizing and extending the required map tile data source.

以上显示和描述了本发明的基本原理和主要特征和本发明的优点。本行业的技术人员应该了解,本发明不受上述实施例的限制,上述实施例和说明书中描述的只是说明本发明的原理,在不脱离本发明精神和范围的前提下,本发明还会有各种变化和改进,这些变化和改进都落入要求保护的本发明范围内。本发明要求保护范围由所附的权利要求书及其等效物界定。The basic principles and main features of the present invention and the advantages of the present invention have been shown and described above. Those skilled in the art should understand that the present invention is not limited by the above-mentioned embodiments, and the descriptions in the above-mentioned embodiments and the description are only to illustrate the principle of the present invention. Without departing from the spirit and scope of the present invention, the present invention will have Various changes and modifications fall within the scope of the claimed invention. The claimed scope of the present invention is defined by the appended claims and their equivalents.

Claims (5)

1. A realization method for expanding a WMS service of a GeoServer releasing custom tiles is characterized in that: the method comprises the following steps:
s1: pre-downloading map tiles under different scales, and storing the map tiles in corresponding custom folders according to set tile segmentation rules, tile naming rules and organization rules to form custom tile data sources;
s2: establishing a configuration file for recording map parameter information of map tiles in a custom folder;
s3: configuring a layer corresponding to a user-defined tile data source in a data directory of the GeoServer, and storing a user-defined tile data source information file;
s4: according to a received request for acquiring a network map GetMap, firstly, analyzing a self-defined tile data source information file by using a self-defined tile data source information analysis class, and then, positioning to a self-defined tile data source needing to be read by using a self-defined tile reading class; finally, map parameter information of the map tiles is analyzed by utilizing the user-defined tile feature classes and is transmitted to a user-defined tile reading class;
s5: the user-defined tile reading class calls a corresponding index number calculation method according to the received map parameter information, the tile slicing rule and the tile naming rule, responds to a request for obtaining a network map GetMap, and returns the required map tiles;
the custom tile data source information file comprises: an info.xml file for defining basic description information of the map tiles, a tiledata.its file for defining storage paths of the map tiles, and a tiledata.prj file for defining coordinate systems of the map tiles and projection information;
the step S4 specifically includes: reading map tile basic description information, a map tile coordinate system, projection information and a map tile storage path in an info.xml file, a tiledata.its file and a tiledata.prj file by using a self-defined tile data source information analysis class; the reading class locates a user-defined tile data source to be read according to the map tile storage path information; and analyzing the configuration file of the map parameter information in the corresponding custom folder by the custom tile characteristic class, analyzing the map parameter information of the map tile, and transmitting the map parameter information to the custom tile reading class.
2. The method for implementing the service of the extended GeoServer for publishing the custom tile WMS as claimed in claim 1, wherein: the custom tile data source is a group of map tile files with the same custom tile segmentation rule, tile naming rule and organization rule, wherein the organization rule is the combination sequence of each map tile.
3. The method for implementing the service of the extended GeoServer for publishing the custom tile WMS as claimed in claim 2, wherein: the map parameter information includes: the map tile set comprises a coordinate range of a global map where the map tiles are located, tile row and column numbers corresponding to the global range under an initial scale level, a minimum scale level, a maximum scale level, tile pixel sizes and expansion information, wherein the expansion information comprises tile type name information and is used for distinguishing by using different tile type names when two or more groups of map tile data of different types appear.
4. The implementation method of the extended GeoServer publishing custom tile WMS service as claimed in claim 3, wherein: the network map GetMap request comprises the following steps: layer name, requested geographical coordinate range, pixel size, requested coordinate system information.
5. The implementation method of the extended GeoServer publishing custom tile WMS service as claimed in claim 4, wherein: the step S5 specifically includes: the user-defined tile reading class calls a corresponding index number calculation method according to the received map parameter information, the user-defined slicing rule and the tile naming rule to obtain the conversion relation between the geographic coordinate and the tile index number and the pixel resolution of each level of scale of the tile data; the user-defined tile reading class converts a geographic coordinate range requested under a request coordinate system in the network map GetMap request into a geographic coordinate range under a map tile coordinate system in a tiledata.prj file according to parameters in the received network map GetMap request, calculates theoretical tile pixel resolution according to the geographic range and the geometric pixel range in the network map GetMap request, compares the theoretical tile pixel resolution with the pixel resolution of each scale of tile data, takes the closest tile data scale as a display scale, calculates a new geographic coordinate range according to the scale resolution and the geometric pixel range, and calculates a tile index number by using the display scale and the geographic coordinate range to obtain a tile file.
CN201710397079.XA 2017-05-31 2017-05-31 Implementation method for expanding WMS service of GeoServer releasing custom tiles Active CN107239531B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710397079.XA CN107239531B (en) 2017-05-31 2017-05-31 Implementation method for expanding WMS service of GeoServer releasing custom tiles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710397079.XA CN107239531B (en) 2017-05-31 2017-05-31 Implementation method for expanding WMS service of GeoServer releasing custom tiles

Publications (2)

Publication Number Publication Date
CN107239531A CN107239531A (en) 2017-10-10
CN107239531B true CN107239531B (en) 2020-08-25

Family

ID=59985748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710397079.XA Active CN107239531B (en) 2017-05-31 2017-05-31 Implementation method for expanding WMS service of GeoServer releasing custom tiles

Country Status (1)

Country Link
CN (1) CN107239531B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941686A (en) * 2018-09-25 2020-03-31 北京京东尚科信息技术有限公司 Positioning map processing method and device
CN109542987B (en) * 2018-10-09 2021-10-22 中国电子科技集团公司第二十八研究所 Online map storage method based on Canvas
CN111913951B (en) * 2019-05-10 2024-03-15 中国电力科学研究院有限公司 Map vector data slicing method for superimposed power grid data
CN110555817B (en) * 2019-09-10 2022-06-24 中国科学院遥感与数字地球研究所 A method and device for geometric normalization of remote sensing images
CN113112564B (en) * 2020-01-13 2023-03-10 长沙市海图科技有限公司 Method, system and storage medium for CAD (computer-aided design) online calling WMTS (wireless multimedia transport service)
CN110851558B (en) * 2020-01-14 2020-05-19 武大吉奥信息技术有限公司 Universal loading method for map of coordinate system in earth
CN111459934B (en) * 2020-03-19 2023-09-22 北京图创时代科技有限公司武汉分公司 Multi-source map data slicing system and method
CN111611538B (en) * 2020-04-02 2023-06-20 广东邦鑫数据科技股份有限公司 Water depth measurement result display system, method, device and storage medium
CN112800470B (en) * 2021-02-20 2024-09-20 和芯星通科技(北京)有限公司 Differential data management method and system, server and client
CN113076440B (en) * 2021-04-01 2024-07-09 广东南方数码科技股份有限公司 Map tile image processing method, device, equipment and storage medium
CN113360281B (en) * 2021-06-02 2024-05-07 成都比格图数据处理有限公司 Multithreading tile downloading and reading method for offline map
CN114048280B (en) * 2022-01-07 2022-04-29 成都国星宇航科技有限公司 Vector slice processing method, device, server and storage medium
CN115408406B (en) * 2022-08-26 2023-06-27 青岛励图高科信息技术有限公司 Map service-based high-density ship position dynamic rendering system
CN115858973B (en) * 2023-02-23 2023-06-13 北京德风新征程科技股份有限公司 Grid map analysis method, device, equipment and medium
CN116383143A (en) * 2023-03-17 2023-07-04 上海市测绘院 Method and device for publishing two-dimensional and three-dimensional map service of huge city space mass data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2009260486A1 (en) * 2008-05-28 2009-12-23 Google Llc Motion-controlled views on mobile computing devices
CN103744855A (en) * 2013-11-29 2014-04-23 航天恒星科技有限公司 Tile map storage method based on aggregation files
CN105468691A (en) * 2015-11-17 2016-04-06 江苏省基础地理信息中心 Multisource tile map acquiring method and device
CN105608191A (en) * 2015-12-23 2016-05-25 云南电网有限责任公司 EnersunWebCache based method for dynamically generating cached power grid map tiles

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101475371B1 (en) * 2014-09-24 2014-12-22 한국지질자원연구원 Method for analyzing 2-dimensional geothermal resource data by 3-diemensional sectional view based on web

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2009260486A1 (en) * 2008-05-28 2009-12-23 Google Llc Motion-controlled views on mobile computing devices
CN103744855A (en) * 2013-11-29 2014-04-23 航天恒星科技有限公司 Tile map storage method based on aggregation files
CN105468691A (en) * 2015-11-17 2016-04-06 江苏省基础地理信息中心 Multisource tile map acquiring method and device
CN105608191A (en) * 2015-12-23 2016-05-25 云南电网有限责任公司 EnersunWebCache based method for dynamically generating cached power grid map tiles

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
" 野外科考中移动终端自定义地图技术研究与应用";耿佳琪 等;《科研信息化技术与应用》;20160920(第5期);第67-75页 *
"WMS的自定义地图服务聚合技术研究";许朝晖 等;《测绘科学技术学报》;20110615;第28卷;第223-226页 *

Also Published As

Publication number Publication date
CN107239531A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
CN107239531B (en) Implementation method for expanding WMS service of GeoServer releasing custom tiles
US11550826B2 (en) Method and system for generating a geocode trie and facilitating reverse geocode lookups
CN112559667B (en) Map editor, map engine, map editing system, map editing method, and storage medium
EP2560143B1 (en) Generating and serving tiles in a digital mapping system
CA2849992C (en) Managing map elements using aggregate feature identifiers
CN103270509B (en) Method, apparatus and computer program product for converting a geographic database into a map tile database
CN101706809B (en) Method, device and system for processing multi-source map data
US20150370828A1 (en) Tile-Based Distribution of Searchable Geospatial Data to Client Devices
CN104933057A (en) Map service providing method and apparatus
CN102819530A (en) Method and device for displaying electronic map
CN110119266A (en) A kind of WebGIS applicating developing technology frame based on OpenLayers
CN114297206B (en) Refined efficient dynamic tile map service publishing method, medium and electronic equipment
CN107092623B (en) Method and device for querying a point of interest
JP2020531970A (en) Fusion of scalable space-time density data
CN103744995A (en) Thematic map building method and mobile terminal applying same
CN106777302B (en) Method and device for converting space geographic coordinates
CN103500060B (en) The manufacture method of electronic chart, producing device, display packing and display device
CN101593210A (en) Demographics method and system for improving spatial resolution and update speed
CN105718498B (en) The method and apparatus of network map mix-loaded
CN103324749B (en) A kind of spatialization parsing based on received text address and method for correcting error
CN103699641A (en) Method for accessing different raster map services
CN109684425A (en) Declaration form station address matching process and device
CN116701676A (en) Remote sensing satellite image data management method and related equipment
CN105354326A (en) Spatial position indexing method and system
CN111737330A (en) A spatial data standardization method, apparatus, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant