Skip to content

Commit

Permalink
Update config file to new grammar. Add a demo project
Browse files Browse the repository at this point in the history
git-svn-id: file:///tmp/tinyows-svn-mirror@61 5b3c568a-86f9-4a59-a47a-7be284f604b4
  • Loading branch information
Olivier Courtin committed Feb 17, 2009
1 parent 89b6682 commit cb2b02c
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 52 deletions.
4 changes: 4 additions & 0 deletions Makefile.in
Expand Up @@ -33,6 +33,10 @@ install:
cp -rf schema $(PREFIX)/tinyows/
cp -i config.xml $(PREFIX)/tinyows/

install-demo:
chmod +x demo/install.sh
su postgres -c "demo/install.sh"

doc-clean:
@rm -rf doc/doxygen

Expand Down
32 changes: 14 additions & 18 deletions configure.in
Expand Up @@ -31,8 +31,8 @@ AC_MSG_RESULT([checking for libxml2 version... $XML2_VER])
XML2_INC=`$LIBXML2_CONFIG --cflags`
XML2_LIB=`$LIBXML2_CONFIG --libs`

AC_SUBST(XML2_INC, $XML2_INC)
AC_SUBST(XML2_LIB, $XML2_LIB)
AC_SUBST(XML2_INC)
AC_SUBST(XML2_LIB)

dnl ---------------------------------------------------------------------------
dnl Try to find PostgreSQL if PostGIS support requested.
Expand All @@ -49,26 +49,22 @@ else
PG_CONFIG=$with_postgis
fi

if test "$PG_CONFIG" = "no" ; then
POSTGIS_ENABLED=
POSTGIS_INC=
POSTGIS_LIB=
else
if ! test -f "$PG_CONFIG" -a -x "$PG_CONFIG" ; then
AC_MSG_ERROR(['$PG_CONFIG' is not an executable. Make sure you use --with-postgis=/path/to/pg_config])
fi

POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq"
POSTGIS_INC="-I`$PG_CONFIG --includedir`"
if ! test -f "$PG_CONFIG" -a -x "$PG_CONFIG" ; then
AC_MSG_ERROR(['$PG_CONFIG' is not an executable. Make sure you use --with-postgis=/path/to/pg_config])
fi

AC_SUBST(POSTGIS_ENABLED,$POSTGIS_ENABLED)
AC_SUBST(POSTGIS_INC,$POSTGIS_INC)
AC_SUBST(POSTGIS_LIB,$POSTGIS_LIB)
POSTGIS_LIB="-L`$PG_CONFIG --libdir` -lpq"
POSTGIS_INC="-I`$PG_CONFIG --includedir`"
POSTGIS_SHARE=`$PG_CONFIG --sharedir`
POSTGIS_BIN=`$PG_CONFIG --bindir`

AC_CHECK_FUNCS()
AC_SUBST(POSTGIS_INC)
AC_SUBST(POSTGIS_LIB)
AC_SUBST(POSTGIS_SHARE)
AC_SUBST(POSTGIS_BIN)

AC_OUTPUT(Makefile src/ows_define.h)
AC_CHECK_FUNCS()
AC_OUTPUT(Makefile src/ows_define.h demo/config.xml demo/install.sh)

rm -rf autom4te.cache
rm -f config.log config.status
16 changes: 16 additions & 0 deletions demo/ABOUT
@@ -0,0 +1,16 @@
=======
1) Documentation HowTo Launch Demonstration
=======
Cf <http://tinyows.org/trac/tinyows/wiki/LaunchDemo>

=======
2) Datas
=======
World Administrative Boundaries
http://www.cipotato.org/diva/data/misc/world_adm0.zip
EPSG:4326
-------
France Sub Administrative boundaries
http://professionnels.ign.fr/DISPLAY/000/526/741/5267418/GEOFLA-dep-L2-SF.ZIP
EPSG:27582
-------
22 changes: 22 additions & 0 deletions demo/config.xml.in
@@ -0,0 +1,22 @@
<tinyows online_resource="http://127.0.0.1/cgi-bin/tinyows"
schema_dir="@prefix@/tinyows/schema/"/>

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

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

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

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

</tinyows>
Binary file added demo/france_dept.dbf
Binary file not shown.
Binary file added demo/france_dept.shp
Binary file not shown.
Binary file added demo/france_dept.shx
Binary file not shown.
20 changes: 20 additions & 0 deletions demo/install.sh.in
@@ -0,0 +1,20 @@
#/bin/sh

PG_BIN=@POSTGIS_BIN@
PG_SHARE=@POSTGIS_SHARE@
DB=tinyows_demo

echo "Create Spatial Database: $DB"
$PG_BIN/dropdb $DB > /dev/null 2> /dev/null
$PG_BIN/createdb $DB
$PG_BIN/createlang plpgsql $DB
$PG_BIN/psql $DB < $PG_SHARE/lwpostgis.sql
$PG_BIN/psql $DB < $PG_SHARE/spatial_ref_sys.sql

echo "Import layer data: world"
$PG_BIN/shp2pgsql -s 4326 -I demo/world.shp world | $PG_BIN/psql $DB

echo "Import layer data: france_dept"
$PG_BIN/shp2pgsql -s 27582 -I -W latin1 demo/france_dept.shp france_dept | $PG_BIN/psql $DB

echo "Demo Install - Done"
Binary file added demo/world.dbf
Binary file not shown.
Binary file added demo/world.shp
Binary file not shown.
Binary file added demo/world.shx
Binary file not shown.
3 changes: 2 additions & 1 deletion test/README
Expand Up @@ -13,7 +13,8 @@ To be able to launch unit test
psql -d tinyows_test < ogc_wfs_data.sql

3) Replace tinyows config file by 'owg_test_config.xml' one
(Check postgresql connection parameter)
(Check PostgreSQL connection parameter, online_resource
and schema_dir values)

4) Install valgrind if not yet done

Expand Down
48 changes: 15 additions & 33 deletions test/ogc_test_config.xml
@@ -1,46 +1,28 @@
<!-- TinyOWS WFS OGC TEST configuration -->
<tinyows>

<metadata
name="TinyOWS"
title="TinyOWS Service"
keywords="tinyows,ows,wfs,ogc"
online_resource="http://www.tinyows.org/"
fees="free"
access_constraint="nope" >
<abstract>
Here a text abstract related to the service...
</abstract>
<contact
name="Camptocamp"
site="http://camptocamp.com"
individual_name="Olivier Courtin"
position="GIS Architect"
phone="+33 (0)4.79.44.44.92"
address="Savoie Technolac, le Square, bat.Suroit"
postcode="73370"
city="Le Bourget du Lac"
country="France"
email="olivier.courtin@camptocamp.com" />
</metadata>
<!-- BEGIN configuration -->
<tinyows
online_resource="http://127.0.0.1/cgi-bin/tinyows"
schema_dir="/usr/local/tinyows/schema/">

<!-- limits of the service -->
<limits
layers="12"
features="5000"
width="800"
height="600"
/>

<!-- information about database connection -->
<pg
host="127.0.0.1"
user="postgres"
password="postgres"
dbname="tinyows_test"
port="5432" />
<!-- END configuration -->

<!-- Don't need to change anything below this point -->
<metadata
name="TinyOWS-OGC-CITE"
title="TinyOWS - OGC CITE Test">
<contact
name="TinyOWS Team"
site="http://www.tinyows.org"
email="tinyows-dev@lists.maptools.org" />
</metadata>

<!-- layers' definition -->
<layer name="root" title="root" srid="4326"
queryable="1" retrievable ="1" writable ="1">

Expand Down

0 comments on commit cb2b02c

Please sign in to comment.