1 前言
GeoServer的是一个基于Java的软件,它允许用户查看和编辑地理空间数据,使用开放地理空间联盟(OGC)提出的开放标准,为地图创建和数据分享提供了强大的便利性。 GeoServer是OpenGIS Web 服务器规范的 J2EE 实现,利用 GeoServer 可以方便的发布地图数据,允许用户对特征数据进行更新、删除、插入操作,通过 GeoServer 可以比较容易的在用户之间迅速共享空间地理信息。
备注:安装GeoServer前首先确保本地JAVA环境配置完好。
2 软件下载及安装
进入GeoServer官网,选择稳定版下载。

2.1 安装器部署安装

1)扩展包中有很多资源可以方便后期进行地图服务发布及管理,如批量导入包。

2)进入下载界面

3)默认安装即可。



选择JAVA环境。


4)设定账号密码,以便后期登录使用

5)选择网络端口,默认是“8080”,由于本机此端口已被占用,故修改为“8090”(必须以80开头)




2.2 绿色硬盘免安装
1)下载二进制文件

2)设置环境变量
# 追加环境变量
PATH=%JAVA_HOME%bin
# 新增环境变量
JAVA_HOME=C:Program FilesJavajdk1.8.0_161
CLASSPATH=%JAVA_HOME%libdt.jar;%JAVA_HOME%libtools.jar
3 启用软件
1)启动GeoServer

2)访问和登录web界面

3)进入GeoServer主界面

4 部署发布地图数据
4.1 新建工作区
1)点击工作区

2)配置工作区

3)查看工作区

4.2 新建数据存储

4.2.1 shapefile
1)配置shp数据

2)点击保存以完成创建

4.2.2 PostGIS
1)配置pg数据库

2)设置数据库参数

4.3 新建图层
1)点击图层

2)选择数据

4.4 发布图层
1)在新建图层界面下点击“发布”(新建数据存储后,系统也会默认停在此界面
)

2)编辑图层,定义SRS信息和边框信息,然后单击保存即可


3)图层预览

4)OpenLayer查看图层

5)图层url地址 http://localhost:8090/geoserver/llw/wmsservice=WMS&version=1.1.0&request=GetMap&layers=llw%3Astates&bbox=-180.0%2C90.0%2C180.0%2C90.0&width=768&height=384&srs=EPSG%3A4326&format=application/openlayers
5 问题解决
1)PostgreSQL 连接提示 FATAL: no pg_hba.conf entry for host
? PostgreSQL数据库的安装目录下找到/data/pg_hba.conf,并在# IPv4 local connections
下加上请求连接的机器IP。