You are on page 1of 23

WORKSHOP

On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
OpenGeo Suite-GeoServer
GeoServer Data Conept!
GeoServer is a piece of middleware, that provides various "ata !oure! (shape files, database tables,
imaes) to !etwor" users as internet !ervie! (#$S, #FS, etc)% &his co!versio! of file formats a!d
database drivers i!to simple services ma"es web applicatio! developme!t simpler ' web developers !o
lo!er have to care what formats or pro(ectio!s the source data are i!, because the service abstracts that
comple)ity away%
&he abstractio! is built o! some core co!cepts that all data sources a!d services i! GeoServer share*
Wor#!pae!$
+ wor"space !ame-space is (ust a ta, a loical folder, u!der which feature types are rouped%
&he wor"-space i! GeoServer affects how #$S,#FS layers are !amed, a!d the -$. of the
G$. features emitted by GeoServer%
Store!$
/ach source data, whether it be a directory full of shape files, or a database i!sta!ce, is
co!sidered a 0Stores1% File directories are co!fiured by providi! a path% 2atabases are
co!fiured by providi! co!!ectio! i!formatio!%
La%er!$
/ach i!dividual shape file, or spatial database table, is co!sidered a 0.ayer1%

La%er Group!$
$ultiple .ayers ca! be bou!d i!to roups, that ca! the! be refere!ced by a si!le !ame% 3seful
for creati! base maps or other cartoraphic outputs that are composed of multiple layers%
St%&e!$
+ style is applied to a .ayer to create a cartoraphic output% &he output miht be a! imae, or it
miht be a 4$. file, or it miht be some other format (li"e S5G) that provides a way of viewi!
data for e!d-users%
GeoServer We' A"(ini!tration
GeoServer i!cludes a web-based admi!istratio! i!terface for co!fiuratio!% $ost GeoServer
co!fiuratio! ca! be do!e throuh this i!terface, without the !eed to edit co!fiuratio! files by ha!d%
)ie*in+
&he GeoServer web admi!istratio! i!terface ca! be loaded from the 6pe!Geo Suite 2ashboard by
clic"i! o! the Con,i+ure li!" u!der!eath the GeoServer header% 7ou ca! also browse to the web
address where GeoServer is served% &he default locatio! of the GeoServer admi! i!terface is
http://localhost:8080/geoserver%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
1
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Fi%1 .oadi! GeoServer web admi!istratio! from the 2ashboard
Aut-entiation
$ost GeoServer co!fiuratio! tas"s re;uire a user!ame a!d password to lo i!% <y default, the
GeoServer crede!tials are admin a!d geoserver, althouh this ca! be cha!ed%
.o i! usi! your crede!tials%
Fig2. .oi! i! with default crede!tials
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
2
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
+fter loi! i!, more optio!s will be displayed.
Fi= GeoServer #elcome pae with admi!istrative optio!s
Wor#!pae!
+ *or#!pae is the !ame for a !otio!al co!tai!er to roup similar data toether% #e will first create a
wor"space for all of the data that we will be loadi! i!to GeoServer%
A"" or Re(ove a Wor#!pae
1% 9aviate to the mai! GeoServer #eb +dmi!istratio! pae%
2% 8lic" o! the Wor#!pae! li!" o! the left side, u!der Data%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
=
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
8lic" this li!" to o to the #or"spaces pae
8lic" o! the 0A"" ne* *or#!pae1 li!" at the top ce!ter of the pae%
&he #or"spaces pae
+ wor"space co!sists of a !ame a!d a 9amespace 3>? (3!iform >esource ?de!tifier)% &he wor"space !ame has
a ma)imum of te! characters a!d may !ot co!tai! space% + 3>? is similar to 3>.s, e)cept 3>?s !eed !ot poi!t
to a locatio! o! the web, a!d o!ly !eed to be a u!i;ue ide!tifier% For a #or"space 3>?, we recomme!d usi! a
3>. associated with your pro(ect, with perhaps a differe!t traili! ide!tifier, such as
http://www.osgeo.in/rjahmundry for the 0rjahmundry1 wor"space%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
@
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
?! order to remove a wor"space, clic" o! the wor"spaceAs correspo!di! chec" bo)% +s with the layer deletio!
process, multiple wor"spaces ca! be chec"ed for removal o! a si!le results pae% 8lic" the Re(ove !e&ete"
*or#!pae!.!/ butto!% 7ou will be as"ed to co!firm or ca!cel the deletio!% 8lic"i! OK will remove the
wor"space%
#or"space removal co!firmatio!
Store!
+ store co!!ects to a data source that co!tai!s raster or vector data% + data source ca! be a file or roup
of files such as a table i! a database, a si!le file (such as a shape file), or a directory (such as 5ector
Broduct Format library)% &he store co!struct is used so that co!!ectio! parameters are defi!ed o!ce,
rather tha! for each piece of data i! a source% +s such, it is !ecessary to reister a store before loadi!
a!y data%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
C
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Stores 5iew
A""in+ a !tore
1% From the GeoServer #eb +dmi!istratio! pae, clic" o! the Store! li!" o! the left side, u!der
2% Data%
=% 8lic" this li!" to o to the Stores pae
@% 8lic" o! A"" ne* !tore%
C% Select Po!tGIS u!der )etor Data Soure!
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
6
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
6% Fill out the followi! form usi! the followi! i!formatio! (leavi! all other i!formatio! u!cha!ed)*
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
D
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Filli! out the 9ew BostG?S store form (Bart 1)
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
E
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Filli! out the 9ew BostG?S store form (Bart 2)
D% #he! do!e, clic" Save%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
F
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
.oaded store with !o layers published
A""in+ a S-ape,i&e
1% From the GeoServer #eb +dmi!istratio! pae, clic" o! the Store! li!" o! the left side, u!der Data%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
10
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
2% 8lic" o! A"" ne* !tore%
=% select Shapefile* ESRI(tm) Shapefiles (.shp)%
@% Select the wor"space rajahmundry from the drop dow! me!u, e!ter churches i! the field !ame a!d
e!ter a brief descriptio!, such as churches in Rajahmundry.
C% 3!der the Connetion! Parameters specify the locatio! of the shapefile'file*data,shapefiles,churches%shp%
6% Bress Save% 7ou will be redirected to Ne* La%er -oo!er pae i! order to co!fiure churches layer%

Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
11
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Loa"in+ a "iretor% o, !-ape ,i&e!
1% From the GeoServer #eb +dmi!istratio! pae, clic" o! the Store! li!" o! the left side, u!der Data%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
12
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
2% 8lic" o! A"" ne* !tore%
=% Select Diretor% o, !patia& ,i&e!%
@% Fill out the followi! form% Select the rajahmundry Wor#!pae, create a Data Soure Na(e (ca! be
a!ythi!, but weAll call it rjy_data, a!d add a descriptio! if youAd li"e% ?! the bo) mar"ed URL, type i! the
full path to the directory of shapefiles*
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
1=
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
8o!fiuri! a directory of shapefiles store
C% #he! fi!ished, clic" Save%
Pu'&i!-in+ t-e &a%er!
La%er!
+ &a%er is a roupi! of eospatial data% 3sually a layer co!tai!s o!e type of data (poi!ts, li!es,
polyo!s, raster) a!d has a si!le ide!tifiable co!te!t (streets, houses, cou!try bou!daries, etc%)% + layer
is the smallest roupi! of eospatial data%
#e have already loaded a store, so we !ow !eed to publish the layers co!tai!ed i!side the store%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
1@
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
Bublishi! a layer i!volves providi! i!formatio! o! pro(ectio! (if !ecessary), bou!di! bo), default
style, a!d much more%
Pu'&i!-in+ a La%er
1% >etur! to the GeoServer #eb +dmi!istratio! pae%
2% 8lic" o! the La%er! li!" o! the left side, u!der Data%
=% 8lic" this li!" to o to the .ayers pae
@% 8lic" o! A"" ne* re!oure%
C% Select the resource called ra0a-(un"r%$ra0a-(un"r%1"ata from the drop dow! list% &his is the store
created i! the previous sectio!
%
6% Selecti! our store
D% Select the first layer, banks_and_atms clic" Pu'&i!-.
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
1C
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
E% 9ow we will e!ter i!formatio! re;uired to publish the layer% &here are two tabs to the layer setti!s
pae% &he Data tab co!tai!s setti!s for how GeoServer ha!dles the data, a!d the Pu'&i!-in+ tab
co!tai!s setti!s for how GeoServer prese!ts the data%
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
16
WORKSHOP
On
CAPACITY BUILDING ON WEBGIS
(22-26 February, 2011)
GeoServer La%er E"itor E2p&aine"
Salim +li 8e!tre For 6r!itholoy +!d 9atural :istory (S+869), :yderabad%
1D
Data Ta'
&he .ayer editor pae is very, very, very lo! a!d i!cludes some pretty obscure e!tries%
:ere is a ;uic" descriptio! of each e!try, starti! at the top*
Na(e
&his is the default !ame as read from the data source% For databases, it will be the
table !ame% For shape files, it will be the file!ame part prior to the 0%shp1 suffi)%
Tit&e
&his allows you to over-ride the default !ame to some huma!-readable other !ame%
&he &itle is used for public thi!s li"e the #$S layer !ames, #FS feature-type
!ames, a!d so o!, so havi! a !o!-co!fusi! &itle is importa!t%
A'!trat3 Ke%*or"!
&his is i!formatio! that will appear i! the #$S capabilities file, et crawled by
cataloui! spiders a!d so o!% &he more useful i!formatio! you ca! put i! about
your layer, the better%
4eta"ata Lin#!
#$S capabilities files ca! co!tai! li!"s to e)ter!al metadata, li"e cataloue
e!tries% &his is a reat place to li!" your layer to more metadata%
Coor"inate Re,erene S%!te(!
&he 09ative S>S1 is the spatial refere!ce your raw data (i! the database or files) is
stored i!% &he 02eclared S>S1 is how the outside world will see it, as published via
#FS% <ecause GeoServer supports o!-the-fly re-pro(ectio!, you ca! publish your
data i! a!y S>S you li"e, as lo! as you declare your !ative S>S%
Boun"in+ Bo2e!
&he 09ative <ou!di! <o)1 is the bo) calculated directly off the raw data, a!d will
be i! the !ative S>S coordi!ates% &he 0.at,.o! <ou!di! <o)1 will be co!verted
from the !ative bo)% 7ou ca! ma!ually over-ride either value, or simply auto-
calculate them with the 08ompute1 li!"s% 9ote that auto-calculate o! very lare
tables will ta"e some time%
Pu'&i!-in+ Ta'
Na(e
&he !ame will be read from the data, by default%
Ena'&e"
?f you u!-chec" 0/!abled1 the layer will not be visible i! #$S or #FS services%
HTTP-Settin+!
?f you tur! o! 0>espo!se 8ache :eaders1, you ca! e!sure that cache-co!trol
i!formatio! is se!t to clie!ts, to advise them how lo! to cache i!formatio!
e!erated by GeoServer% For data which is!At cha!i! much, setti! a lo! cache
time ca! be a ood idea%
W5S Settin+!
&o "eep the server from bei! overloaded with lare data re;uests, you miht wa!t
to set a ma)imum 0Ber >e;uest Feature .imit1% &o "eep your G$. output file siGe
dow!, you ca! rou!d off the coordi!ates usi! 0$a)imum !umber of decimals1%
>ou!d to remove u!!ecessary precisio!, but be careful !ot to derade accuracy%
De,au&t St%&e
&he style that will be applied if !o style is specified%
A""itiona& St%&e!
?t is possible to ma"e layers available with multiple colori!s, so that you ca! have
a 0yellow roads1 a 0rey roads1 a!d a 0blue roads1 style, if you so desire% 8lie!ts
ca! the! switch betwee! styles simply by specifyi! o!e of the styles i! their map
re;uest 3>.%
De,au&t W4S Pat-
&he GeoServer #$S path is, by default, /geoserver/wms% :owever you ca!
cha!e it to /geoserver/anythingyouwant
W4S Attri'ution
/ach .ayer i! a #$S service ca! have u!i;ue attributio!, which clie!t software
ca! opt to display% +ttributio! miht be a! ora!iGatio! !ame, a li!" to a lice!se
pae, a!d a loo imae to overlay%
K4L3 De,au&t Re+ionatin+ Attri'ute
GeoServer allows 0reio!ated 4$.1 to be published% >eio!atio! allows users to
browser very lare 4$. data sets% +t the top Goom levels, o!ly a few of the 0most
importa!t1 features are displayed% +t the bottom o!es, all are displayed% &he
reio!ati! attribute is used to fiure out the 0importa!ce1% &he attribute must be
!umeric a!d hiher !umbers must i!dicate more 0importa!ce1%
K4L3 De,au&t Re+ionatin+ 4et-o"
?! the abse!ce of a usable reio!ati! attribute, a! automatic stratey will be
attempted*
bestHuess* #he! this stratey is selected, the stratey is actually
determi!ed by the type of data bei! operated o!% ?f the data co!sists of
poi!ts, the ra!dom stratey is used% ?f the data co!sists of li!es or polyo!s,
the eometry stratey is used%
e)ter!al-sorti!* &his stratey creates a temporary au)iliary database withi!
GeoServer% ?t ta"es slihtly e)tra time to build the i!de) upo! first re;uest%
eometry* &his stratey e)ter!ally sorts by le!th (if li!es) or area (if
polyo!s)%
!ative-sorti!* &his stratey uses the default sorti! alorithm of the
bac"e!d where the data is hosted% ?t is faster tha! e)ter!al-sorti!, but will
o!ly wor" with BostG?S datastores%
ra!dom* &his stratey uses the e)isti! order of the data a!d does !ot sort%
K4L3 5eature! per Re+ionate" Ti&e
&he ma)imum !umber of features to deliver to the clie!t as vectors% ?f hiher tha!
this, use a! imae-based 4$. stratey%
F% #he! you are fi!ished co!fiuri! your layer clic" Save at the bottom of the pae%
Previ*e t-e &a%er
&he layer is !ow published a!d is !ow bei! served by GeoServer% &o preview this
layer, !aviate to the La%er Previe* pae% 8lic" o! La%er Previe* li!"
+fter clic"i!, it will displays list of layers%
Select the 6pe!.ayers preview for r0a-(un"r%$-ur-e!%
#ell do!eII 7ou have successfully completed 6pe!Geo-Suite (GeoServer) lesso!s%