.. _wfst_feature_editor_tinyows: 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 POLYGON -lco DIM=2 Configure TinyOWS ----------------- TinyOWS is configured using a small XML file. The file we used for this example is:: Mapbook Setup ------------- The Mapbook currently features a fragment which supports the above configuration of GeoServer. That ```` entry can be removed and replaced with this fragment:: /mapserver/cgi-bin/tinyows http://localhost/geomoose/census_places census_places wkb_geometry ${namelsad} Area of Land: ${aland}
Area of Water: ${awater}

Census Info Page ]]>
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; ALTER TABLE gis=# alter table spatial_ref_sys owner to gis; ALTER TABLE gis=# alter table geography_columns owner to gis; ALTER TABLE mkdir /tmp/tinyows cd /tmp/tinyows wget ftp://anonymous@ftp2.census.gov/geo/tiger/TIGER2010/PLACE/2010/tl_2010_27_place10.zip unzip tl_2010_27_place10.zip 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