Professional Documents
Culture Documents
PostgreSQL + PostGIS -
Quantum GIS
2011
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Contents
Page | - 2 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
PostgreSQL Installation
Run the PostgreSQL software….. Please wait until the following window
Page | - 3 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Here it is asking a password to the account “postgres”. We will give the same as the password
(postgres)
Page | - 4 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 5 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
PostGIS Installation
Here we have to choose the correct PostGIS package according to our PostgreSQL version
For an example if we choose the PostgreSQL version as 9.0 (postgresql-9.0) then we have to
download the corresponding version of PostGIS (postgis-pg90-setup-1.5)
For the moment remove the tick mark of “Create spatial database”.
Page | - 6 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Here in the password field we need add the password we gave on the PostgreSQL installation
(postgres).
Page | - 7 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Press on the yes button for this dialog box appears during the installation….
Page | - 8 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 9 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 10 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 11 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Java Installation
Go next..
Page | - 12 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Next Agree
Page | - 13 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Keep as it is…
Page | - 14 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
This username and password will need to us when we logon to the GeoServer.
Page | - 15 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 16 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Quantum GIS
Q-GIS main window….
Page | - 17 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 18 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
PostgreSQL DBMS
Page | - 19 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Then it will ask the password for the user account named as postgres… Enter that password we gave
on the page 5 (postgres). Then mark the tick.
Page | - 20 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
OK
Then expand the tree of the left window (object browser) again…
Page | - 21 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Properties tab…
Owner: postgres
Columns tab…
Page | - 22 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 23 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Owner: postgres
Template: template_postgis
Select out spatial database Main menu Plugins PostGIS Shapefile and DBF loader
Page | - 24 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Page | - 25 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Map Projection
We cannot calculate geometry directly from a GCS (geographic coordinate system: ellipsoid). There
for we have to transform it to a flat surface (UTM or National grids).
That can be done by transformation queries… (For more help: search for postgis cheat sheet)
Example:
Geo Server
Please prefer the note has been given to you for the basics…
Page | - 26 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Then publish the map(s) using different tabs or windows of your internet browser…
Page | - 27 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Additional Stuff…
The order of the layers must be: Top – polygon, Middle – Line, Bottom – Point. Then open this layer
group using OpenLayers.
Page | - 28 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
Host: localhost
Page | - 29 -
Chanaka Alahakoon – Dinidu Jayalath
WEB GIS – Geo Server - PostgreSQL + PostGIS - Quantum GIS
As the WMS we can use our own WMS or a WMS created at another computer.
“http://localhost:8080/geoserver/wms?”
Ok
2. Connect
3. Then we can see a list of layers will popup at the middle…
4. Select your layers one by one and add to the map. (select one and add, then clear that selection
by clicking on that layer in the list and then select another and add)
Page | - 30 -
Chanaka Alahakoon – Dinidu Jayalath