The Home of GeoMOOSE!
Home | Wiki | Live Demo | Getting Started | Documentation | Developers | Bug Tracker | Download

Table Of Contents

Previous topic

Using GeoServer with GeoMOOSE

Next topic

Standard Services

This Page

Using TinyOWS with GeoMOOSE

This is a basic walk-through on how to use GeoMOOSE with TinyOWS and PostGIS.

More Information on TinyOWS

From the TinyOWS Main Page,

TinyOWS is a lightweight and fast implementation of the OGC WFS-T specification. Web Feature Service (WFS) allows to query and to retrieve features. The transactional profile (WFS-T) allows then to insert, update or delete such features.

From a technical point of view WFS-T is a Web Service API in front of a spatial database. TinyOWS is so deeply tighed to PostgreSQL/PostGIS.

More here!

Windows Users can find TinyOWS for MS4W here.

Assumptions of this How To

  1. This document assumes you have been able to install GeoMOOSE, PostgreSQL, and TinyOWS.
  2. For purposes of this example, we’ll be using the database gis, username gis and the password super_gis.
  3. For our example here, the url for TinyOWS is: http://localhost/mapserver/cgi-bin/tinyows

Download the Places Layer from the Census Bureau

Download the file here. This is the “place” file for the state of Minnesota. “Places” are a Census terminology for incorporated cities, townships, and equivalents.

Install the Places Shapefile into PostGIS

There are a few good methods for doing this, ogr2ogr and shp2pgsql. Whichever method is used, the layer should be named census_places for the purposes of this exmaple.

A typical ogr2ogr string will look similar to this:

ogr2ogr -f PostgreSQL 'PG:dbname=gis user=gis password=super_gis' tl_2010_27_place10.shp tl_2010_27_place10 -nln census_places -nlt GEOMETRY -lco DIM=2

Configure TinyOWS

TinyOWS is configured using a small XML file.

The file we used for this example is:

<tinyows online_resource="http://localhost/mapserver/cgi-bin/tinyows"

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

         <pg host="localhost" user="gis" password="super_gis" dbname="gis" port="5432" />

         <layer retrievable="1"
                title="Census Places" />

Mapbook Setup

The Mapbook currently features a fragment which supports the above configuration of GeoServer.

That <map-source> entry can be removed and replaced with this fragment:

<map-source name="census_cities" type="wfs">
        <style type="stylemap"><![CDATA[
                "strokeColor" : "#00ff00",
                "label" : "${namelsad10}"


        <attribute name="geoid10" type="user" label="ID:" default-value="27999"/>
        <attribute name="namelsad10" type="user" label="Name:"/>


        <div style="font-size: 1.5em">${namelsad}</div>
        Area of Land: ${aland}<br>
        Area of Water: ${awater}<br>
        <a href="${statefp}:${geoid}" target="_blank">Census Info Page</a>

Example Installation

This is the exact input Duck used to get the demo working on his Macbook. Where necessary comments have been included to describe actions not done directly in the terminal.

# create the demo database
createdb gis -T postgis_template -O gis

psql "dbname=gis"
gis=# alter table geometry_columns owner to gis;
gis=# alter table spatial_ref_sys owner to gis;
gis=# alter table geography_columns owner to gis;

mkdir /tmp/tinyows
cd /tmp/tinyows



ogr2ogr -f PostgreSQL 'PG:dbname=gis user=gis password=super_gis' tl_2010_27_place10.shp tl_2010_27_place10 -nln census_places -nlt GEOMETRY -lco DIM=2

vim /srv/mapserver/cgi-bin/tinyows.xml
# then copy-and-paste tutorial contents.

# I then edited my local geomoose mapbook and added the Mapbook fragment
#  from above