Configuration File

Configuration is done via a single XML file called 'config.xml'.

The default path is /usr/local/tinyows/config.xml, you could also use TINYOWS_CONFIG_FILE environment var to set your own path.

Configuration file simple Example

You could find an example of 'config.xml' file in demo directory:

<tinyows online_resource="http://127.0.0.1/cgi-bin/tinyows"
         schema_dir="/usr/local/tinyows/schema/">

  <pg host="127.0.0.1" user="postgres" password="postgres" dbname="tinyows_demo" port="5432"/>

  <metadata name="TinyOWS Server"
            title="TinyOWS Server - Demo Service" />

  <contact name="TinyOWS Server"
           site="http://www.tinyows.org/"
           email="tinyows-users@lists.maptools.org" />

  <layer retrievable="1"
         writable="1"
         prefix="tows"
         server="http://www.tinyows.org/"
         name="world"
         title="World Administrative Boundaries" />

  <layer retrievable="1"
         writable="1"
         prefix="tows"
         server="http://www.tinyows.org/"
         name="france"
         title="French Administrative Sub Boundaries (IGN - GeoFLA Departements)" />

</tinyows>


Check Config.xml file

Once you have a config.xml file related to your service, you could launch the --check option:

./tinyows --check
Config File:	 OK
PG Connection:	 OK
Available layers:
 - public.world  -> 4326 RW
 - public.france  -> 27582 RW


TinyOWS Element

TinyOWS is the root element. He is mandatory, and must contains some system informations about the service itself. Some globals service options could also be switched on or off at this level.

TinyOWS attributes

AttributeMandatoryDescription
online_resourceMandatoryURL where the service is located, e.g: http://127.0.0.1/cgi-bin/tinyows
schema_dirMandatoryPath where TinyOWS schema dir is located e.g: /usr/local/tinyows/schema/
logOptionalPath where TinyOWS could log input requests. e.g: /var/log/tinyows.log (This file must have correct write permissions).
degree_precisionOptionalIndicate how many digits use to decimal precision when datas are lat/lon. Default is 6.
meter_precisionOptionalIndicate how many digits use to decimal precision when datas are meters based. Default is 0.
wfs_display_bboxOptionalFlag to indicate if bbox should be computed for WFS GML GetFeature output. It's mandatory in WFS specification. But as it's time consuming it could be interresting to be able to deactivate it. Default is 1.
check_schemaOptionalFlag to indicate if input data must be checked against schema before to be executed. Caution, schema validation is an important part on security stage. Default is 1.
check_valid_geomOptionalFlag to indicate if geometry OGC SFS 1.1 validation should be done prior to execute a transaction. Default is 1.


Limits Element

Limits Element is dedicated to put limitation on the whole server output. It could help to prevent DoS or stupid huge query from userland. This element is optional.

Limits attributes

AttributeMandatoryDescription
featuresOptionalUse to set maximum number of features returned to WFS client, on GetFeature request
geobboxOptionalWGS 84 Geographic Bbox, used to indicate maximum extent: East,West,North,South

Example

<tinyows>
  ...
  <limits features="10000" />
  ...
</tinyows>

PostgreSQL Connection

PostgreSQL connection element. This element is mandatory.

AttributeMandatoryDescription
hostoptionalName (or IP) to PostgreSQL server (default is localhost)
useroptionalPostgreSQL user to connect (default is the system user used to run the server)
passwordoptionalPostgreSQL password connection
dbnameoptionalPostGIS database (by default, same as the system user used to run the server
portoptionalPostgreSQL port number (by default 5432)

Example

<tinyows>
  ...
  <pg host="127.0.0.1"
         user="postgres"
         password="postgres"
         dbname="gis_data"
         port="5432" />
   ...
</tinyows>

Metadata and Contact Elements

Use to fill some Medatada's information about the service itself. Theses two elements are mandatory.

Metadata attributes

AttributeMandatoryDescription
name Mandatory Web Service Name
title Mandatory Web Service Title
keywords Optional Web Service Keywords list (use comma as separator)
fees Optional Web Service Fees
access_constraints Optional Web Service Access Constraints

Abstract Element

Abstract Element is an optional child element of Metadata. It's dedicaded to give some abstract metadata informations about the service itself.

Contact attributes

AttributeMandatoryDescription
name Mandatory Web Service Contact Name
site Mandatory Web Service Contact URL
email Mandatory Web Service Contact Email
individual_name Optional Web Service Contact Individual Name
position Optional Web Service Contact Position
phone Optional Web Service Contact Phone
fax Optional Web Service Contact Fax
online_resource Optional Web Service Contact URL (e.g additional Metadatas)
address Optional Web Service Contact Postal Address
postcode Optional Web Service Contact Postcode
city Optional Web Service Contact City
administrative_area Optional Web Service Contact Administrative Area
country Optional Web Service Contact Country
hours_of_service Optional Web Service Contact Hours of Services
contact_instructions Optional Web Service Contact Instructions

Contact and Metadata example with only mandatory attributes:

  <metadata name="TinyOWS Server"
            title="TinyOWS Server - Demo Service" />

  <contact name="TinyOWS Server"
           site="http://www.tinyows.org/"
           email="tinyows-users@lists.maptools.org" />


Layer Element

Layer element is used to set all layers provided by the service. Even if layer is not mandatory, if omitted, no layer at all will be provided.

Layer attributes

AttributeMandatoryDefault Inherited values Description
prefixMandatory - Yes Layer's Namespace Prefix used in WFS
serverMandatoty - Yes Layer's Namespace URI used in WFS
nameMandatory - No Layer's Name
titleMandatory - No Layer's Title
retrievableOptionalfalse Yes If true layer is retrievable on WFS GetFeature request
writableOptionalfalse Yes If true layer is editable with WFS Transaction request
schemaOptional'public' No PostgreSQL Schema name.
abstractOptional - No Abstract text
keywordsOptional - No Keywords (comma separated list)
sridOptional - Yes Comma separated list of output SRID
geobboxOptional - Yes WGS 84 bbox of max extent: East,West,North,South

Example

<tinyows>
  ...
      <layer retrievable="1"
         writable="1"
         prefix="tows"
         server="http://www.tinyows.org/"
         name="world"
         title="World Administrative Boundaries" />
  ...
</tinyows>

Nested Layers

Layer entities could be nested, properties in this case are inherited.

Nested Layers Example

<tinyows>
  ...
      <layer retrievable="1"
         writable="1"
         prefix="tows"
         server="http://www.tinyows.org/"
         name="root"  >

           <layer name="foo" title="foo"/>
           <layer name="bar" title="bar"/>
  
      </layer>
     
  ...
</tinyows>