geoserver manual

Download Geoserver Manual

If you can't read please download the document

Upload: tomi-toivio

Post on 16-Nov-2014

54 views

Category:

Documents


6 download

DESCRIPTION

A manual for a GIS platform.

TRANSCRIPT

GISEEM Manualby Tomi Toivio [email protected] Shalin Finland

IntroductionThis manual documents the GIS platform of the GIS Enhanced Ecological Mapping for Improved Governance of Natural Resources (GISEEM) project. The GISEEM platform is used by local communities to document the environmental and cultural knowledge of two forest areas, Giitune and Karima. The first part of this manual covers the basics of installation and administration of the server and the database. Use of uDig for editing is covered in the manuals for the communities. This part requires some knowledge of computers since it covers issues like database administration and web programming. The second part of this manual is for the end-users of the system. It covers the use of uDig software to edit the geographic data. The Karima hill data used in this manual is located in: http://www.esnips.com/doc/bb4e64cb-c861437a-b7eb-d5b9ecda7653/KARIMA.

Components of the GISEEM PlatformThe GISEEM Platform consists of the following parts: Geoserver, a WMS and WFS server, which serves our data online. Postgis/Postgresql database, which is used to store our data. uDig, User-Friendly Desktop and Internet GIS, used for editing the data.

All of these are Open Source software and available free of charge for both Windows and Linux operating systems. Additional documentation and downloads are available at the following web sites: - Geoserver: http://www.geoserver.org - PostgreSQL: http://www.postgresql.org - uDig: http://udig.refractions.net

Installation of the softwareFirst we need to install the software for the system. This means installing uDig, Geoserver and Postgresql database with the Postgis plugin.

Here the installation instructions are given for Windows XP, since installation varies in different distributions of Linux. Consult manuals on the web-pages of the different programs to find installation instructions for Linux. Before installing any of these programs you need to install Java SDK. If you do not yet have Java installed on your computer, consult your systems administrator, or go to http://java.sun.com and follow the installation instructions. Installing uDig: 1. Go to http://udig.refractions.net with your web browser and download the latest version of uDig 2. When the download is complete, click on the uDig icon to install it.

3. In the window that opens, click on Next.

4. In the license agreement window click on I Agree.

5. In the next window, choose destination folder and click on Next.

6. In the following window, select where you like to install programs short cuts and click on Install.

7. Wait while uDig installs and the click Finish to close the installation wizard.

Installing Geoserver: 1. Go to http://www.geoserver.org and download the Geoserver. 2. Click on the Geoserver icon to install it.

3. In the following screen click on Next to install Geoserver.

4. In the next screen click on I Agree to agree to the installation instructions.

5. Choose folder for installation of Geoserver and click on Next.

6. Select Geoserver Data Directory and click on Next.

7. Click on Finish to complete the Geoserver installation.

Installing Postgresql: 1. Go to http://www.postgresql.org with your web browser and download PostgreSQL 2. Click on the icon to unzip the archive.

3. After unzipping the archive click on PostgreSQL icon to install it.

4. Next select the language you want and click on Start.

5. In the next screen click on Next to continue.

6. You can read the installation notes or just click Next to continue

7. In the installation options screen select Postgis Spatial Extensions to be installed on the hard disk and click on Next.

8. Select a password and retype it. Click Next.

9. In the following screen select UTF-8 for encoding. Enter a different password twice for the superuser. Click on Next.

10. In the Enable procedural languages screen click Next.

11. In the Enable contrib modules screen click Next.

12. Click Next to install. Wait while the database is installed.

13. When the installation is complete click on Finish.

Configuring the systemWe need to configure the system. First we will create a Postgis database for the Karima data. We will use pgAdmin III to administrate the database in a convenient fashion. Creating a database: 1. Select PostgreSQL from the All Programs menu of Windows and click on pgAdmin III.

2. In the pgAdmin view select your database server.

3. Right-click on Databases in the Object browser and select New Database.

4. In the New Database window write a name for your database. Select postgres as the owner. Select template_postgis as the template. Click on OK.

Now we need to enter data to the database. This is done by converting the data shapefiles into SQL queries with the use of shp2pgsql program. Convert shapefiles to SQL: 1. Download the Karima shapefiles from 2. Go to All Programs, select PostgreSQL and select Command Prompt. 3. Enter command shp2pgsql karimacattle.shp karimacattle > karimacattle.sql to convert karimacattle shapefile into karimacattle SQL query that creates a karimacattle table in the database. 4. Repeat this step for each shapefile. SQL filename and table name should be the same as the name of the shapefile. SQL files have to be run as SQL queries to create tables in the database. Create tables in database:

1. Open one of the SQL files you just created in an editor like Notepad. You will see SQL code. Copy it.

2. In the pgAdmin, select your database and click on SQL queries.

3. In the SQL Query window, paste the SQL code and click on Execute Query.

4. Table has now been created in the database. Repeat this procedure for each SQL file. Now we have to start and configure Geoserver. Start GeoServer: 1. Go to All Programs, select Geoserver and click on Start GeoServer.

2. A Start GeoServer window appears. You can see messages from the GeoServer that are often useful so you can see what the program does.

3. Enter address http://localhost:8080/geoserver/ in your web browser.

4. Click on Login. In the next page enter your Username and Password. Click on Submit.

Now we need to add the database as a Data Source. Adding Data Source to GeoServer: 1. Click on Config.

2. Click on Data.

3. Click on DataStores.

4. Click on New.

5. Select Postgis and enter a name for your database. Click New.

6. Now you need to enter the host, port, name, username and password of your database. Click on Submit.

7. Then click on Apply and Save to save your changes.

FeatureTypes are the different tables in your database. You need to enable each of them to access them. Create a FeatureType: 1. Go to Config > Data > Featuretypes and click on New.

2. Select one of the tables in your database and click on New.

3. In the next window you need to select a style for your FeatureType. For point data point is a good style.

4. Next your need to enter SRS for your data. With Karima data we can use 4326. 5. Click on Generate to automatically generate a Bounding Box.

6. The rest of the page is not important to us now, so click on Submit.

Postgis AdministrationYou need to do some administrative tasks with the database. Typically you would at least have to create new columns for tables, edit database contents etc. Add a column to a table: 1. Open pgAdmin. You will see an Object Browser like the one below. Find our GiseemDB database.

2. Go to Schemas > public > Tables and you will see the tables of the database. Choose one of the tables.

3. Here you can do many operations on the tables. Add a new column by right-clicking on a table and choosing New Object > New Column.

4. In the next window you need to add at least a Name and Data Type to the new column. Then click on OK.

5. Now, click on View Data to see the contents of the table.

6. A window that allows you to view and edit the table pops up.

7. Click on Refresh after you have edited the table to save your changes. Click on Yes when a popup asks if you want to store data.

Maybe it is a bad idea to add a new column. Close the editor view, and double-click on the table you just edited. The following window appears.

8. Go to the Columns tab, choose the column you just added, and click on Remove, Ok and Ok.

Using uDig to view dataFor editing of this data we use software called uDig, or User-friendly Desktop and Internet GIS. Start uDig: 1. First you need to start the uDig software. Click on Start icon at the left bottom of the screen.

2. Then click on uDig in the menu that pops up.

3. Now the uDig will start, and it will look like this.

Start a new project: 1. We need to start a new project. Go with the mouse pointer to File in the top left corner, then go to New, and click on New Project.

2. You will see a New Project window like this. Project Name and Directory are not important in training. Just click on Finish.

Add layers to project: 1. Now we need to add Karima layers to the project. Go to Layer at the top bar and click on Add.

2. You will see Add Data window like this. Click on Web Feature Server and then click on Next.

3. Here you need to enter internet address http://localhost:8080/geoserver/wfs? service=WFS&request=GetCapabilities to the URL field and then click on Next.

4. You will see a Resource Selection window like this. First click on the box next to My Geoserver WFS so that all Karima layers are selected. Then click on Finish.

5. Now the program has loaded all the Karima layers. It looks like this.

View layers: 1. On the left you can see a menu of the different layers. If the box is checked it means the layer is visible. Layers that consist of points have a little box symbol, layers that consist of lines have a line symbol, and those that consist of polygons have a polygon symbol.

2. Now let us navigate around the map, clicking on the plus and minus Zoom buttons will take you closer or farther from the ground. Click on the plus button zoom into the map.

3. After you have zoomed in for a few times it should look like this.

4. Click on the Pan Map View button from the top bar.

5. Then hold down the mouse button above the map and move the mouse around to move the map.

View a single layer: 1. Select karimaclans_Type as the active layer. Then click on the Zoom to layers button above the layers menu to zoom to your active layer. You should see the whole map again.

2. Tick off all boxes except karimaclans_Type so that all layers except that one are invisible.

3. You can see that now only the Karima clans layer is visible.

4. Then select Table from the bottom of the page and you will see information on different clans. Click on one of the clans.

5. You can now see the area of that clan highlighted.

6. uDig sometimes doesnt remember to redraw the map automatically. Click on Redraw Map button and see what happens.

Change the way layers look: 1. Sometimes it can be useful to adjust the way the program shows the layers. Tick off all layers so that only karimarivers_Type is visible and choose it. Then click on the palette button above the layers menu.

2. You see a window like this. Click on the Color Button next to the Line text.

3. You see a Color window like this. Choose blue or some other color suitable for a river and click Ok.

4. Then check the Label box to add a name to the rivers.

5. Click Apply at the bottom of this window.

6. Now the rivers are blue and their names are visible.

To commit changes: Two most important buttons when editing with uDig are these: Commit Changes button: Rollback Changes button:

You should click on Commit Changes button each time you change something. Unless you have made a mistake, in which case you should click on Rollback Changes button. To view information: 1. Now let us view Karima factory data. Tick boxes of all layers so that all layers are visible. Select karimafactory_Type on the menu, it becomes the active layer.

2. Then click on the Information button on the top bar.

3. Then click on the factory in the map.

4. Now you can see information about the factory in the bottom of the page. There isnt so much information yet, just that it is a coffee factory.

5. Let us add some information. First click on Table button next to the Information button, and you will see a table of the Karima Factory data.

6. Then you can click on the table below the information field and write something about the factory.

7. To save the information you have written you need to click on the Commit Changes button at the top bar. When you are doing actual editing always click on this button after you have added something new to the Karima data!

Add a point: 1. Now let us add a new Factory to Karima. Click on the Arrow next to this Icon in the top bar and select Create Point tool.

2. Then click somewhere on the map and you will see a new factory.

3. At the bottom of the page you see the information of the new factory. Click on name field and enter a name for the new factory.

4. Now you need to click Commit Changes again so that the new factory is saved into the database.

Create polygons: 1. It is time to create polygons. Now let us add another forest. Select karimaforest_Type on the menu left side.

2. Then select Create Polygon Tool from the top bar.

3. Click somewhere around the map so that you draw a polygon. The polygon has to be closed, so that you need to click again on the first point when you stop drawing.

4. Now you can select table from the bottom menu bar and add a name to the layer.

5. But then again, maybe we should not add imaginary forests. Select Delete Feature tool from the top bar.

6. Then just click on the extra forest to make it disappear.

Draw lines: 1. Now we can use the line tool. Maybe there will be a new road in Karima forest? Let us draw one. Select karimaroads_Type from the menu on the left.

2. Then select create lines tool from the top menu.

3. Now you can just draw a road around the area. One click creates one more stretch of the road. Click twice and the road will end.

4. Maybe we dont want that road anyhow. Click on Rollback Changes Button on the top bar, next of the Commit changes button, and the road will disappear. Edit the way points look: 1. To edit Karima Schools select karimaschools_Type from the layers menu and click on the Palette button.

2. Select a square size 10 to make schools more visible.

3. Then check Label to make the name of the school visible on the map. Click on Apply and Close.

4. Next click on the Triangle or Focus button to focus on your current layer.

5. The only school on the map should look like this now.

Create school: 1. Now, choose Create Point Tool from the top bar to create another school.

2. Click somewhere on the map to create another school.

3. You can see the information table of the new school at the bottom of the page. Select name field and enter a name for the school.

4. Now click on commit changes again to save your new school.

5. The school should now look like this.

Move points: 1. But what if the school is in the wrong place? It has to be moved a bit. Select Edit Geometry from the top menu bar.

2. Next you can hold the school by holding down your mouse button above it, and move it around a bit. The school will be a yellow box in its new location.

3. When you are happy with the schools new location, click on Commit Changes to make it stay there.

4. Go to the table again and click on the Story column on your New Schoolss row. Write a little story.

5. Click Commit Changes again.