Excel WFS输出格式

GeoServer Excel插件增加了在Excel 97-2003中输出WFS响应的能力 (.xls )或Excel 2007 (.xlsx )格式。

安装

  1. website download 页面,找到您的版本,并下载: geoserver-2.24.x-excel-plugin.zip

  2. 将归档文件解压缩到 WEB-INF/lib Geoserver安装的目录。

  3. 重新启动geoserver。

使用

当发出WFS请求时,设置 outputFormatexcel (适用于Excel 97-2003)或 excel2007 (适用于Excel 2007)。

实例

Excel 97-2003获取:

http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=excel

Excel 2007获取:

http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&typeName=topp:states&outputFormat=excel2007

Excel 97-2003 POST ::

<wfs:GetFeature service="WFS" version="1.1.0"
  outputFormat="excel"
  xmlns:topp="http://www.openplans.org/topp"
  xmlns:wfs="http://www.opengis.net/wfs"
  xmlns:ogc="http://www.opengis.net/ogc"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wfs
                      http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
  <wfs:Query typeName="topp:states" />
</wfs:GetFeature>

局限性

Excel97-2003文件以二进制格式存储,因此节省空间,但具有固有的大小限制(每页65526行;每页256列)。

Excel2007文件是基于XML的,并且具有更高的限制(每页1048576行;每页16384列)。但是,因为它们是文本文件,所以Excel2007文件通常比Excel97-2003文件大。

如果工作表中的行数或单元格中的字符数超过所选Excel文件格式的限制,则插入警告文本以指示截断。