Book Image

GeoServer Cookbook

By : Stefano Iacovella
Book Image

GeoServer Cookbook

By: Stefano Iacovella

Overview of this book

Table of Contents (17 chapters)
GeoServer Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Vector data is probably the main source of spatial information that is used inside GeoServer to build maps. You may use the data both to render maps on the server side, that is, using the Web Map Service (WMS) standard, or have the client get the shapes and manipulate or render them in a map, that is, using the Web Feature Service (WFS) standard.

In this chapter, we will use both these standards, and we will focus on how to filter data and optimize configuration for better performance. We assume that you're already comfortable with the standard WMS and WFS requests and you know how to configure a data store and a layer with the GeoServer web interface.

The recipes in this chapter use a few datasets. Configuring and publishing them is quite easy, so we are not covering these steps in detail. We will use publicly available data from NASA Earth Observatory (http://neo.sci.gsfc.nasa.gov) and Natural Earth (http://www.naturalearthdata.com). Configuration and publication of datasets is straightforward, and hence not covered in detail.

You should download the Blue Marble dataset from NASA Earth Observatory. In the home page, you can find it by navigating to the LAND section. Use the GeoTiff format with 0.1 degrees resolution to match the exercises provided in this book. You should publish this dataset as NaturalEarth:blueMarble for use with exercises that require a map that looks like the one in this book.

You also need a couple of datasets from Natural Earth: the datasets for countries and populated places in the 1:10,000,000 scale. Go to http://www.naturalearthdata.com/downloads/10m-cultural-vectors/ and download the datasets for countries and populated places in the shapefile format. Publish the countries' data as NaturalEarth:countries.

We will be using the populated places dataset to create a SQL view. To be able to create it, you should load the data in a spatial RDBMS. Our choice is PostGIS, as it is a very good option; it is powerful, easy to deploy, and free.

Tip

We won't cover how to install and configure a PostGIS installation. In fact, PostGIS is not an RDBMS, but a spatial plugin for PostgreSQL. So, you should first install the latter and then add the former. If this sounds new and somehow complicated for you, there are a lot of nice guides on the Internet that you can use for a quick start.

The procedure to install on Linux can be found at:

http://trac.osgeo.org/postgis/wiki/UsersWikiInstall

For Windows, a good choice is downloading the binary packaged by Enterprise DB:

http://www.enterprisedb.com/products-services-training/pgdownload#windows