You are on page 1of 75

GISEEM Technical Manual

GISEEM Technical Manual


Geoserver, Postgis and uDig for PGIS

Tomi Toivio
Shalin Finland

1
GISEEM Technical Manual

Table of Contents
GISEEM Technical Manual.................................................................................................................1
GISEEM Manual..................................................................................................................................4
Introduction..........................................................................................................................................4
Components of the GISEEM Platform.................................................................................................4
Additional documentation....................................................................................................................5
License..................................................................................................................................................5
Installation of the software...................................................................................................................5
Installing Java.......................................................................................................................................5
Installing uDig......................................................................................................................................8
Installing Geoserver on Ubuntu Linux ..............................................................................................11
Postgis installation on Ubuntu Linux.................................................................................................16

Postgis installation on Windows........................................................................................................17


Creating a Postgis database................................................................................................................26
Converting shapefiles into SQL queries.............................................................................................30
Creating tables in the database...........................................................................................................30
Starting Geoserver .............................................................................................................................31
Adding a Postgis database to GeoServer............................................................................................33
Change GeoServer login and password..............................................................................................36
Adding layers to GeoServer...............................................................................................................36
Viewing layers in GeoServer..............................................................................................................38
Creating Layer groups........................................................................................................................39
Postgis Administration.......................................................................................................................40
Using uDig to view data.....................................................................................................................45
Starting a new project in uDig............................................................................................................46
Introduction to uDig user interface.....................................................................................................47
Adding a satellite basemap to uDig....................................................................................................52
Adding a layer to uDig ......................................................................................................................54
Viewing layers in uDig.......................................................................................................................58
Editing GIS data with uDig................................................................................................................65

2
GISEEM Technical Manual

3
GISEEM Technical Manual

GISEEM Manual
by Tomi Toivio
tomi.olavi.toivio@gmail.com
Shalin Finland

Introduction
This 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 three areas in Kenya,
Giitune, Mukogodo 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 last part of the manual.

The section about editing GIS data with uDig is useful for the community participants. Editing with
uDig requires some understanding about basic use of computers. Use of uDig is quite similar to
using a vector drawing program such as Inkscape. Basically you are just drawing maps instead
vector graphics.

The first sections are about installation, administration and configuration of Geoserver and the
Postgis database for the administrators of the GIS platform. Installation and administration is
covered for both Ubuntu Linux and Windows XP. Typically command line is used for Linux
installation while Windows has easy to use graphical installers.

The administrator would need basic knowledge about GPS and GIS, basic knowledge of SQL
databases, and some command line Linux administration skills if Linux is used. JavaScript web
programming skills are useful if there is a need to create some more complicated interfaces to the
data with OpenLayers. OpenLayers programming is not covered in this manual.

This manual uses Karima data collected by the Giseem project in the examples. You can download
this data from eSnips: http://www.esnips.com/doc/210c19b6-7c19-4a09-83e4-
065e70ce8a33/KARIMA

This manual is written using simple step-by-step procedures and screen shots whenever possible.

Components of the GISEEM Platform


The 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 GIS 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.

4
GISEEM Technical Manual

Additional documentation
Additional documentation and software downloads are available at the following web sites:
- Geoserver: http://www.geoserver.org
- PostgreSQL: http://www.postgresql.org
- PostGIS: http://postgis.refractions.net/
- uDig: http://udig.refractions.net
- OpenLayers: http://openlayers.org/

License
This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a
copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative
Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

Installation of the software


First 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 and Ubuntu Linux. You may also want
to consult the web-pages, manuals and mailing lists of the programs if you run into problems.

Installing Java
Before installing any of these programs you need to install Java JDK. 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. Remember you need the JDK, not the runtime environment!

After you have installed JDK you need to set up the Java_Home environmental variable.

Setting up Java_Home in Windows:


1. Go to Control Panel and click on Java.

2. Click on Java tab and then on and View.

5
GISEEM Technical Manual

3. Click on Find.

4. Click on Next.

6
GISEEM Technical Manual

5. Now you need to browse to the folder containing the JDK and click on Next.

6. Click on Next.

7
GISEEM Technical Manual

7. Click on Ok.

Installing uDig
Installing uDig:
1. Go to http://udig.refractions.net with your web browser and download the latest version of
uDig

8
GISEEM Technical Manual

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.

9
GISEEM Technical Manual

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

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

10
GISEEM Technical Manual

Installing Geoserver on Ubuntu Linux


Geoserver is the component of the system that is used to serve the GIS data contained in the
PostGIS database online. To install it you need a server with Linux or Windows operating system
that has the Java SDK installed.
Installing Geoserver on Ubuntu Linux:
Note: You might use a later version of Java JDK and Geoserver when you install these. You need to
modify the commands accordingly.
1. If you don't have JDK installed, you need to install Java JDK 1.6. On Ubuntu you can write
command sudo apt-get install sun-java6-jdk on the command line. It will take some time
while the package manager downloads and installs software.
2. Next you need to set the JAVA_HOME environmental variable.
You can use these commands on the command line or insert them to your to bash.rc file:
JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15/
export JAVA_HOME
3. Download the OS independent binary of Geoserver from http://www.geoserver.org
4. Unzip the Geoserver binary
unzip geoserver-2.0.0a-bin.zip
5. Set the Geoserver_Home environmental variable.
You can use these commands on the command line or insert them to your to bash.rc file.
You have to write the path where you installed the Geoserver in the first command:
GEOSERVER_HOME=.../geoserver-2.0.0/
export GEOSERVER_HOME
6. Now you can run Geoserver with the following command:
/geoserver-2.0.0/bin/startup.sh
7. Check that your Geoserver is running by visiting http://localhost:8080/geoserver
Write the address of the server you are using instead of localhost if you are installing
Geoserver remotely.
Installing Geoserver on Windows:
1. Go to http://www.geoserver.org and download the Geoserver Windows Service Installer.

2. Unzip the Geoserver archive in a convenient place.

3. Click on the Geoserver icon to install it.

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

11
GISEEM Technical Manual

5. In the next screen click on I Agree to agree to the License Agreement.

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

12
GISEEM Technical Manual

7. Choose Start Menu Folder and click Next.

8. Find the path to your Java Development Kit and click on Next.

13
GISEEM Technical Manual

9. Select Geoserver Data Directory. The default path should be fine. Click on Next.

10. Choose a User Name and Password for Geoserver administrator. Click on Next.

14
GISEEM Technical Manual

11. Geoserver is ready to install. Click on Install.

12. Click on Finish to complete the Geoserver installation.

15
GISEEM Technical Manual

Postgis installation on Ubuntu Linux


Postgis is a GIS database. It is a plugin for the PostgreSQL database. It is used to store the GIS data
that GeoServer serves on the internet and that is edited with uDig. Please consult the Postgis and
PostgreSQL manuals if you run into trouble here.

Installing PostGIS on Ubuntu:


1) Install Postgis, PostgreSQL and Pgadmin3 from the command line:
sudo apt-get install postgresql-8.3-postgis postgis pgadmin3
2) Login as postgres user:
sudo su postgres
3) Create a new user for the database:
Note: do this on the command line on your own account, not as postgres user.
sudo -u postgres createuser -D -A -P giseem
4) Create a database called giseem:
createdb giseem
5) Enable PL/pgSQL language in your database:
createlang plpgsql giseem
6) Load the postgis definitions into your database:

16
GISEEM Technical Manual

psql -d giseem -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql


7) Add EPSG definitions:
psql -d giseem -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql
8) Grant all rights to user giseem:
psql
grant all privileges on database giseem to giseem;
\q
Now you will be able to connect to your Postgis database with Postgisadmin3 and Geoserver!

Postgis installation on Windows


Windows has a graphical installer which makes it easier to install PostgreSQL and Postgis.

Installing Postgis on Windows:


1. Go to http://www.postgresql.org with your web browser and download PostgreSQL
2. Click on the icon to install it.

3. Click next in the screen that appears.

4. Select the directory to install PostgeSQL.

17
GISEEM Technical Manual

5. Select a directory to store your data.

6. Select a password for your database's postgres superuser. You also have to re-write it to
avoid typos. Write it down!

18
GISEEM Technical Manual

7. Select a port the server should listen on. The default port 5432 should be fine.

8. Now you can select a locale and whether to install pl/psql in template1 database. Here we
can just use the defaults and click on Next.

19
GISEEM Technical Manual

9. In the next screen just click on Next. Installation takes some time, just wait. You will see a
progress bar indicating the progress of the installation.

10. In the last screen Launch stack builder has to be checked. Click on Finish.

20
GISEEM Technical Manual

11. In the stack builder you need to select your PostgreSQL installation, probably it is the
default PostgreSQL 8.4. on port 5432. Then click on Next.

12. In the applications to be installed screen select Spatial Extensions and check PostGIS 1.4 for
PostgreSQL 8.4 v1.4.0 to be installed and click on Next.

21
GISEEM Technical Manual

13. Select the mirror that is closest to you and click on Next.

14. Select a download directory and click on Next. It will now download the application.

22
GISEEM Technical Manual

15. In the following screen you need to just click Next to start the installation.

16. Click on I Agree to agree to the license agreement.

23
GISEEM Technical Manual

17. Here you can leave install PostGIS and Create spatial database options enabled and click on
Next.

18. In the next screen select the location to install the PostGIS. Then click on Next.

24
GISEEM Technical Manual

19. In the next screen you have to enter the password for the database. You selected the
password earlier in the installation procedure. Then click on Next.

20. Now you have to choose a name for your spatial database. Why not write Giseem or
GiseemDB. Then click on Install.

25
GISEEM Technical Manual

1. Now the installation is complete! Click on Close.

Creating a Postgis database

26
GISEEM Technical Manual

Now we need to configure the system for use. First we will create a Postgis database for the Karima
data. We will use pgAdmin III to administrate the database in a convenient fashion. You could also
administrate it from the command line but this method is easier to understand.

Creating a database:
1. Select PostgreSQL from the All Programs menu of Windows or the corresponding menu of
Ubuntu and click on pgAdmin III.

2. You will now see the PgAdmin III window.

3. Now you have to create a new connection. Click on the first icon.

4. Now you need to enter the information for your database connection. You can write Giseem
in the connection name. Host is the IP address of your Geoserver computer, but if you are on

27
GISEEM Technical Manual

the same computer you can write localhost. Write the password you chose when you
installed PostgreSQL. Click on OK.

5. Now you can see your database in the Object browser of your pgAdmin III.

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

28
GISEEM Technical Manual

7. In the New Database window write a name for your database, such as giseemDB. Select
postgres as the owner. Select postgres as the owner. Select postgis as the template. Use
pg_default tablespace. Click on OK.

8. Now you can see your new database in the Object Browser.

29
GISEEM Technical Manual

Converting shapefiles into SQL queries


Project data is typically collected with GPS units. GPS unit data is in file format called shapefile
with postfix .shp. These shapefiles have to be transferred from the GPS unit to your computer.
Consult the manual of your GPS for instructions how to do this.

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 http://www.esnips.com/doc/210c19b6-7c19-4a09-
83e4-065e70ce8a33/KARIMA.

2. Unrar the archive. You may need to find a software for this if none is installed on your
operating system.

3. Go to the shell or command line of your operating system.

4. Enter command shp2pgsql Cattle_Dip.shp Cattle_Dip > Cattle_Dip.sql to convert


Cattle_Dip.shp shapefile into Cattle_Dip.sql SQL query that creates a Cattle_Dip table in
the database.

5. Repeat this step for each shapefile. SQL filename and table name should be the same as the
name of the shapefile.

Creating tables in the database


You have created SQL files from your shapefiles. Now SQL files have to be run as SQL queries in
Pgadmin3 to create tables in the database. You could also do this on the command line of the
PostgreSQL database but we will use the graphical database administration tool since it is easier.

30
GISEEM Technical Manual

Create tables in database:


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

SET STANDARD_CONFORMING_STRINGS TO ON;


BEGIN;
CREATE TABLE "schools" (gid serial PRIMARY KEY,
"id" int4,
"identifier" varchar(25));
SELECT AddGeometryColumn('','schools','the_geom','-1','POINT',2);
INSERT INTO "schools" ("id","identifier",the_geom) VALUES
('0','Karima
School','0101000000EFC00F052BCB1041BCBBC0DDA5F66241');
END;

2. In the pgAdmin, select your database and click on CREATE Script.

3. In the SQL Query window, paste the SQL code into the SQL Editor.

4. Click on Execute Query.

5. Table has now been created in the database. Repeat this procedure for each SQL file you
just created from the Karima shapefiles.

Starting Geoserver

31
GISEEM Technical Manual

Now we have to start and configure Geoserver.

Starting GeoServer on Linux:

1. Go to your /geoserver/bin directory.


2. Enter command ./startup.sh

Starting GeoServer on Windows:


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.

32
GISEEM Technical Manual

4. In the top of the page you need to write your Username and Password and click on Submit.

Adding a Postgis database to GeoServer


We have the GIS data in the Postgis database. The GeoServer cannot use this data before the
Postgis database has been added as a data source. Now we need to add the database as a Data
Source.

Adding Data Source to GeoServer:


1. Click on Add Stores.

2. Click on PostGIS NG in the Vector Data Sources section.

33
GISEEM Technical Manual

3. Leave cite as it is. Here you can write a Data Source Name and a Description for your
database. It is not important what these are.

4. Below these you see more fields to fill. Mostly the default ones should work. Just write
database name as giseemDB (if you created database with that name), user is postgres and
then write the password you selected for your database.

34
GISEEM Technical Manual

5. Click on Save.

6. You will see that the Karima data is now loaded into the Geoserver from the database.

35
GISEEM Technical Manual

Change GeoServer login and password


GeoServer uses login admin and password geoserver as the default administrator username and
password. It is very useful to change these so that a random visitor to your site cannot change your
settings.
Changing GeoServer administrator login and password:
1. Edit file /GEOSERVER_DATA_DIR/security/users.properties. Use command such as
gedit /GEOSERVER_DATA_DIR/security/users.properties
2. You can now remove the old administrator and add a new one
Remove this line: admin=geoserver,ROLE_ADMINISTRATOR
Add a new line: myusername=mypassword,ROLE_ADMINISTRATOR

Adding layers to GeoServer


Your GeoServer is now able to load data from the Postgis database. You still need to add each of
the layers in the database separately.

Adding layers to GeoServer:

1. Now you need to click on layers from the bar on the left side of the browser screen.

2. Click Add a new resource.

3. Select cite:Giseem Database.

4. Choose one of the Karima layers inside the database.

36
GISEEM Technical Manual

5. In the next screen you can write an abstract about the layer.

6. Below that you can add keywords if needed.

7. You can add metadata links.


8. Below that one you have to write in EPSG:32737 as the Declared SRS.

37
GISEEM Technical Manual

9. Below that you see the bounding box coordinates. Click on both Compute from native
bounds and Compute from data to compute them automatically.

10. In the bottom of the page is the Save button. Click on it.

Viewing layers in GeoServer


You can view the various layers you have added to GeoServer. Note that you can also view Layer
Groups if you have created them. GeoServer offers various methods of viewing them. OpenLayers
allows you to view them directly in your browser. KML allows you to view layers in Google Earth
if you have that software installed on your computer. There are also other options such as GML and
downloading of the layers in various file formats.

Viewing a layer:

1. Click on layer preview.

2. You will see a list of layers. You will see that there are three different preview options.
Click on OpenLayers.

3. You can now see an OpenLayers preview of your layer.

38
GISEEM Technical Manual

4. If you click on KML the layer will be opened in Google Earth (if you have Google Earth
installed).

Creating Layer groups


You can create a group of many layers. This is useful since it allows you to view a group of layers
at the same time with OpenLayers.

Create layer groups:


1. Click Layer Groups on the Data directory on the left side of the GeoServer window.

39
GISEEM Technical Manual

2. Click Add new layer group.

3. Write a name for your layer group. Click Submit.

4. Click on Add layer.

5. Click one of your layers to add it. Repeat these steps to add all the layers you need.

6. Click on Find and select the EPSG:32737 Click on Generate Bounds.

7. Click on Save.

Postgis Administration
You need to do some administrative tasks with the database. Typically you would at least have to
create new columns for tables and edit table contents. In this section there are the procedures for
some basic editing of the database with Pgadmin3.

40
GISEEM Technical Manual

Add a column to a table:

1. Open pgAdmin3. You will see an Object Browser like the one below. Find our Giseem
database.

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

41
GISEEM Technical Manual

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.

42
GISEEM Technical Manual

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
pop-up asks if you want to store data.

43
GISEEM Technical Manual

8. 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.

44
GISEEM Technical Manual

Using uDig to view data


For editing of this data we use software called uDig, or User-friendly Desktop and Internet GIS. It
is used to connect to the Geoserver through the internet.

Udig is available for both Windows and Linux. Installation is very simple. You can go to
http://udig.refractions.net to download uDig for your operating system. Follow the installation
instructions. You can also find additional documentation for uDig from the website.

Before you start, you need to know the internet address (URL) of the Geoserver you are using to
access the data. Ask for the address of the Geoserver from the person administering the Geoserver.

Start uDig:

45
GISEEM Technical Manual

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.

Starting a new project in uDig


Udig stores data in project files. We need to create a new project for our work with uDig.

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.

46
GISEEM Technical Manual

2. You will see a New Project window like this. You can select a Project Name and Directory
to save your project in. Then click on Finish.

Introduction to uDig user interface


Menu bar

47
GISEEM Technical Manual

Menu bar is similar to all Linux or Windows programs that use a graphical interface. The various
functions will be covered later in this manual.

Tool bar

At the top of the uDig window you can see a toolbar. This contains the different tools that can be
used in uDig.

You can change the function of the buttons with small arrows pointing downwards by clicking on
the arrow.

The first button allows you to save and load files.

The next two buttons are for saving the project you are working on.

This button allows you to print your uDig project.

These buttons allow you to move backward and forward in the history of actions you have
committed in uDig.

The first button is for redrawing the map if needed and the second is for halting the drawing of the
map if it is too slow.

This button zooms so that all the data in your uDig project is visible.

These two buttons zoom into (plus sign) and out of (minus sign) your project.

This button zooms into the data you have selected.

48
GISEEM Technical Manual

This button allows you to commit the changes you have made. This means the changes will not be
saved into the shapefile or database before you click on this button.

This button erases the changes you have made. They will not be saved into the database or
shapefile.

This button allows you to zoom around in your map with your mouse.

This one is for panning around the map with your mouse.

This one is for box selection. It means you can draw a box with your mouse and all the points inside
the box are selected.

The next button has two different functions. You can switch between these by clicking on the
arrow. The first function is for getting data of a point on the map. The second function is for
measuring distance on the map.

The next button has four different functions that can be changed from the arrow. The first function
allows you to edit geometries. The second function allows you to add vertex points to a geometry.
The third one is for removing vertexes. The fourth one is for cutting holes in areas. Not all of these
functions can be used on all layer types. Only editing of geometries is available for a point layer.
Cutting holes is only allowed for area layers.

The next button has four different functions. The first function allows you to create areas, lines or
points, depending on the type of layer you are in. The next function allows you to fill an area. The
third one is for creating a rectangle. The last one is for creating an ellipse. Only the first function is
available with line and polygon layers.

The last button allows you to delete features.

49
GISEEM Technical Manual

Project window

In the project window you can see your projects and the layers in each project. This usually
important only if you have many projects open at the same time.

Layers menu

Layers menu allows you to select various layers you have in your project.

The checkbox next to a layer means the layer is visible. If you uncheck it the layer becomes
invisible.

Right-clicking on a layer allows you to perform a number of actions on the layer: copy it, paste it,
delete it, change style, zoom to layer, rename, various operations, export to a file type, and to see
it's properties. These are covered later in this manual.

50
GISEEM Technical Manual

The biggest screen shows the map. Here is where you can view the map layers and edit them.

In the bottom of the main window you can see a bar. This bar has the scale of the map, the
projection of the map and the coordinates of your cursor.

Catalog view

In the bottom we can see one more window. This is mostly useful to us in the table view, which you
can access by clicking on the Table tab.

51
GISEEM Technical Manual

In the Table view it is possible to view and edit the data contained in the various layers. This is very
useful for editing the GIS data.

This example is from the Clans layer of the Karima data.

Adding a satellite basemap to uDig


There is often a need to have a raster basemap so that we can visualize where our vector data is.

A satellite basemap is the best solution here. Google Maps cannot be used in uDig due to license
reasons. Therefore we have to use a Landsat satellite image, which does not have as high resolution
as Google Maps, but is still useful in some cases.

You can download a satellite image from Landsat in the following address:
http://www.landsat.org/ortho/index.php

Downloading a Landsat map:


1. Enter http://www.landsat.org/ortho/index.php in your web browser's address bar.

2. Click on Landsat EMT+ Data (2000'S) link.

3. Click on 168 and then 060.

4. Click on elp168r060_7t20000221.tar.gz and download it. This will take some time.
5. Unzip the archive when the download is complete.

52
GISEEM Technical Manual

Adding a Landsat map to uDig:


1. Click on Layer > Add.

2. Select Files and click Next.

3. Browse to a suitable satellite map on your hard drive, select it and click open.

4. You will now see the satellite map in the uDig screen.

53
GISEEM Technical Manual

Adding a layer to uDig


Now we need to add layers from our database to our uDig project. These layers are stored in the
Postgis database and served for uDig by the GeoServer. To do this you need to know the IP address
of your GeoServer (localhost if you are on the computer where you installed the GeoServer) and
have a good internet connection.

Add layers to project:


1. We will use Karima layers as a demonstration in this project. Go to Layer at the top bar and
click on Add.

54
GISEEM Technical Manual

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 (use the address of the GeoServer instead of
localhost if you are on a different computer) to the URL field and then click on Next.

55
GISEEM Technical Manual

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.

56
GISEEM Technical Manual

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

57
GISEEM Technical Manual

Viewing layers in uDig


You can select which layers are visible in uDig.

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.

58
GISEEM Technical Manual

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.

59
GISEEM Technical Manual

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.

60
GISEEM Technical Manual

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.

61
GISEEM Technical Manual

6. uDig sometimes doesn’t 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.

62
GISEEM Technical Manual

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.

63
GISEEM Technical Manual

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.

64
GISEEM Technical Manual

Editing GIS data with uDig


Udig allows us to add points, polygons and lines to the various layers in the Postgis database. We
can also make changes to the tables of the layers. In this section it is shown how we can edit the
GIS data in uDig.

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.

65
GISEEM Technical Manual

4. Now you can see information about the factory in the bottom of the page. There isn’t 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.

66
GISEEM Technical Manual

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!

Adding 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.

67
GISEEM Technical Manual

Creating 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.

68
GISEEM Technical Manual

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.

Drawing 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.

69
GISEEM Technical Manual

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.

70
GISEEM Technical Manual

4. Maybe we don’t 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.

71
GISEEM Technical Manual

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.

72
GISEEM Technical Manual

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

Create a 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.

73
GISEEM Technical Manual

Moving 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 school’s 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 Schools’s row. Write a
little story.

5. Click Commit Changes again.

74
GISEEM Technical Manual

75