Book Image

GeoServer Beginner's Guide - Second Edition

By : Stefano Iacovella
Book Image

GeoServer Beginner's Guide - Second Edition

By: Stefano Iacovella

Overview of this book

GeoServer is an opensource server written in Java that allows users to share, process, and edit geospatial data. This book will guide you through the new features and improvements of GeoServer and will help you get started with it. GeoServer Beginner's Guide gives you the impetus to build custom maps using your data without the need for costly commercial software licenses and restrictions. Even if you do not have prior GIS knowledge, you will be able to make interactive maps after reading this book. You will install GeoServer, access your data from a database, and apply style points, lines, polygons, and labels to impress site visitors with real-time maps. Then you follow a step-by-step guide that installs GeoServer in minutes. You will explore the web-based administrative interface to connect to backend data stores such as PostGIS, and Oracle. Going ahead, you can display your data on web-based interactive maps, use style lines, points, polygons, and embed images to visualize this data for your web visitors. You will walk away from this book with a working application ready for production. After reading GeoServer Beginner's Guide, you will be able to build beautiful custom maps on your website using your geospatial data.
Table of Contents (20 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Preface

Nowadays, web mapping is all over the internet. User friendly interfaces and efficiency are mandatory requirements for GIS, as for any other system. If you are going to start a new web mapping application, you will not start from scratch. GeoServer is one of the biggest players in the web mapping field. It has a solid developer community and a high maturity level. Although it's not an easy piece of software to master, the latest releases have greatly improved stability and ease of management. GeoServer Beginner's Guide offers you a practical introduction to GeoServer. Beginning with the installation and basic usage, you will learn to use the administration interface for adding data, configuring layers, customizing OGC services, and securing your site. You will find many step-by-step examples covering topics from data store configuration to layer publication and style customization. If all this sounds new and strange to you, don't worry; GeoServer Beginner's Guide will introduce you to the fundamentals of GIS and will then clearly explain all the basic tasks performed in order to build maps. This book is meant to expand your knowledge of web mapping from something you have either heard of or have practiced a little into something you can apply at any level to meet your needs in incorporating maps into a site. I hope you will enjoy reading this book as much as I enjoyed writing it.

What this book covers

Chapter 1, GIS Fundamentals, introduces you to GIS concepts. It guides you through spatial data types and maps. You will discover how spatial information is stored and how to set up a map. You may want to skip this chapter if you already have a solid background in GIS.

Chapter 2, Getting Started with GeoServer, guides you through setting up your first GeoServer instance. It shows you, step by step, how to download the most recent version of the software and its requirements, that is, Java and a servlet container. For each component, a detailed description of how to install it is included.

Chapter 3, Exploring the Administrative Interface, covers GeoServer's Web Administration interface. It explains how to log in and access each section. You will familiarize yourself with data configuration following a common workflow that starts by adding data to GeoServer and guides you through to publication. Included in this chapter are screen captures that define the main areas of the program and menu items--all of which is very helpful when accessing the interface for the first time.

Chapter 4, Adding Your Data, demonstrates how you can configure data in GeoServer. The examples included will show you how to add and publish shapefiles and PostGIS tables, two of the most common formats, which are also natively supported by GeoServer. The extensions for Oracle is also discussed.

Chapter 5, Accessing Layers, guides you through data publication and covers in detail all output types offered by GeoServer for your data. Raster formats such as JPEG and PNG are discussed for maps, while vector formats such as GeoRSS and GEOJSON are explained for vector output. We will also explore OpenLayers, a JavaScript framework that GeoServer includes in its output format when you want to serve your data as an application.

Chapter 6, Styling Your Layers, explains how to apply styles to your layers. Styles let you render your data according to attributes, in order to build pretty maps. SLD's syntax, the standard for data rendering, will be explained in detail, with examples for different geometry types such as point, polyline, and polygons. The chapter also illustrates how to build scale-dependent symbology and how to compose different rendering in a group, to mimic a map in WMS.

Chapter 7, Creating Simple Maps, describes how to build client applications with the JavaScript framework. JavaScript is a powerful and widespread language and, unsurprisingly, it is one of the best choices when developing a web application. We will build some sample maps using Google Maps API, OpenLayers, and Leaflet.

Chapter 8, Performance and Caching, covers the use of integrated GeoWebCache. Caching maps is a common strategy with map servers; it allows you to serve pretty complex maps without running out of resources. The GeoServer 2.X release introduces a great change: you can fully administer the integrated GeoWebCache from the web admin interface. In the examples included, you will configure cache with different strategies, optimizing performance, or disk usage.

Chapter 9, Automating Tasks - GeoServer REST Interface, explains how to control the GeoServer configuration from a remote location through the REST interface. This may prove a great help if you have to administer a GeoServer site without the possibility of using the web admin interface, or if you want to automatize, in an external procedure, some admin tasks. The included examples will let you add data, configure styles and layers, and publish them. All the operations are demonstrated with Python and curl syntaxes.

Chapter 10, Securing GeoServer Before Production, covers the GeoServer security module. It first discusses general configuration for security, that is, password encryption, and then the security model is explained. A case history shows you how to create a configuration where different users are in charge of administration, editing, and publication tasks.

Chapter 11, Tuning GeoServer in a Production Environment , explains the advanced considerations for running a successful GeoServer site. It covers Java Runtime tuning and data and services optimization. Finally, a high availability configuration is detailed, with instructions for configuring a balanced GeoServer installation.

Chapter 12, Going Further - Getting Help and Troubleshooting , shows you how to access community tools and help for going further than what you will learn from this book. It also covers a concise introduction to other data publication standards implemented in GeoServer, WCS, and WFS. With WCS and WFS, you can serve vector and raster data to clients that not only need to show a map but have to perform some processing on the data.

What you need for this book

Installation and download instructions are described for all the software packages you will need. You just need to have access to a computer with an online connection for downloading packages. The instructions cover both Linux and Windows operating systems, so you may select the one you prefer. All the software used in this book is freely available, most of the time as an Open Source project. Hardware requirements for development purposes are not very high. A relatively modern laptop or desktop will be enough for running examples. The source code and data used in this book are freely available on the Packt website.

Who this book is for

If you are going to use maps on your site, incorporate spatial data in a desktop application, or you are just curious about web mapping, this book offers you a fast-paced and practical introduction. Particularly if you need to develop a web application supporting maps, you will find that GeoServer is one of the best solutions you can choose. Analysts will discover how GIS works and how it can be integrated into complex systems. System administrators may also find this book useful for planning installation, tuning, and maintenance.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, and user input are shown as follows: "Under the subdirectory structure of C:\chapter8-benchmark\src\main\java\com\packt is the MyBenchmark.java file."

A block of code is set as follows:

  http://localhost:8080/geoserver/web/wicket/bookmarkable/
     org.geoserver.wms.web.data.StyleEditPage?  
     6&name=PopulatedPlacesBlueLabeled 

Any command-line input or output is written as follows:

 <display-name>GeoServer</display-name>

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "The Encryption section lets you hide web admin parameters."

Note

Warnings or important notes appear like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply email [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed directly to you. You can download the code files by following these steps:

  1. Log in or register to our website using your email address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/GeoServer-Beginners-Guide-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/GeoServerBeginnersGuideSecondEdition_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at [email protected] with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.