Setting up a SOS
From Intamap
These instructions show how to setup the Java SOS implemented by 52north.
Contents |
Requirements
Regardless of which operating system you prefer, we assume that you have installed the following programs:
- PostgreSQL 8.2 (or later)
- PostGIS 1.3.6 for PostgreSQL 8.2 (or later)
- Apache Ant 1.7.1
- Apache Tomcat 5.5
Different versions might be used as well but have not been tested here.
Get the SOS Java sources
You can either download the latest version (52N-SOS-3.0.1) as a zip file or directly check out from svn. We preferred the zip download. All further steps require that you have installed the required programs and have extracted/checked out the SOS Java sources to a folder named C:/SOS. We will refer to this directory as SOS some directory.
Fill a test database
The SOS database requires a particular structure. The easiest solution is to run the sql script coming with the SOS implementation.
- Open pgAdmin (usually part of the PostgreSQL installation).
- Connect to your database server and create a new database from the postgis template if you haven“t already done so. We name it SosDatabase.
- Go to the db folder in your SOS home directory, open datamodel_postgres82.sql and execute the script.
- To insert test data, apply the same procedure to test.sql (same folder).
Compile the SOS
Copy the database drivers
If you have downloaded the SOS sources as zip file it is necessary to copy the database drivers:
- Go to the home directory of your PostgresSQL installation and open the jdbc folder.
- Select postgresql-8.2-504.jdbc3.jar and postgis_1.3.6.jar and copy them to the lib folder of SOS home.
Configuration
1. Open the build.properties file in the conf directory of SOS home and change the following parameters.
- TOMCAT_HOME => Absolute path to your Tomcat home directory.
- JAVA_HOME => Absolute path to your Java Development Kit.
- deploy.target.username => The administrator username for your Tomcat.
- deploy.target.password => The administrator password of your Tomcat.
2. Copy the samples_config.properties file and rename it to config.properties. Change the following parameters.
- conf.sos.ds.connectionstring => The connection string to your database. (e.g.jdbc:postgresql://localhost:5432/SosDatabase for our PostgreSQL example).
- conf.sos.ds.user => The user name for your access to the database server.
- conf.sos.ds.password => The password for your access to the database server.
- conf.sos.listeners => Comma separated list of the request listeners which are implemented (without white space!). => Delete the RegisterSensor- and the InsertObservation-listener to avoid that people have writing access to your database through the SOS interface.
Deploy the SOS web application
- Make sure that Tomcat and your database server are running.
- Go to the conf folder of SOS home.
- Execute the build.xml using the command line expression "ant". This starts the Apache Ant tool.
Test the SOS
- Start your web browser and try http://yourhost:8080/52nSOSv3/sos?REQUEST=GetCapabilities&SERVICE=SOS&ACCEPTVERSIONS=1.0.0
- The GetCapabilities document now appears in your browser.
- http://yourhost:8080/52nSOSv3/sos leads you to a simple html based test client.
- For different spatial and temporal queries please have a look at the examples in the xml folder of SOS home.
