From 994f6a9633b94d7e8fee8af9e3bfa22c40c482f9 Mon Sep 17 00:00:00 2001 From: vmora Date: Mon, 2 Mar 2015 10:38:22 +0100 Subject: [PATCH 01/61] fixed bad conversion of custom types postgres to_json is used to get attributes as a result, quoting " charaters is not necessary (removed from buffer_encode_json_str) since it's done by to_json same remark for the "" enclosing the result in wfs_geojson_display_results --- src/struct/buffer.c | 9 +-------- src/wfs/wfs_get_feature.c | 7 +++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/struct/buffer.c b/src/struct/buffer.c index 24368345..b94063b4 100644 --- a/src/struct/buffer.c +++ b/src/struct/buffer.c @@ -550,14 +550,7 @@ buffer *buffer_encode_json_str(const char * str) buf = buffer_init(); for( /* empty */ ; *str ; str++) { - switch(*str) { - case '"': - buffer_add_str(buf, "\\\""); - break; - - default: - buffer_add(buf, *str); - } + buffer_add(buf, *str); } return buf; diff --git a/src/wfs/wfs_get_feature.c b/src/wfs/wfs_get_feature.c index 3ea0afb9..fbb2e550 100644 --- a/src/wfs/wfs_get_feature.c +++ b/src/wfs/wfs_get_feature.c @@ -543,9 +543,13 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer } /* Columns are written in quotation marks */ else { + if (wr->format == WFS_GEOJSON) + buffer_add_str(select, "to_json("); buffer_add_str(select, "\""); buffer_copy(select, an->key); buffer_add_str(select, "\""); + if (wr->format == WFS_GEOJSON) + buffer_add_str(select, ")"); } if (an->next) buffer_add_str(select, ","); @@ -838,11 +842,10 @@ static void wfs_geojson_display_results(ows * o, wfs_request * wr, mlist * reque else buffer_add_str(prop, ", \""); buffer_copy(prop, an->key); - buffer_add_str(prop, "\": \""); + buffer_add_str(prop, "\": "); value_enc = buffer_encode_json_str(PQgetvalue(res, i, j)); buffer_copy(prop, value_enc); buffer_free(value_enc); - buffer_add(prop, '"'); } } From 5af0e48bd0e8be5c685c4b7f23b0ddc88bb2d245 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:53:30 +0100 Subject: [PATCH 02/61] Demo / testsuite install script: make them work with recent PostGIS / PostgreSQL --- demo/install.sh.in | 20 +++++++++++++++++--- test/wfs_100/install_wfs_100.sh.in | 28 ++++++++++++++++++++++++++-- test/wfs_110/install_wfs_110.sh.in | 28 ++++++++++++++++++++++++++-- 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/demo/install.sh.in b/demo/install.sh.in index d27ffa0f..e1928f85 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -3,13 +3,25 @@ # don't launch directly this script # use 'make install-demo' to do so +set -e + PGBIN=@POSTGIS_BIN@ PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then +if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 @@ -20,9 +32,11 @@ else fi echo "Create Spatial Database: $DB" -su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null" +su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null || /bin/true" su $PGUSER -c "$PGBIN/createdb $DB" -su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +if test -f "$PGBIN/createlang"; then + su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +fi su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/postgis.sql" su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/spatial_ref_sys.sql" diff --git a/test/wfs_100/install_wfs_100.sh.in b/test/wfs_100/install_wfs_100.sh.in index 76728f6e..840b7423 100755 --- a/test/wfs_100/install_wfs_100.sh.in +++ b/test/wfs_100/install_wfs_100.sh.in @@ -3,15 +3,39 @@ # don't launch directly this script # use 'make install-test100' to do so +set -e + PGBIN=@POSTGIS_BIN@ PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 PGUSER=postgres DB=tinyows_test +if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-1.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 +else + echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 +fi + echo "Create Spatial Database: $DB" -su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null" +su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null || /bin/true" su $PGUSER -c "$PGBIN/createdb $DB" -su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +if test -f "$PGBIN/createlang"; then + su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +fi su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/postgis.sql" su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/spatial_ref_sys.sql" su $PGUSER -c "$PGBIN/psql $DB < test/wfs_100/ogc_wfs_sf0.sql" diff --git a/test/wfs_110/install_wfs_110.sh.in b/test/wfs_110/install_wfs_110.sh.in index ba9f4b40..aaddd413 100755 --- a/test/wfs_110/install_wfs_110.sh.in +++ b/test/wfs_110/install_wfs_110.sh.in @@ -3,15 +3,39 @@ # don't launch directly this script # use 'make install-test110' to do so +set -e + PGBIN=@POSTGIS_BIN@ PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 PGUSER=postgres DB=tinyows_test +if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-1.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 +else + echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 +fi + echo "Create Spatial Database: $DB" -su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null" +su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null || /bin/true" su $PGUSER -c "$PGBIN/createdb $DB" -su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +if test -f "$PGBIN/createlang"; then + su $PGUSER -c "$PGBIN/createlang plpgsql $DB" +fi su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/postgis.sql" su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/spatial_ref_sys.sql" su $PGUSER -c "$PGBIN/psql $DB < test/wfs_110/ogc_wfs_sf0.sql" From c726adbd36477c47b06e1a60eb1126144c5cd54e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:54:04 +0100 Subject: [PATCH 03/61] test/unit_test: make it work with XML POST requests --- test/unit_test | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/unit_test b/test/unit_test index 82260569..15fd0e5b 100755 --- a/test/unit_test +++ b/test/unit_test @@ -48,7 +48,12 @@ sed "/LIST$/d" $list_tmp > $sed_tmp && mv $sed_tmp $list_tmp for unit_id in `cat $list_tmp`; do option=`cat $unit_id` -export QUERY_STRING=$option +export QUERY_STRING="$option" + +echo "---" +echo "Run: $unit_id" +echo "Query: $QUERY_STRING" + # Valgrind resume mode if [ $mode -eq 1 ]; then From 87c844afc746baaa12029327be23167ade55a7cf Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:55:08 +0100 Subject: [PATCH 04/61] ows_psql_generate_id(): fix compiler warning (output buffer cannot be used as input) --- src/ows/ows_psql.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ows/ows_psql.c b/src/ows/ows_psql.c index 4fe0e35e..ebc6daec 100644 --- a/src/ows/ows_psql.c +++ b/src/ows/ows_psql.c @@ -630,8 +630,11 @@ buffer *ows_psql_generate_id(ows * o, buffer * layer_name) fp = fopen("/dev/urandom","r"); if (fp) { - for (i=0 ; i Date: Wed, 25 Nov 2020 22:55:28 +0100 Subject: [PATCH 05/61] cgi_getback_query(): fix compiler warning about unused variable --- src/struct/cgi_request.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/struct/cgi_request.c b/src/struct/cgi_request.c index 613e37f6..64f766b6 100644 --- a/src/struct/cgi_request.c +++ b/src/struct/cgi_request.c @@ -81,6 +81,7 @@ char *cgi_getback_query(ows * o) return NULL; } s = fread(query, query_size, 1, stdin); + (void)s; if (ferror(stdin)) { ows_error(o, OWS_ERROR_REQUEST_HTTP, "Error on QUERY input", "request"); return NULL; From d0a20b80fc53f06fae98ff3679b0bb28123907fc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:55:50 +0100 Subject: [PATCH 06/61] wfs_insert_xml(): fix compiler warning about unused variable --- src/wfs/wfs_transaction.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wfs/wfs_transaction.c b/src/wfs/wfs_transaction.c index adaa73cc..a777e4f4 100644 --- a/src/wfs/wfs_transaction.c +++ b/src/wfs/wfs_transaction.c @@ -447,6 +447,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo } layer_ns_prefix = ows_layer_ns_prefix(o->layers, layer_name); + (void)layer_ns_prefix; // FIXME : unused variable ? /* ReplaceDuplicate look if an ID is already used * From f4345f886a5da620a7fe9185c64f8b92c403994c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:57:09 +0100 Subject: [PATCH 07/61] GetFeature request output: avoid repeated prefix of the typename in the schemaLocation attribute --- src/wfs/wfs_get_feature.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/wfs/wfs_get_feature.c b/src/wfs/wfs_get_feature.c index 2cbc07e6..5d4078b8 100644 --- a/src/wfs/wfs_get_feature.c +++ b/src/wfs/wfs_get_feature.c @@ -237,7 +237,6 @@ static void wfs_gml_display_namespaces(ows * o, wfs_request * wr) array *namespaces; array_node *an; list_node *ln; - buffer * ns_prefix; assert(o); assert(wr); @@ -276,8 +275,7 @@ static void wfs_gml_display_namespaces(ows * o, wfs_request * wr) if (wr->typename) { fprintf(o->output, "&Typename="); for (ln = wr->typename->first ; ln ; ln = ln->next) { - ns_prefix = ows_layer_ns_prefix(o->layers, ln->value); - fprintf(o->output, "%s:%s", ns_prefix->buf, ln->value->buf); + fprintf(o->output, "%s", ln->value->buf); if (ln->next) fprintf(o->output, ","); } } From 2d8fdfb081a4f6208de24f5d369aa0c3d4ef7abd Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:57:51 +0100 Subject: [PATCH 08/61] Fix crashes in DescribeFetureType when running the CITE 1.0 test suite --- src/wfs/wfs_describe.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/wfs/wfs_describe.c b/src/wfs/wfs_describe.c index a04593d7..c6aee74e 100644 --- a/src/wfs/wfs_describe.c +++ b/src/wfs/wfs_describe.c @@ -199,7 +199,16 @@ void wfs_describe_feature_type(ows * o, wfs_request * wr) fprintf(o->output, " elementFormDefault='qualified'> "); for (elemt = ns_prefix->first ; elemt ; elemt = elemt->next) { + if (buffer_cmp(elemt->value, "gml")) { + continue; + } namespace = ows_layer_ns_prefix_to_ns_uri(o->layers, elemt->value); + if( namespace == NULL ) { + fprintf(stderr, "Cannot find namespace URI for prefix %s\n", + elemt->value->buf); + continue; + } + fprintf(o->output, "buf); fprintf(o->output, "schemaLocation='%s?service=WFS&version=", o->online_resource->buf); @@ -270,7 +279,7 @@ void wfs_describe_feature_type(ows * o, wfs_request * wr) */ buffer * wfs_generate_schema(ows * o, ows_version * version) { - list *ns_prefix, *typename, *layers; + list *ns_prefix, *typename, *layers, *layers_name_prefix; buffer *namespace, *schema; list_node *elemt, *t; int wfs_version; @@ -281,6 +290,11 @@ buffer * wfs_generate_schema(ows * o, ows_version * version) wfs_version = ows_version_get(version); layers = ows_layer_list_having_storage(o->layers); + layers_name_prefix = list_init(); + for (elemt = layers->first; elemt ; elemt = elemt->next) { + list_add_by_copy(layers_name_prefix, ows_layer_uri_to_prefix(o->layers, elemt->value)); + } + buffer_add_str(schema, "\n"); ns_prefix = ows_layer_list_ns_prefix(o->layers, layers); @@ -296,7 +310,15 @@ buffer * wfs_generate_schema(ows * o, ows_version * version) buffer_add_str(schema, "'/>\n"); for (elemt = ns_prefix->first ; elemt ; elemt = elemt->next) { + if (buffer_cmp(elemt->value, "gml")) { + continue; + } namespace = ows_layer_ns_prefix_to_ns_uri(o->layers, elemt->value); + if( namespace == NULL ) { + fprintf(stderr, "Cannot find namespace URI for prefix %s\n", + elemt->value->buf); + continue; + } buffer_add_str(schema, ""); list_free(ns_prefix); list_free(layers); + list_free(layers_name_prefix); return schema; } From 700caa138ca7597215e532f48362b1185b1e52b3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:58:53 +0100 Subject: [PATCH 09/61] fe_distance_functions(): fix crashes / incorrect behaviour when running the CITE 1.0 test suite on distance functions --- src/fe/fe_spatial_ops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/fe/fe_spatial_ops.c b/src/fe/fe_spatial_ops.c index 59ef8a80..e8b1ab98 100644 --- a/src/fe/fe_spatial_ops.c +++ b/src/fe/fe_spatial_ops.c @@ -330,7 +330,7 @@ static buffer *fe_spatial_functions(ows * o, buffer * typename, filter_encoding static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding * fe, xmlNodePtr n) { xmlChar *content, *units; - buffer *tmp, *op, *sql; + buffer *tmp, *op, *sql, *layer_name; float km; assert(o); @@ -341,11 +341,13 @@ static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding tmp = NULL; op = buffer_init(); + layer_name = ows_layer_prefix_to_uri(o->layers, typename); + if (!strcmp((char *) n->name, "Beyond")) buffer_add_str(op, " > "); if (!strcmp((char *) n->name, "DWithin")) buffer_add_str(op, " < "); buffer_add_str(fe->sql, "ST_Distance("); - if (!ows_srs_meter_units(o, typename)) + if (!ows_srs_meter_units(o, layer_name)) buffer_add_str(fe->sql, "ST_Transform("); n = n->children; @@ -355,7 +357,7 @@ static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding fe->sql = fe_property_name(o, typename, fe, fe->sql, n, true, true); buffer_add(fe->sql, '"'); - if (!ows_srs_meter_units(o, typename)) + if (!ows_srs_meter_units(o, layer_name)) buffer_add_str(fe->sql, ", 4326)::geography"); buffer_add_str(fe->sql, "),('"); @@ -364,7 +366,7 @@ static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding while (n->type != XML_ELEMENT_NODE) n = n->next; - if (!ows_srs_meter_units(o, typename)) + if (!ows_srs_meter_units(o, layer_name)) buffer_add_str(fe->sql, "ST_Transform("); /* display the geometry */ @@ -374,7 +376,7 @@ static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding buffer_free(sql); } else fe->error_code = FE_ERROR_GEOMETRY; - if (!ows_srs_meter_units(o, typename)) + if (!ows_srs_meter_units(o, layer_name)) buffer_add_str(fe->sql, ", 4326)::geography"); buffer_add_str(fe->sql, "'))"); From 30659c11467fe9d2719626b46c361d3337c48ec7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 23:03:07 +0100 Subject: [PATCH 10/61] Add autogen.sh --- autogen.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 autogen.sh diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 00000000..e929a8ef --- /dev/null +++ b/autogen.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Autotools boostrapping script +# +giveup() +{ + echo + echo " Something went wrong, giving up!" + echo + exit 1 +} + +echo "Running autoconf" +autoconf || giveup + +echo "======================================" +echo "Now you are ready to run './configure'" +echo "======================================" From 533f240b577bf8e7600e3c424606501962fe1045 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 23:03:17 +0100 Subject: [PATCH 11/61] Add .gitignore --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8eed704e --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +Makefile +configure +demo/install.sh +demo/tinyows.xml +src/ows_define.h +test/wfs_100/config_wfs_100.xml +test/wfs_100/install_wfs_100.sh +test/wfs_110/config_wfs_110.xml +test/wfs_110/install_wfs_110.sh +tinyows From aea00a0f584c6ccd91d52833c7a938408330b044 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 22:59:18 +0100 Subject: [PATCH 12/61] Add github action to build on Linux --- .github/workflows/linux.sh | 33 +++++++++++++++++++++++++++++++++ .github/workflows/linux.yml | 15 +++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 .github/workflows/linux.sh create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.sh b/.github/workflows/linux.sh new file mode 100755 index 00000000..cc4b610c --- /dev/null +++ b/.github/workflows/linux.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +apt-get update + +DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + gcc libxml2-dev libpq-dev libfcgi-dev \ + autoconf make flex libfl-dev \ + postgresql-12 postgresql-client postgis postgresql-12-postgis-3 postgresql-12-postgis-3-scripts \ + wget ca-certificates patch valgrind + +cd "${WORK_DIR}" +./autogen.sh +CFLAGS="-Werror" ./configure +make +make install + +cp /etc/postgresql/12/main/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf.bak +echo "local all postgres trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf +echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf +/etc/init.d/postgresql start + +make install-demo + +# wget https://github.com/MapServer/tinyows/commit/633ca487113d032e261a4a5c8b5f3b7850580f4f.patch +# patch -p1 -R < 633ca487113d032e261a4a5c8b5f3b7850580f4f.patch + +# rm -f /etc/tinyows.xml +# make install-test100 + +# rm -f /etc/tinyows.xml +# make install-test110 \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 00000000..bf7850a4 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,15 @@ +name: Linux build + +on: [push, pull_request] + +jobs: + + linux_build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Build + run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/linux.sh From 22c6dfefc8d40700fbc5222d439bdc3cfdabd73e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 25 Nov 2020 23:53:03 +0100 Subject: [PATCH 13/61] Document a few fields of Ows_layer structure --- src/ows_struct.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ows_struct.h b/src/ows_struct.h index 322bc1ab..025c9a99 100644 --- a/src/ows_struct.h +++ b/src/ows_struct.h @@ -166,9 +166,9 @@ enum ows_error_code { typedef struct Ows_layer { struct Ows_layer * parent; int depth; - buffer * name; - buffer * name_prefix; - buffer * name_no_uri; + buffer * name; /* Nominally concatenation of ns_uri:name_no_uri, e.g. "http://www.tinyows.org/:world" , or name_no_uri if no ns_uri */ + buffer * name_prefix; /* Nominally concatenation of ns_prefix:name_no_uri, e.g. "tows:world" , or name_no_uri if no ns_prefix */ + buffer * name_no_uri; /* the name as in the "name" attribute in the config, e.g "world" */ buffer * title; bool retrievable; bool writable; @@ -181,8 +181,8 @@ typedef struct Ows_layer { buffer * pkey; buffer * pkey_sequence; list * gml_ns; - buffer * ns_prefix; - buffer * ns_uri; + buffer * ns_prefix; /* value of the "ns_prefix" attribute in the config, e.g. "tows" */ + buffer * ns_uri; /* value of the "ns_uri" attribute in the config, e.g. "http://www.tinyows.org/" */ buffer * encoding; ows_layer_storage * storage; } ows_layer; From 62fcd67d8d538f2e19f4180d83e4119b3d982f78 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 26 Nov 2020 00:24:52 +0100 Subject: [PATCH 14/61] Add basic 'make check' target --- .github/workflows/linux.sh | 1 + Makefile.in | 3 + demo/check.sh | 24 ++ demo/tests/expected/wfs10_describe.txt | 40 +++ demo/tests/expected/wfs10_getcaps.txt | 152 +++++++++++ .../wfs10_getfeatures_france_onefeature.txt | 36 +++ .../wfs10_getfeatures_world_onefeature.txt | 28 ++ demo/tests/expected/wfs11_describe.txt | 40 +++ demo/tests/expected/wfs11_getcaps.txt | 257 ++++++++++++++++++ .../wfs11_getfeatures_france_onefeature.txt | 35 +++ .../wfs11_getfeatures_world_onefeature.txt | 27 ++ demo/tests/input/wfs10_describe.txt | 1 + demo/tests/input/wfs10_getcaps.txt | 1 + .../wfs10_getfeatures_france_onefeature.txt | 1 + .../wfs10_getfeatures_world_onefeature.txt | 1 + demo/tests/input/wfs11_describe.txt | 1 + demo/tests/input/wfs11_getcaps.txt | 1 + .../wfs11_getfeatures_france_onefeature.txt | 1 + .../wfs11_getfeatures_world_onefeature.txt | 1 + 19 files changed, 651 insertions(+) create mode 100755 demo/check.sh create mode 100644 demo/tests/expected/wfs10_describe.txt create mode 100644 demo/tests/expected/wfs10_getcaps.txt create mode 100644 demo/tests/expected/wfs10_getfeatures_france_onefeature.txt create mode 100644 demo/tests/expected/wfs10_getfeatures_world_onefeature.txt create mode 100644 demo/tests/expected/wfs11_describe.txt create mode 100644 demo/tests/expected/wfs11_getcaps.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_france_onefeature.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_world_onefeature.txt create mode 100644 demo/tests/input/wfs10_describe.txt create mode 100644 demo/tests/input/wfs10_getcaps.txt create mode 100644 demo/tests/input/wfs10_getfeatures_france_onefeature.txt create mode 100644 demo/tests/input/wfs10_getfeatures_world_onefeature.txt create mode 100644 demo/tests/input/wfs11_describe.txt create mode 100644 demo/tests/input/wfs11_getcaps.txt create mode 100644 demo/tests/input/wfs11_getfeatures_france_onefeature.txt create mode 100644 demo/tests/input/wfs11_getfeatures_world_onefeature.txt diff --git a/.github/workflows/linux.sh b/.github/workflows/linux.sh index cc4b610c..fc1e38c9 100755 --- a/.github/workflows/linux.sh +++ b/.github/workflows/linux.sh @@ -22,6 +22,7 @@ echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.c /etc/init.d/postgresql start make install-demo +make check # wget https://github.com/MapServer/tinyows/commit/633ca487113d032e261a4a5c8b5f3b7850580f4f.patch # patch -p1 -R < 633ca487113d032e261a4a5c8b5f3b7850580f4f.patch diff --git a/Makefile.in b/Makefile.in index 1d170529..4dd219d4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -58,6 +58,9 @@ install-demo: @demo/install.sh cp -i demo/tinyows.xml /etc/tinyows.xml +check: + @demo/check.sh + install-test100: @chmod +x test/wfs_100/install_wfs_100.sh @test/wfs_100/install_wfs_100.sh diff --git a/demo/check.sh b/demo/check.sh new file mode 100755 index 00000000..be80d00a --- /dev/null +++ b/demo/check.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -eu + +RET=0 + +for i in demo/tests/input/*; do + echo "Running $i" + QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt + if ! diff -u /tmp/output.txt demo/tests/expected/$(basename $i); then + mkdir -p demo/tests/got + mv /tmp/output.txt demo/tests/got/$(basename $i) + echo "Result got put in demo/tests/got/$(basename $i)" + RET=1 + fi +done + +if test "$RET" -eq "0"; then + echo "Tests OK !" +else + echo "Tests failed !" +fi + +exit $RET \ No newline at end of file diff --git a/demo/tests/expected/wfs10_describe.txt b/demo/tests/expected/wfs10_describe.txt new file mode 100644 index 00000000..146b9f80 --- /dev/null +++ b/demo/tests/expected/wfs10_describe.txt @@ -0,0 +1,40 @@ +Content-Type: text/xml; subtype=gml/2.1.2; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/tests/expected/wfs10_getcaps.txt b/demo/tests/expected/wfs10_getcaps.txt new file mode 100644 index 00000000..f22b30f4 --- /dev/null +++ b/demo/tests/expected/wfs10_getcaps.txt @@ -0,0 +1,152 @@ +Content-Type: application/xml + + + + + TinyOWS Server + TinyOWS Server - Demo Service + http://127.0.0.1/cgi-bin/tinyows + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + tows:world + World Administrative Boundaries + EPSG:4326 + + + + tows:france + French Administrative Sub Boundaries (IGN - GeoFLA Departements) + EPSG:27582 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + abs + acos + asin + atan + avg + cbrt + ceil + ceiling + cos + cot + count + degrees + exp + floor + length + ln + log + min + max + radians + round + sin + sqrt + tan + trunc + + + + + + diff --git a/demo/tests/expected/wfs10_getfeatures_france_onefeature.txt b/demo/tests/expected/wfs10_getfeatures_france_onefeature.txt new file mode 100644 index 00000000..fc7a9795 --- /dev/null +++ b/demo/tests/expected/wfs10_getfeatures_france_onefeature.txt @@ -0,0 +1,36 @@ +Content-Type: text/xml; subtype=gml/2.1.2 + + + +missing + + + 49 + 053 + BOURG-EN-BRESSE + 8231 + 21379 + 8244 + 21380 + AIN + 82 + RHONE-ALPES + 01 + 801150,2092615 800669,2093190 800688,2095430 800780,2095795 800589,2096112 800333,2097190 799095,2098505 799136,2098838 799690,2100360 799329,2100395 797715,2100950 797655,2101330 797410,2102850 797149,2102788 796755,2102425 796738,2102785 796612,2103487 795234,2103892 794905,2104515 794547,2104359 791555,2102570 791465,2102760 791935,2104075 791835,2105023 791670,2105295 790205,2105555 790035,2105875 789304,2107116 788617,2107148 788005,2106760 787670,2106708 786705,2106990 786350,2107029 785720,2107335 785562,2108399 786670,2109486 786930,2109775 787055,2110010 787208,2110344 787367,2111056 786900,2113550 786795,2114260 786830,2114370 786811,2114751 786384,2116197 786550,2116940 786560,2117563 786465,2117860 785956,2119206 787211,2120474 787415,2120775 787600,2121475 787536,2121809 787137,2122743 786610,2123110 786457,2124100 787138,2124890 787365,2125160 787545,2125377 787880,2125830 788198,2126745 788225,2127075 789130,2128290 789370,2128585 789790,2129209 789995,2129525 790445,2131460 790237,2131793 789585,2132230 788993,2132742 788830,2133100 788650,2133655 788638,2134028 788673,2135142 789501,2136382 789510,2137110 789596,2138174 789680,2138520 789845,2139015 790050,2139590 790594,2140547 790750,2142011 790740,2142380 790739,2142716 791139,2143599 791749,2144456 791860,2144790 792199,2147049 792285,2147420 792880,2148815 793615,2150425 793737,2150782 793650,2152285 793618,2152660 793480,2153400 794012,2155103 794347,2155696 794535,2155980 794686,2156241 795135,2157025 796115,2159030 796193,2160314 796250,2160635 796311,2161408 796335,2161795 796324,2162102 796316,2163021 796385,2163470 796495,2163785 797830,2165380 797970,2165700 797959,2167362 797910,2167695 797905,2167835 798850,2169845 798930,2170117 798980,2170395 799122,2171035 799255,2171335 799340,2171435 800295,2171593 800326,2170924 800757,2170498 801505,2170754 802043,2171611 802820,2171760 804846,2171217 805165,2171380 805338,2170485 805485,2170210 808352,2168729 808655,2168520 809605,2168719 809930,2168735 811710,2170150 813076,2169640 814292,2170568 814670,2170640 815189,2171442 816978,2171075 817045,2172530 818290,2171719 819798,2171534 819990,2171205 819753,2170948 820496,2169812 820305,2169145 820810,2168648 821023,2167568 821020,2167190 821753,2167185 822453,2166355 822690,2166075 823263,2166394 823585,2166285 824250,2165476 825284,2165330 825600,2165160 828440,2165065 829372,2163119 828470,2162490 828705,2161655 828395,2161531 827745,2161519 828485,2161005 830445,2159908 831525,2159915 832747,2158958 833030,2158780 833286,2158494 833885,2158105 833687,2157807 832940,2157040 832830,2156696 833866,2155806 833825,2155445 833752,2155097 833675,2154750 835995,2153047 835930,2152675 836194,2151171 836185,2150780 836190,2150680 836405,2150149 836690,2150070 837059,2153840 837545,2154400 838628,2151187 838735,2150820 840056,2151192 840530,2151708 840855,2151840 841371,2151081 841670,2150965 841591,2150606 841093,2148479 840525,2148155 840483,2146631 841576,2145603 841898,2145394 843750,2145800 843973,2146033 844372,2145523 844675,2145410 846805,2146002 848292,2147688 848440,2148035 848651,2148733 850029,2148841 850390,2148775 851184,2149407 851650,2150710 851857,2150922 851710,2151180 852195,2152638 853883,2153465 854050,2153815 854684,2154550 854950,2153948 855010,2153605 854706,2152546 856495,2152522 857425,2151954 857675,2151680 857795,2151135 860115,2150917 860522,2149401 860356,2147845 860868,2145955 861160,2145690 861499,2145842 861800,2146060 863931,2146529 864270,2146675 867954,2146311 868320,2146245 868625,2146162 868940,2146145 870819,2146227 871569,2147047 872099,2147009 872230,2146655 873891,2148801 874080,2149145 875215,2148900 875688,2149908 875836,2151749 876350,2152270 877249,2151866 877575,2151825 877751,2152160 879950,2156500 880577,2157904 882757,2159490 884049,2160898 885600,2163565 886165,2164270 886435,2164140 889069,2163415 889778,2162493 890867,2162099 893000,2160395 894101,2160083 894575,2159465 894622,2158743 893375,2156340 892712,2155944 892540,2155185 891600,2153375 891281,2152677 891245,2152295 891340,2150917 890292,2149984 890080,2149695 890987,2147869 891235,2147615 891560,2147405 891794,2146272 891337,2145258 890413,2144570 889185,2145445 888822,2145356 887853,2144792 887180,2145110 886092,2143618 885735,2143730 885432,2143963 884760,2143997 883760,2143495 883455,2143280 882749,2142419 882058,2142149 881989,2141782 880591,2141448 880422,2140052 879890,2139555 879855,2139435 882197,2138192 882019,2137078 881408,2136753 880810,2134940 880202,2133632 880177,2132631 879600,2132205 879351,2132001 878142,2131755 877449,2131650 876853,2131962 875845,2130970 875089,2130628 874800,2130520 874322,2129464 874925,2128114 874725,2126982 872900,2126720 872100,2126810 871837,2127080 870648,2128513 869972,2128829 869296,2128495 869435,2127050 868710,2125650 868663,2125275 868525,2123780 868760,2123569 868985,2123070 868525,2121885 868617,2121591 868760,2120685 868864,2120349 869034,2119679 868545,2118760 868661,2118458 868975,2117935 868911,2117610 869020,2116295 869215,2115554 870970,2114005 870979,2113621 870925,2112855 871130,2111817 870721,2110485 870455,2110250 870800,2110165 870344,2109573 870311,2108843 870897,2107500 870710,2106390 870615,2106018 869975,2103410 869465,2101545 869314,2101232 869040,2099875 868989,2099512 868710,2098080 868050,2097320 867940,2096964 867995,2094425 867975,2094056 867825,2092595 867736,2092277 867995,2091670 867979,2091277 867788,2090131 868170,2088645 867935,2088380 867643,2088330 867110,2088110 867246,2087753 867588,2086334 866723,2085607 866013,2084278 865294,2084187 864275,2084575 864000,2084465 863659,2084328 861885,2084450 861845,2084109 862185,2083150 862398,2082820 862694,2082092 862533,2081333 860925,2079632 860842,2078870 861160,2078155 861300,2077808 861210,2077080 860973,2076787 860337,2076386 858511,2076155 858205,2075110 858072,2074811 857453,2074591 857320,2073960 857265,2073584 856650,2073221 856355,2073460 856182,2073797 855610,2074780 854744,2075941 854474,2077758 852864,2078730 852620,2079020 852647,2079386 851685,2079920 851354,2080021 850753,2079717 850470,2079917 850320,2080840 850069,2081131 850023,2082613 850741,2082507 851509,2081230 852157,2081554 852073,2082291 850451,2083206 850375,2083940 850111,2084174 849805,2084350 848375,2084500 848150,2084810 847545,2086215 847281,2086449 845980,2087620 845694,2087856 844840,2088564 842895,2091270 842098,2091898 841825,2092105 841604,2092424 841170,2093065 840895,2093318 839825,2094355 839769,2096198 840798,2096536 840745,2096910 840580,2097185 840305,2097470 839320,2098117 839165,2098880 839016,2099191 838200,2099825 836342,2100899 836100,2101165 835840,2101453 834252,2102554 833175,2102260 833017,2102031 832785,2101525 832719,2101162 832433,2100482 831189,2099710 830330,2098550 829565,2095140 829550,2094745 829422,2094389 828638,2093577 827810,2091920 827523,2091724 826955,2091325 826653,2091135 825785,2090510 825487,2090257 824587,2089517 822700,2089735 822339,2089692 821748,2090044 821660,2090765 821459,2091109 820815,2092110 820470,2092273 819281,2093148 818215,2093260 817851,2093406 816405,2093980 815735,2093715 815844,2092629 815501,2092497 814830,2094120 814502,2094025 814175,2093925 813785,2093907 811510,2093620 811202,2093793 810503,2093796 809935,2093390 808612,2093210 808305,2093030 807965,2092976 807085,2093490 806759,2093370 806450,2093210 805480,2092960 804700,2093105 804426,2093280 803230,2093210 802864,2093269 801150,2092615 + + + diff --git a/demo/tests/expected/wfs10_getfeatures_world_onefeature.txt b/demo/tests/expected/wfs10_getfeatures_world_onefeature.txt new file mode 100644 index 00000000..f480e80f --- /dev/null +++ b/demo/tests/expected/wfs10_getfeatures_world_onefeature.txt @@ -0,0 +1,28 @@ +Content-Type: text/xml; subtype=gml/2.1.2 + + + +missing + + + Afghanistan + AFG + Asia + 65.627296,37.333199 65.646927,37.458881 65.70137,37.53693 65.766083,37.534161 65.785522,37.568878 66.30275,37.323601 66.538765,37.360512 66.586906,37.368038 66.665253,37.338322 66.744423,37.36137 67.021637,37.377201 67.200256,37.246651 67.229424,37.191929 67.266373,37.185261 67.424408,37.234989 67.521637,37.27248 67.557457,37.215542 67.649406,37.24609 67.774139,37.206089 67.777153,37.185799 67.791641,37.088322 67.885529,37.061371 67.910522,37.014431 68.035522,36.924709 68.28331,37.019981 68.278313,37.086929 68.301643,37.111099 68.413017,37.104431 68.412193,37.148041 68.524979,37.16193 68.654694,37.246929 68.825813,37.247761 68.809402,37.322491 68.85025,37.324711 68.904968,37.272209 68.924408,37.28471 68.891647,37.31749 68.999687,37.307758 69.246628,37.094151 69.333038,37.124981 69.45137,37.22998 69.381348,37.344151 69.382736,37.455818 69.515808,37.580818 69.91803,37.611931 69.958588,37.564991 70.134979,37.529148 70.255539,37.62109 70.276917,37.741371 70.165527,37.872211 70.170242,37.94165 70.203857,37.92054 70.378304,38.057758 70.491913,38.16721 70.584412,38.278591 70.596359,38.334148 70.685516,38.375259 70.672203,38.414429 70.880524,38.453041 71.101913,38.40609 71.363022,38.248871 71.363861,38.18803 71.284698,38.019981 71.264137,37.918049 71.37468,37.905819 71.546356,37.942478 71.591919,37.903042 71.588577,37.81609 71.528847,37.764431 71.49025,37.284161 71.446907,37.20776 71.43219,37.05859 71.568314,36.741371 71.695236,36.672211 71.842743,36.692478 72.011368,36.812199 72.346626,36.989979 72.663589,37.026089 72.798859,37.22998 73.08136,37.320541 73.150528,37.400822 73.314407,37.463322 73.776642,37.434429 73.752762,37.331379 73.649406,37.304428 73.619957,37.26276 73.634407,37.239979 73.792473,37.22942 74.363861,37.4286 74.400803,37.399429 74.699692,37.39193 74.898827,37.240299 74.816933,37.219151 74.763313,37.30109 74.669418,37.266102 74.651077,37.234711 74.537193,37.243038 74.392197,37.175259 74.400528,37.139149 74.567749,37.02647 74.558006,36.96526 74.482193,37.011101 74.336906,36.958881 74.251923,36.899429 74.158859,36.906651 74.06218,36.821659 73.963028,36.837761 73.779694,36.901089 73.113022,36.873871 72.492462,36.771931 72.181641,36.71471 72.191643,36.6572 72.073303,36.628868 72.074692,36.58942 71.795807,36.491928 71.817749,36.41666 71.753036,36.40749 71.646637,36.46804 71.563019,36.372478 71.582748,36.335819 71.248581,36.133041 71.188019,36.047211 71.291077,35.96859 71.380524,35.946091 71.545242,35.711102 71.508591,35.626652 71.613861,35.561932 71.606918,35.48193 71.647202,35.436939 71.549133,35.32832 71.553574,35.28915 71.659126,35.207489 71.618027,35.131371 71.543297,35.0947 71.496078,34.959431 71.313858,34.886929 71.225517,34.744431 71.09581,34.676651 71.094971,34.56805 70.995796,34.55859 70.978027,34.510818 71.073029,34.39415 71.153313,34.36137 71.135529,34.166088 70.981079,34.008881 70.905533,34.013321 70.900528,33.973591 70.491348,33.943039 69.902763,34.031101 69.907471,33.881931 69.985519,33.75304 70.132736,33.735538 70.196617,33.64082 70.197739,33.485821 70.306084,33.396099 70.32692,33.33194 70.144974,33.202492 70.067749,33.20499 70.033577,33.139431 69.881073,33.089981 69.791351,33.126942 69.561081,33.081928 69.492462,33.008598 69.515259,32.873878 69.394974,32.773869 69.456917,32.682209 69.397751,32.587761 69.287483,32.526379 69.248016,32.443871 69.283043,32.21777 69.287483,32.069149 69.333862,31.94389 69.029694,31.64555 68.833038,31.60388 68.731918,31.69944 68.712479,31.778879 68.54747,31.829161 68.444122,31.79472 68.447739,31.77277 68.57164,31.76527 68.53775,31.72666 68.221626,31.81559 68.166077,31.83305 67.98053,31.63583 67.887482,31.63999 67.738022,31.53083 67.581093,31.5336 67.646362,31.40999 67.766922,31.4111 67.799698,31.38249 67.791924,31.341101 67.288017,31.2136 67.256363,31.22249 67.069702,31.239161 67.034698,31.25444 67.051643,31.297779 67.036911,31.318609 66.891647,31.296101 66.723022,31.21221 66.684128,31.086109 66.56636,30.97777 66.404968,30.94611 66.281921,30.57527 66.35025,30.45055 66.259697,30.114161 66.238297,30.071381 66.361359,29.966101 66.256638,29.85194 65.417473,29.640551 65.034126,29.5411 64.695511,29.58638 64.273857,29.52389 64.193024,29.48749 64.131348,29.394159 63.5872,29.50388 62.78693,29.43388 62.484428,29.406099 61.743599,29.615829 60.99387,29.826099 60.866871,29.862431 61.25304,30.259991 61.812759,30.843611 61.803871,30.94582 61.84721,31.04888 61.76582,31.24527 61.771099,31.318331 61.7136,31.383329 61.619431,31.395821 60.843868,31.498329 60.810261,31.8736 60.857769,32.234718 60.74165,32.578869 60.581928,33.071659 60.591091,33.16304 60.85165,33.418049 60.858318,33.49387 60.9286,33.504429 60.901649,33.554428 60.649151,33.574989 60.522758,33.653042 60.50526,33.739151 60.55415,33.81332 60.52137,33.999149 60.513599,34.150822 60.67165,34.313599 60.911091,34.31638 60.89777,34.345821 60.756649,34.483318 60.733601,34.54166 60.863602,34.576389 61.065262,34.812759 61.11388,35.201649 61.104431,35.279148 61.1861,35.29694 61.239151,35.481091 61.27776,35.52026 61.278721,35.60675 61.365822,35.639709 61.464989,35.52721 61.576649,35.450821 61.802479,35.411091 61.97221,35.45998 62.100819,35.394711 62.259159,35.297771 62.305538,35.145538 62.459431,35.286381 62.62331,35.224979 63.110538,35.481369 63.095261,35.626091 63.23888,35.69553 63.10416,35.825821 63.119431,35.861931 63.317211,35.852211 63.538879,35.90971 63.595539,35.9622 63.933868,36.03915 64.063858,36.000271 64.059692,36.088039 64.169418,36.167488 64.282471,36.15192 64.32164,36.216381 64.458862,36.247211 64.570534,36.35638 64.627747,36.45998 64.61525,36.629429 64.795242,36.923038 64.779137,37.095821 64.798019,37.124981 65.072746,37.244431 65.530807,37.2486 65.627296,37.333199 + + + diff --git a/demo/tests/expected/wfs11_describe.txt b/demo/tests/expected/wfs11_describe.txt new file mode 100644 index 00000000..aad422c2 --- /dev/null +++ b/demo/tests/expected/wfs11_describe.txt @@ -0,0 +1,40 @@ +Content-Type: text/xml; subtype=gml/3.1.1; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/tests/expected/wfs11_getcaps.txt b/demo/tests/expected/wfs11_getcaps.txt new file mode 100644 index 00000000..6091c9cf --- /dev/null +++ b/demo/tests/expected/wfs11_getcaps.txt @@ -0,0 +1,257 @@ +Content-Type: application/xml + + + + + TinyOWS Server - Demo Service + WFS + 1.0.0 + 1.1.0 + + + + + + + + + + + + + + + 1.1.0 + 1.0.0 + + + text/xml + + + ServiceIdentification + ServiceProvider + OperationsMetadata + FeatureTypeList + ServesGMLObjectTypeList + SupportsGMLObjectTypeList + + + + + + + + + + + + + + + text/xml; subtype=gml/3.1.1 + text/xml; subtype=gml/2.1.2 + + + + + + + + + + + + + + + results + hits + + + text/xml; subtype=gml/3.1.1 + text/xml; subtype=gml/2.1.2 + application/json + + + + + + + + + + + + + + + text/xml; subtype=gml/3.1.1 + + + GenerateNew + UseExisting + + + + 0 + + + 0 + + + + + Query + Insert + Update + Delete + + + tows:world + World Administrative Boundaries + urn:ogc:def:crs:EPSG::4326 + -180.000183 -90.000000 180.000000 83.623032 + + + tows:france + French Administrative Sub Boundaries (IGN - GeoFLA Departements) + urn:ogc:def:crs:EPSG::27582 + -6.091001 41.347435 10.812651 50.803540 + + + + + gml:AbstractGMLFeatureType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:PointType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:LineStringType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:PolygonType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:MultiPointType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:MultiLineStringType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + gml:MultiPolygonType + + text/xml; subtype=gml/2.1.2 + text/xml; subtype=gml/3.1.1 + + + + + + + gml:Envelope + gml:Point + gml:LineString + gml:Polygon + gml:Triangle + gml:PolyhedralSurface + gml:Tin + + + + + + + + + + + + + + + + + + + EqualTo + NotEqualTo + LessThan + GreaterThan + LessThanEqualTo + GreaterThanEqualTo + Between + Like + NullCheck + + + + + + abs + acos + asin + atan + avg + cbrt + ceil + ceiling + cos + cot + count + degrees + exp + floor + length + ln + log + min + max + radians + round + sin + sqrt + tan + trunc + + + + + + + + + + diff --git a/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt b/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt new file mode 100644 index 00000000..2b3c20de --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt @@ -0,0 +1,35 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + 49 + 053 + BOURG-EN-BRESSE + 8231 + 21379 + 8244 + 21380 + AIN + 82 + RHONE-ALPES + 01 + 2092615 801150 2093190 800669 2095430 800688 2095795 800780 2096112 800589 2097190 800333 2098505 799095 2098838 799136 2100360 799690 2100395 799329 2100950 797715 2101330 797655 2102850 797410 2102788 797149 2102425 796755 2102785 796738 2103487 796612 2103892 795234 2104515 794905 2104359 794547 2102570 791555 2102760 791465 2104075 791935 2105023 791835 2105295 791670 2105555 790205 2105875 790035 2107116 789304 2107148 788617 2106760 788005 2106708 787670 2106990 786705 2107029 786350 2107335 785720 2108399 785562 2109486 786670 2109775 786930 2110010 787055 2110344 787208 2111056 787367 2113550 786900 2114260 786795 2114370 786830 2114751 786811 2116197 786384 2116940 786550 2117563 786560 2117860 786465 2119206 785956 2120474 787211 2120775 787415 2121475 787600 2121809 787536 2122743 787137 2123110 786610 2124100 786457 2124890 787138 2125160 787365 2125377 787545 2125830 787880 2126745 788198 2127075 788225 2128290 789130 2128585 789370 2129209 789790 2129525 789995 2131460 790445 2131793 790237 2132230 789585 2132742 788993 2133100 788830 2133655 788650 2134028 788638 2135142 788673 2136382 789501 2137110 789510 2138174 789596 2138520 789680 2139015 789845 2139590 790050 2140547 790594 2142011 790750 2142380 790740 2142716 790739 2143599 791139 2144456 791749 2144790 791860 2147049 792199 2147420 792285 2148815 792880 2150425 793615 2150782 793737 2152285 793650 2152660 793618 2153400 793480 2155103 794012 2155696 794347 2155980 794535 2156241 794686 2157025 795135 2159030 796115 2160314 796193 2160635 796250 2161408 796311 2161795 796335 2162102 796324 2163021 796316 2163470 796385 2163785 796495 2165380 797830 2165700 797970 2167362 797959 2167695 797910 2167835 797905 2169845 798850 2170117 798930 2170395 798980 2171035 799122 2171335 799255 2171435 799340 2171593 800295 2170924 800326 2170498 800757 2170754 801505 2171611 802043 2171760 802820 2171217 804846 2171380 805165 2170485 805338 2170210 805485 2168729 808352 2168520 808655 2168719 809605 2168735 809930 2170150 811710 2169640 813076 2170568 814292 2170640 814670 2171442 815189 2171075 816978 2172530 817045 2171719 818290 2171534 819798 2171205 819990 2170948 819753 2169812 820496 2169145 820305 2168648 820810 2167568 821023 2167190 821020 2167185 821753 2166355 822453 2166075 822690 2166394 823263 2166285 823585 2165476 824250 2165330 825284 2165160 825600 2165065 828440 2163119 829372 2162490 828470 2161655 828705 2161531 828395 2161519 827745 2161005 828485 2159908 830445 2159915 831525 2158958 832747 2158780 833030 2158494 833286 2158105 833885 2157807 833687 2157040 832940 2156696 832830 2155806 833866 2155445 833825 2155097 833752 2154750 833675 2153047 835995 2152675 835930 2151171 836194 2150780 836185 2150680 836190 2150149 836405 2150070 836690 2153840 837059 2154400 837545 2151187 838628 2150820 838735 2151192 840056 2151708 840530 2151840 840855 2151081 841371 2150965 841670 2150606 841591 2148479 841093 2148155 840525 2146631 840483 2145603 841576 2145394 841898 2145800 843750 2146033 843973 2145523 844372 2145410 844675 2146002 846805 2147688 848292 2148035 848440 2148733 848651 2148841 850029 2148775 850390 2149407 851184 2150710 851650 2150922 851857 2151180 851710 2152638 852195 2153465 853883 2153815 854050 2154550 854684 2153948 854950 2153605 855010 2152546 854706 2152522 856495 2151954 857425 2151680 857675 2151135 857795 2150917 860115 2149401 860522 2147845 860356 2145955 860868 2145690 861160 2145842 861499 2146060 861800 2146529 863931 2146675 864270 2146311 867954 2146245 868320 2146162 868625 2146145 868940 2146227 870819 2147047 871569 2147009 872099 2146655 872230 2148801 873891 2149145 874080 2148900 875215 2149908 875688 2151749 875836 2152270 876350 2151866 877249 2151825 877575 2152160 877751 2156500 879950 2157904 880577 2159490 882757 2160898 884049 2163565 885600 2164270 886165 2164140 886435 2163415 889069 2162493 889778 2162099 890867 2160395 893000 2160083 894101 2159465 894575 2158743 894622 2156340 893375 2155944 892712 2155185 892540 2153375 891600 2152677 891281 2152295 891245 2150917 891340 2149984 890292 2149695 890080 2147869 890987 2147615 891235 2147405 891560 2146272 891794 2145258 891337 2144570 890413 2145445 889185 2145356 888822 2144792 887853 2145110 887180 2143618 886092 2143730 885735 2143963 885432 2143997 884760 2143495 883760 2143280 883455 2142419 882749 2142149 882058 2141782 881989 2141448 880591 2140052 880422 2139555 879890 2139435 879855 2138192 882197 2137078 882019 2136753 881408 2134940 880810 2133632 880202 2132631 880177 2132205 879600 2132001 879351 2131755 878142 2131650 877449 2131962 876853 2130970 875845 2130628 875089 2130520 874800 2129464 874322 2128114 874925 2126982 874725 2126720 872900 2126810 872100 2127080 871837 2128513 870648 2128829 869972 2128495 869296 2127050 869435 2125650 868710 2125275 868663 2123780 868525 2123569 868760 2123070 868985 2121885 868525 2121591 868617 2120685 868760 2120349 868864 2119679 869034 2118760 868545 2118458 868661 2117935 868975 2117610 868911 2116295 869020 2115554 869215 2114005 870970 2113621 870979 2112855 870925 2111817 871130 2110485 870721 2110250 870455 2110165 870800 2109573 870344 2108843 870311 2107500 870897 2106390 870710 2106018 870615 2103410 869975 2101545 869465 2101232 869314 2099875 869040 2099512 868989 2098080 868710 2097320 868050 2096964 867940 2094425 867995 2094056 867975 2092595 867825 2092277 867736 2091670 867995 2091277 867979 2090131 867788 2088645 868170 2088380 867935 2088330 867643 2088110 867110 2087753 867246 2086334 867588 2085607 866723 2084278 866013 2084187 865294 2084575 864275 2084465 864000 2084328 863659 2084450 861885 2084109 861845 2083150 862185 2082820 862398 2082092 862694 2081333 862533 2079632 860925 2078870 860842 2078155 861160 2077808 861300 2077080 861210 2076787 860973 2076386 860337 2076155 858511 2075110 858205 2074811 858072 2074591 857453 2073960 857320 2073584 857265 2073221 856650 2073460 856355 2073797 856182 2074780 855610 2075941 854744 2077758 854474 2078730 852864 2079020 852620 2079386 852647 2079920 851685 2080021 851354 2079717 850753 2079917 850470 2080840 850320 2081131 850069 2082613 850023 2082507 850741 2081230 851509 2081554 852157 2082291 852073 2083206 850451 2083940 850375 2084174 850111 2084350 849805 2084500 848375 2084810 848150 2086215 847545 2086449 847281 2087620 845980 2087856 845694 2088564 844840 2091270 842895 2091898 842098 2092105 841825 2092424 841604 2093065 841170 2093318 840895 2094355 839825 2096198 839769 2096536 840798 2096910 840745 2097185 840580 2097470 840305 2098117 839320 2098880 839165 2099191 839016 2099825 838200 2100899 836342 2101165 836100 2101453 835840 2102554 834252 2102260 833175 2102031 833017 2101525 832785 2101162 832719 2100482 832433 2099710 831189 2098550 830330 2095140 829565 2094745 829550 2094389 829422 2093577 828638 2091920 827810 2091724 827523 2091325 826955 2091135 826653 2090510 825785 2090257 825487 2089517 824587 2089735 822700 2089692 822339 2090044 821748 2090765 821660 2091109 821459 2092110 820815 2092273 820470 2093148 819281 2093260 818215 2093406 817851 2093980 816405 2093715 815735 2092629 815844 2092497 815501 2094120 814830 2094025 814502 2093925 814175 2093907 813785 2093620 811510 2093793 811202 2093796 810503 2093390 809935 2093210 808612 2093030 808305 2092976 807965 2093490 807085 2093370 806759 2093210 806450 2092960 805480 2093105 804700 2093280 804426 2093210 803230 2093269 802864 2092615 801150 + + + diff --git a/demo/tests/expected/wfs11_getfeatures_world_onefeature.txt b/demo/tests/expected/wfs11_getfeatures_world_onefeature.txt new file mode 100644 index 00000000..06d37268 --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_world_onefeature.txt @@ -0,0 +1,27 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + Afghanistan + AFG + Asia + 37.333199 65.627296 37.458881 65.646927 37.53693 65.70137 37.534161 65.766083 37.568878 65.785522 37.323601 66.30275 37.360512 66.538765 37.368038 66.586906 37.338322 66.665253 37.36137 66.744423 37.377201 67.021637 37.246651 67.200256 37.191929 67.229424 37.185261 67.266373 37.234989 67.424408 37.27248 67.521637 37.215542 67.557457 37.24609 67.649406 37.206089 67.774139 37.185799 67.777153 37.088322 67.791641 37.061371 67.885529 37.014431 67.910522 36.924709 68.035522 37.019981 68.28331 37.086929 68.278313 37.111099 68.301643 37.104431 68.413017 37.148041 68.412193 37.16193 68.524979 37.246929 68.654694 37.247761 68.825813 37.322491 68.809402 37.324711 68.85025 37.272209 68.904968 37.28471 68.924408 37.31749 68.891647 37.307758 68.999687 37.094151 69.246628 37.124981 69.333038 37.22998 69.45137 37.344151 69.381348 37.455818 69.382736 37.580818 69.515808 37.611931 69.91803 37.564991 69.958588 37.529148 70.134979 37.62109 70.255539 37.741371 70.276917 37.872211 70.165527 37.94165 70.170242 37.92054 70.203857 38.057758 70.378304 38.16721 70.491913 38.278591 70.584412 38.334148 70.596359 38.375259 70.685516 38.414429 70.672203 38.453041 70.880524 38.40609 71.101913 38.248871 71.363022 38.18803 71.363861 38.019981 71.284698 37.918049 71.264137 37.905819 71.37468 37.942478 71.546356 37.903042 71.591919 37.81609 71.588577 37.764431 71.528847 37.284161 71.49025 37.20776 71.446907 37.05859 71.43219 36.741371 71.568314 36.672211 71.695236 36.692478 71.842743 36.812199 72.011368 36.989979 72.346626 37.026089 72.663589 37.22998 72.798859 37.320541 73.08136 37.400822 73.150528 37.463322 73.314407 37.434429 73.776642 37.331379 73.752762 37.304428 73.649406 37.26276 73.619957 37.239979 73.634407 37.22942 73.792473 37.4286 74.363861 37.399429 74.400803 37.39193 74.699692 37.240299 74.898827 37.219151 74.816933 37.30109 74.763313 37.266102 74.669418 37.234711 74.651077 37.243038 74.537193 37.175259 74.392197 37.139149 74.400528 37.02647 74.567749 36.96526 74.558006 37.011101 74.482193 36.958881 74.336906 36.899429 74.251923 36.906651 74.158859 36.821659 74.06218 36.837761 73.963028 36.901089 73.779694 36.873871 73.113022 36.771931 72.492462 36.71471 72.181641 36.6572 72.191643 36.628868 72.073303 36.58942 72.074692 36.491928 71.795807 36.41666 71.817749 36.40749 71.753036 36.46804 71.646637 36.372478 71.563019 36.335819 71.582748 36.133041 71.248581 36.047211 71.188019 35.96859 71.291077 35.946091 71.380524 35.711102 71.545242 35.626652 71.508591 35.561932 71.613861 35.48193 71.606918 35.436939 71.647202 35.32832 71.549133 35.28915 71.553574 35.207489 71.659126 35.131371 71.618027 35.0947 71.543297 34.959431 71.496078 34.886929 71.313858 34.744431 71.225517 34.676651 71.09581 34.56805 71.094971 34.55859 70.995796 34.510818 70.978027 34.39415 71.073029 34.36137 71.153313 34.166088 71.135529 34.008881 70.981079 34.013321 70.905533 33.973591 70.900528 33.943039 70.491348 34.031101 69.902763 33.881931 69.907471 33.75304 69.985519 33.735538 70.132736 33.64082 70.196617 33.485821 70.197739 33.396099 70.306084 33.33194 70.32692 33.202492 70.144974 33.20499 70.067749 33.139431 70.033577 33.089981 69.881073 33.126942 69.791351 33.081928 69.561081 33.008598 69.492462 32.873878 69.515259 32.773869 69.394974 32.682209 69.456917 32.587761 69.397751 32.526379 69.287483 32.443871 69.248016 32.21777 69.283043 32.069149 69.287483 31.94389 69.333862 31.64555 69.029694 31.60388 68.833038 31.69944 68.731918 31.778879 68.712479 31.829161 68.54747 31.79472 68.444122 31.77277 68.447739 31.76527 68.57164 31.72666 68.53775 31.81559 68.221626 31.83305 68.166077 31.63583 67.98053 31.63999 67.887482 31.53083 67.738022 31.5336 67.581093 31.40999 67.646362 31.4111 67.766922 31.38249 67.799698 31.341101 67.791924 31.2136 67.288017 31.22249 67.256363 31.239161 67.069702 31.25444 67.034698 31.297779 67.051643 31.318609 67.036911 31.296101 66.891647 31.21221 66.723022 31.086109 66.684128 30.97777 66.56636 30.94611 66.404968 30.57527 66.281921 30.45055 66.35025 30.114161 66.259697 30.071381 66.238297 29.966101 66.361359 29.85194 66.256638 29.640551 65.417473 29.5411 65.034126 29.58638 64.695511 29.52389 64.273857 29.48749 64.193024 29.394159 64.131348 29.50388 63.5872 29.43388 62.78693 29.406099 62.484428 29.615829 61.743599 29.826099 60.99387 29.862431 60.866871 30.259991 61.25304 30.843611 61.812759 30.94582 61.803871 31.04888 61.84721 31.24527 61.76582 31.318331 61.771099 31.383329 61.7136 31.395821 61.619431 31.498329 60.843868 31.8736 60.810261 32.234718 60.857769 32.578869 60.74165 33.071659 60.581928 33.16304 60.591091 33.418049 60.85165 33.49387 60.858318 33.504429 60.9286 33.554428 60.901649 33.574989 60.649151 33.653042 60.522758 33.739151 60.50526 33.81332 60.55415 33.999149 60.52137 34.150822 60.513599 34.313599 60.67165 34.31638 60.911091 34.345821 60.89777 34.483318 60.756649 34.54166 60.733601 34.576389 60.863602 34.812759 61.065262 35.201649 61.11388 35.279148 61.104431 35.29694 61.1861 35.481091 61.239151 35.52026 61.27776 35.60675 61.278721 35.639709 61.365822 35.52721 61.464989 35.450821 61.576649 35.411091 61.802479 35.45998 61.97221 35.394711 62.100819 35.297771 62.259159 35.145538 62.305538 35.286381 62.459431 35.224979 62.62331 35.481369 63.110538 35.626091 63.095261 35.69553 63.23888 35.825821 63.10416 35.861931 63.119431 35.852211 63.317211 35.90971 63.538879 35.9622 63.595539 36.03915 63.933868 36.000271 64.063858 36.088039 64.059692 36.167488 64.169418 36.15192 64.282471 36.216381 64.32164 36.247211 64.458862 36.35638 64.570534 36.45998 64.627747 36.629429 64.61525 36.923038 64.795242 37.095821 64.779137 37.124981 64.798019 37.244431 65.072746 37.2486 65.530807 37.333199 65.627296 + + + diff --git a/demo/tests/input/wfs10_describe.txt b/demo/tests/input/wfs10_describe.txt new file mode 100644 index 00000000..c10c6538 --- /dev/null +++ b/demo/tests/input/wfs10_describe.txt @@ -0,0 +1 @@ +service=WFS&version=1.0.0&request=DescribeFeatureType diff --git a/demo/tests/input/wfs10_getcaps.txt b/demo/tests/input/wfs10_getcaps.txt new file mode 100644 index 00000000..9a2be12a --- /dev/null +++ b/demo/tests/input/wfs10_getcaps.txt @@ -0,0 +1 @@ +service=WFS&version=1.0.0&request=GetCapabilities diff --git a/demo/tests/input/wfs10_getfeatures_france_onefeature.txt b/demo/tests/input/wfs10_getfeatures_france_onefeature.txt new file mode 100644 index 00000000..03a729bd --- /dev/null +++ b/demo/tests/input/wfs10_getfeatures_france_onefeature.txt @@ -0,0 +1 @@ +service=WFS&version=1.0.0&request=GetFeature&typename=tows:france&maxfeatures=1 diff --git a/demo/tests/input/wfs10_getfeatures_world_onefeature.txt b/demo/tests/input/wfs10_getfeatures_world_onefeature.txt new file mode 100644 index 00000000..52656ebf --- /dev/null +++ b/demo/tests/input/wfs10_getfeatures_world_onefeature.txt @@ -0,0 +1 @@ +service=WFS&version=1.0.0&request=GetFeature&typename=tows:world&maxfeatures=1 diff --git a/demo/tests/input/wfs11_describe.txt b/demo/tests/input/wfs11_describe.txt new file mode 100644 index 00000000..0413e484 --- /dev/null +++ b/demo/tests/input/wfs11_describe.txt @@ -0,0 +1 @@ +service=WFS&version=1.1.0&request=DescribeFeatureType diff --git a/demo/tests/input/wfs11_getcaps.txt b/demo/tests/input/wfs11_getcaps.txt new file mode 100644 index 00000000..84710b60 --- /dev/null +++ b/demo/tests/input/wfs11_getcaps.txt @@ -0,0 +1 @@ +service=WFS&version=1.1.0&request=GetCapabilities diff --git a/demo/tests/input/wfs11_getfeatures_france_onefeature.txt b/demo/tests/input/wfs11_getfeatures_france_onefeature.txt new file mode 100644 index 00000000..660f7412 --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_france_onefeature.txt @@ -0,0 +1 @@ +service=WFS&version=1.1.0&request=GetFeature&typename=tows:france&maxfeatures=1 diff --git a/demo/tests/input/wfs11_getfeatures_world_onefeature.txt b/demo/tests/input/wfs11_getfeatures_world_onefeature.txt new file mode 100644 index 00000000..df4c90a4 --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_world_onefeature.txt @@ -0,0 +1 @@ +service=WFS&version=1.1.0&request=GetFeature&typename=tows:world&maxfeatures=1 From 3f1fee7b912531ca50eb50edbdba460c8a4d8289 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Nov 2020 00:52:19 +0100 Subject: [PATCH 15/61] Rework SRS axis order handling, and in particular avoid GetFeature WFS 1.1 to wrongly invert axis order for Easting,Northing projected CRS --- .../wfs11_getfeatures_france_onefeature.txt | 2 +- src/fe/fe_spatial_ops.c | 2 +- src/ows/ows_bbox.c | 31 ++-- src/ows/ows_geobbox.c | 2 +- src/ows/ows_srs.c | 146 +++++++++++------- src/ows/ows_storage.c | 8 +- src/ows_api.h | 2 +- src/ows_struct.h | 25 ++- src/wfs/wfs_get_feature.c | 24 +-- src/wfs/wfs_request.c | 25 ++- 10 files changed, 163 insertions(+), 104 deletions(-) diff --git a/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt b/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt index 2b3c20de..cf71a6b4 100644 --- a/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt +++ b/demo/tests/expected/wfs11_getfeatures_france_onefeature.txt @@ -29,7 +29,7 @@ Content-Type: text/xml; subtype=gml/3.1.1 82 RHONE-ALPES 01 - 2092615 801150 2093190 800669 2095430 800688 2095795 800780 2096112 800589 2097190 800333 2098505 799095 2098838 799136 2100360 799690 2100395 799329 2100950 797715 2101330 797655 2102850 797410 2102788 797149 2102425 796755 2102785 796738 2103487 796612 2103892 795234 2104515 794905 2104359 794547 2102570 791555 2102760 791465 2104075 791935 2105023 791835 2105295 791670 2105555 790205 2105875 790035 2107116 789304 2107148 788617 2106760 788005 2106708 787670 2106990 786705 2107029 786350 2107335 785720 2108399 785562 2109486 786670 2109775 786930 2110010 787055 2110344 787208 2111056 787367 2113550 786900 2114260 786795 2114370 786830 2114751 786811 2116197 786384 2116940 786550 2117563 786560 2117860 786465 2119206 785956 2120474 787211 2120775 787415 2121475 787600 2121809 787536 2122743 787137 2123110 786610 2124100 786457 2124890 787138 2125160 787365 2125377 787545 2125830 787880 2126745 788198 2127075 788225 2128290 789130 2128585 789370 2129209 789790 2129525 789995 2131460 790445 2131793 790237 2132230 789585 2132742 788993 2133100 788830 2133655 788650 2134028 788638 2135142 788673 2136382 789501 2137110 789510 2138174 789596 2138520 789680 2139015 789845 2139590 790050 2140547 790594 2142011 790750 2142380 790740 2142716 790739 2143599 791139 2144456 791749 2144790 791860 2147049 792199 2147420 792285 2148815 792880 2150425 793615 2150782 793737 2152285 793650 2152660 793618 2153400 793480 2155103 794012 2155696 794347 2155980 794535 2156241 794686 2157025 795135 2159030 796115 2160314 796193 2160635 796250 2161408 796311 2161795 796335 2162102 796324 2163021 796316 2163470 796385 2163785 796495 2165380 797830 2165700 797970 2167362 797959 2167695 797910 2167835 797905 2169845 798850 2170117 798930 2170395 798980 2171035 799122 2171335 799255 2171435 799340 2171593 800295 2170924 800326 2170498 800757 2170754 801505 2171611 802043 2171760 802820 2171217 804846 2171380 805165 2170485 805338 2170210 805485 2168729 808352 2168520 808655 2168719 809605 2168735 809930 2170150 811710 2169640 813076 2170568 814292 2170640 814670 2171442 815189 2171075 816978 2172530 817045 2171719 818290 2171534 819798 2171205 819990 2170948 819753 2169812 820496 2169145 820305 2168648 820810 2167568 821023 2167190 821020 2167185 821753 2166355 822453 2166075 822690 2166394 823263 2166285 823585 2165476 824250 2165330 825284 2165160 825600 2165065 828440 2163119 829372 2162490 828470 2161655 828705 2161531 828395 2161519 827745 2161005 828485 2159908 830445 2159915 831525 2158958 832747 2158780 833030 2158494 833286 2158105 833885 2157807 833687 2157040 832940 2156696 832830 2155806 833866 2155445 833825 2155097 833752 2154750 833675 2153047 835995 2152675 835930 2151171 836194 2150780 836185 2150680 836190 2150149 836405 2150070 836690 2153840 837059 2154400 837545 2151187 838628 2150820 838735 2151192 840056 2151708 840530 2151840 840855 2151081 841371 2150965 841670 2150606 841591 2148479 841093 2148155 840525 2146631 840483 2145603 841576 2145394 841898 2145800 843750 2146033 843973 2145523 844372 2145410 844675 2146002 846805 2147688 848292 2148035 848440 2148733 848651 2148841 850029 2148775 850390 2149407 851184 2150710 851650 2150922 851857 2151180 851710 2152638 852195 2153465 853883 2153815 854050 2154550 854684 2153948 854950 2153605 855010 2152546 854706 2152522 856495 2151954 857425 2151680 857675 2151135 857795 2150917 860115 2149401 860522 2147845 860356 2145955 860868 2145690 861160 2145842 861499 2146060 861800 2146529 863931 2146675 864270 2146311 867954 2146245 868320 2146162 868625 2146145 868940 2146227 870819 2147047 871569 2147009 872099 2146655 872230 2148801 873891 2149145 874080 2148900 875215 2149908 875688 2151749 875836 2152270 876350 2151866 877249 2151825 877575 2152160 877751 2156500 879950 2157904 880577 2159490 882757 2160898 884049 2163565 885600 2164270 886165 2164140 886435 2163415 889069 2162493 889778 2162099 890867 2160395 893000 2160083 894101 2159465 894575 2158743 894622 2156340 893375 2155944 892712 2155185 892540 2153375 891600 2152677 891281 2152295 891245 2150917 891340 2149984 890292 2149695 890080 2147869 890987 2147615 891235 2147405 891560 2146272 891794 2145258 891337 2144570 890413 2145445 889185 2145356 888822 2144792 887853 2145110 887180 2143618 886092 2143730 885735 2143963 885432 2143997 884760 2143495 883760 2143280 883455 2142419 882749 2142149 882058 2141782 881989 2141448 880591 2140052 880422 2139555 879890 2139435 879855 2138192 882197 2137078 882019 2136753 881408 2134940 880810 2133632 880202 2132631 880177 2132205 879600 2132001 879351 2131755 878142 2131650 877449 2131962 876853 2130970 875845 2130628 875089 2130520 874800 2129464 874322 2128114 874925 2126982 874725 2126720 872900 2126810 872100 2127080 871837 2128513 870648 2128829 869972 2128495 869296 2127050 869435 2125650 868710 2125275 868663 2123780 868525 2123569 868760 2123070 868985 2121885 868525 2121591 868617 2120685 868760 2120349 868864 2119679 869034 2118760 868545 2118458 868661 2117935 868975 2117610 868911 2116295 869020 2115554 869215 2114005 870970 2113621 870979 2112855 870925 2111817 871130 2110485 870721 2110250 870455 2110165 870800 2109573 870344 2108843 870311 2107500 870897 2106390 870710 2106018 870615 2103410 869975 2101545 869465 2101232 869314 2099875 869040 2099512 868989 2098080 868710 2097320 868050 2096964 867940 2094425 867995 2094056 867975 2092595 867825 2092277 867736 2091670 867995 2091277 867979 2090131 867788 2088645 868170 2088380 867935 2088330 867643 2088110 867110 2087753 867246 2086334 867588 2085607 866723 2084278 866013 2084187 865294 2084575 864275 2084465 864000 2084328 863659 2084450 861885 2084109 861845 2083150 862185 2082820 862398 2082092 862694 2081333 862533 2079632 860925 2078870 860842 2078155 861160 2077808 861300 2077080 861210 2076787 860973 2076386 860337 2076155 858511 2075110 858205 2074811 858072 2074591 857453 2073960 857320 2073584 857265 2073221 856650 2073460 856355 2073797 856182 2074780 855610 2075941 854744 2077758 854474 2078730 852864 2079020 852620 2079386 852647 2079920 851685 2080021 851354 2079717 850753 2079917 850470 2080840 850320 2081131 850069 2082613 850023 2082507 850741 2081230 851509 2081554 852157 2082291 852073 2083206 850451 2083940 850375 2084174 850111 2084350 849805 2084500 848375 2084810 848150 2086215 847545 2086449 847281 2087620 845980 2087856 845694 2088564 844840 2091270 842895 2091898 842098 2092105 841825 2092424 841604 2093065 841170 2093318 840895 2094355 839825 2096198 839769 2096536 840798 2096910 840745 2097185 840580 2097470 840305 2098117 839320 2098880 839165 2099191 839016 2099825 838200 2100899 836342 2101165 836100 2101453 835840 2102554 834252 2102260 833175 2102031 833017 2101525 832785 2101162 832719 2100482 832433 2099710 831189 2098550 830330 2095140 829565 2094745 829550 2094389 829422 2093577 828638 2091920 827810 2091724 827523 2091325 826955 2091135 826653 2090510 825785 2090257 825487 2089517 824587 2089735 822700 2089692 822339 2090044 821748 2090765 821660 2091109 821459 2092110 820815 2092273 820470 2093148 819281 2093260 818215 2093406 817851 2093980 816405 2093715 815735 2092629 815844 2092497 815501 2094120 814830 2094025 814502 2093925 814175 2093907 813785 2093620 811510 2093793 811202 2093796 810503 2093390 809935 2093210 808612 2093030 808305 2092976 807965 2093490 807085 2093370 806759 2093210 806450 2092960 805480 2093105 804700 2093280 804426 2093210 803230 2093269 802864 2092615 801150 + 801150 2092615 800669 2093190 800688 2095430 800780 2095795 800589 2096112 800333 2097190 799095 2098505 799136 2098838 799690 2100360 799329 2100395 797715 2100950 797655 2101330 797410 2102850 797149 2102788 796755 2102425 796738 2102785 796612 2103487 795234 2103892 794905 2104515 794547 2104359 791555 2102570 791465 2102760 791935 2104075 791835 2105023 791670 2105295 790205 2105555 790035 2105875 789304 2107116 788617 2107148 788005 2106760 787670 2106708 786705 2106990 786350 2107029 785720 2107335 785562 2108399 786670 2109486 786930 2109775 787055 2110010 787208 2110344 787367 2111056 786900 2113550 786795 2114260 786830 2114370 786811 2114751 786384 2116197 786550 2116940 786560 2117563 786465 2117860 785956 2119206 787211 2120474 787415 2120775 787600 2121475 787536 2121809 787137 2122743 786610 2123110 786457 2124100 787138 2124890 787365 2125160 787545 2125377 787880 2125830 788198 2126745 788225 2127075 789130 2128290 789370 2128585 789790 2129209 789995 2129525 790445 2131460 790237 2131793 789585 2132230 788993 2132742 788830 2133100 788650 2133655 788638 2134028 788673 2135142 789501 2136382 789510 2137110 789596 2138174 789680 2138520 789845 2139015 790050 2139590 790594 2140547 790750 2142011 790740 2142380 790739 2142716 791139 2143599 791749 2144456 791860 2144790 792199 2147049 792285 2147420 792880 2148815 793615 2150425 793737 2150782 793650 2152285 793618 2152660 793480 2153400 794012 2155103 794347 2155696 794535 2155980 794686 2156241 795135 2157025 796115 2159030 796193 2160314 796250 2160635 796311 2161408 796335 2161795 796324 2162102 796316 2163021 796385 2163470 796495 2163785 797830 2165380 797970 2165700 797959 2167362 797910 2167695 797905 2167835 798850 2169845 798930 2170117 798980 2170395 799122 2171035 799255 2171335 799340 2171435 800295 2171593 800326 2170924 800757 2170498 801505 2170754 802043 2171611 802820 2171760 804846 2171217 805165 2171380 805338 2170485 805485 2170210 808352 2168729 808655 2168520 809605 2168719 809930 2168735 811710 2170150 813076 2169640 814292 2170568 814670 2170640 815189 2171442 816978 2171075 817045 2172530 818290 2171719 819798 2171534 819990 2171205 819753 2170948 820496 2169812 820305 2169145 820810 2168648 821023 2167568 821020 2167190 821753 2167185 822453 2166355 822690 2166075 823263 2166394 823585 2166285 824250 2165476 825284 2165330 825600 2165160 828440 2165065 829372 2163119 828470 2162490 828705 2161655 828395 2161531 827745 2161519 828485 2161005 830445 2159908 831525 2159915 832747 2158958 833030 2158780 833286 2158494 833885 2158105 833687 2157807 832940 2157040 832830 2156696 833866 2155806 833825 2155445 833752 2155097 833675 2154750 835995 2153047 835930 2152675 836194 2151171 836185 2150780 836190 2150680 836405 2150149 836690 2150070 837059 2153840 837545 2154400 838628 2151187 838735 2150820 840056 2151192 840530 2151708 840855 2151840 841371 2151081 841670 2150965 841591 2150606 841093 2148479 840525 2148155 840483 2146631 841576 2145603 841898 2145394 843750 2145800 843973 2146033 844372 2145523 844675 2145410 846805 2146002 848292 2147688 848440 2148035 848651 2148733 850029 2148841 850390 2148775 851184 2149407 851650 2150710 851857 2150922 851710 2151180 852195 2152638 853883 2153465 854050 2153815 854684 2154550 854950 2153948 855010 2153605 854706 2152546 856495 2152522 857425 2151954 857675 2151680 857795 2151135 860115 2150917 860522 2149401 860356 2147845 860868 2145955 861160 2145690 861499 2145842 861800 2146060 863931 2146529 864270 2146675 867954 2146311 868320 2146245 868625 2146162 868940 2146145 870819 2146227 871569 2147047 872099 2147009 872230 2146655 873891 2148801 874080 2149145 875215 2148900 875688 2149908 875836 2151749 876350 2152270 877249 2151866 877575 2151825 877751 2152160 879950 2156500 880577 2157904 882757 2159490 884049 2160898 885600 2163565 886165 2164270 886435 2164140 889069 2163415 889778 2162493 890867 2162099 893000 2160395 894101 2160083 894575 2159465 894622 2158743 893375 2156340 892712 2155944 892540 2155185 891600 2153375 891281 2152677 891245 2152295 891340 2150917 890292 2149984 890080 2149695 890987 2147869 891235 2147615 891560 2147405 891794 2146272 891337 2145258 890413 2144570 889185 2145445 888822 2145356 887853 2144792 887180 2145110 886092 2143618 885735 2143730 885432 2143963 884760 2143997 883760 2143495 883455 2143280 882749 2142419 882058 2142149 881989 2141782 880591 2141448 880422 2140052 879890 2139555 879855 2139435 882197 2138192 882019 2137078 881408 2136753 880810 2134940 880202 2133632 880177 2132631 879600 2132205 879351 2132001 878142 2131755 877449 2131650 876853 2131962 875845 2130970 875089 2130628 874800 2130520 874322 2129464 874925 2128114 874725 2126982 872900 2126720 872100 2126810 871837 2127080 870648 2128513 869972 2128829 869296 2128495 869435 2127050 868710 2125650 868663 2125275 868525 2123780 868760 2123569 868985 2123070 868525 2121885 868617 2121591 868760 2120685 868864 2120349 869034 2119679 868545 2118760 868661 2118458 868975 2117935 868911 2117610 869020 2116295 869215 2115554 870970 2114005 870979 2113621 870925 2112855 871130 2111817 870721 2110485 870455 2110250 870800 2110165 870344 2109573 870311 2108843 870897 2107500 870710 2106390 870615 2106018 869975 2103410 869465 2101545 869314 2101232 869040 2099875 868989 2099512 868710 2098080 868050 2097320 867940 2096964 867995 2094425 867975 2094056 867825 2092595 867736 2092277 867995 2091670 867979 2091277 867788 2090131 868170 2088645 867935 2088380 867643 2088330 867110 2088110 867246 2087753 867588 2086334 866723 2085607 866013 2084278 865294 2084187 864275 2084575 864000 2084465 863659 2084328 861885 2084450 861845 2084109 862185 2083150 862398 2082820 862694 2082092 862533 2081333 860925 2079632 860842 2078870 861160 2078155 861300 2077808 861210 2077080 860973 2076787 860337 2076386 858511 2076155 858205 2075110 858072 2074811 857453 2074591 857320 2073960 857265 2073584 856650 2073221 856355 2073460 856182 2073797 855610 2074780 854744 2075941 854474 2077758 852864 2078730 852620 2079020 852647 2079386 851685 2079920 851354 2080021 850753 2079717 850470 2079917 850320 2080840 850069 2081131 850023 2082613 850741 2082507 851509 2081230 852157 2081554 852073 2082291 850451 2083206 850375 2083940 850111 2084174 849805 2084350 848375 2084500 848150 2084810 847545 2086215 847281 2086449 845980 2087620 845694 2087856 844840 2088564 842895 2091270 842098 2091898 841825 2092105 841604 2092424 841170 2093065 840895 2093318 839825 2094355 839769 2096198 840798 2096536 840745 2096910 840580 2097185 840305 2097470 839320 2098117 839165 2098880 839016 2099191 838200 2099825 836342 2100899 836100 2101165 835840 2101453 834252 2102554 833175 2102260 833017 2102031 832785 2101525 832719 2101162 832433 2100482 831189 2099710 830330 2098550 829565 2095140 829550 2094745 829422 2094389 828638 2093577 827810 2091920 827523 2091724 826955 2091325 826653 2091135 825785 2090510 825487 2090257 824587 2089517 822700 2089735 822339 2089692 821748 2090044 821660 2090765 821459 2091109 820815 2092110 820470 2092273 819281 2093148 818215 2093260 817851 2093406 816405 2093980 815735 2093715 815844 2092629 815501 2092497 814830 2094120 814502 2094025 814175 2093925 813785 2093907 811510 2093620 811202 2093793 810503 2093796 809935 2093390 808612 2093210 808305 2093030 807965 2092976 807085 2093490 806759 2093370 806450 2093210 805480 2092960 804700 2093105 804426 2093280 803230 2093210 802864 2093269 801150 2092615 diff --git a/src/fe/fe_spatial_ops.c b/src/fe/fe_spatial_ops.c index e8b1ab98..6e4f10b3 100644 --- a/src/fe/fe_spatial_ops.c +++ b/src/fe/fe_spatial_ops.c @@ -187,7 +187,7 @@ buffer *fe_envelope(ows * o, buffer * typename, filter_encoding * fe, buffer *en /* return the polygon's coordinates matching the bbox */ bbox = ows_bbox_init(); - if (s && s->is_reverse_axis) { + if (s && s->honours_authority_axis_order && !s->is_axis_order_gis_friendly) { ret = ows_bbox_set(o, bbox, atof(coord_min->first->next->value->buf), atof(coord_min->first->value->buf), diff --git a/src/ows/ows_bbox.c b/src/ows/ows_bbox.c index a0090638..70a8bf9b 100644 --- a/src/ows/ows_bbox.c +++ b/src/ows/ows_bbox.c @@ -93,14 +93,13 @@ bool ows_bbox_set(ows * o, ows_bbox * b, double xmin, double ymin, double xmax, /* * Set a given bbox from a string like 'xmin,ymin,xmax,ymax' */ -bool ows_bbox_set_from_str(ows * o, ows_bbox * bb, const char *str, int srid) +bool ows_bbox_set_from_str(ows * o, ows_bbox * bb, const char *str, int srid, + bool honours_authority_axis_order_if_no_explicit_srs) { double xmin, ymin, xmax, ymax; - ows_srs *s; buffer *b; list *l; - int srs = srid; - bool ret_srs = true; + bool ret; assert(o && bb && str); @@ -123,16 +122,26 @@ bool ows_bbox_set_from_str(ows * o, ows_bbox * bb, const char *str, int srid) /* srs is optional since WFS 1.1 */ if (l->size == 5) { - s = ows_srs_init(); - ret_srs = ows_srs_set_from_srsname(o, s, l->last->value->buf); - srs = s->srid; - ows_srs_free(s); + ows_srs* s = ows_srs_init(); + ret = ows_srs_set_from_srsname(o, s, l->last->value->buf); + if (ret) + { + srid = s->srid; + ret = ows_bbox_set(o, bb, xmin, ymin, xmax, ymax, srid); + ows_srs_free(bb->srs); + bb->srs = s; + } else { + ows_srs_free(s); + } + + } else { + ret = ows_bbox_set(o, bb, xmin, ymin, xmax, ymax, srid); + bb->srs->honours_authority_axis_order = honours_authority_axis_order_if_no_explicit_srs; } list_free(l); - if(!ret_srs) return false; - return ows_bbox_set(o, bb, xmin, ymin, xmax, ymax, srs); + return ret; } @@ -279,7 +288,7 @@ void ows_bbox_to_query(ows *o, ows_bbox *bbox, buffer *query) assert(o && bbox && query); - if (bbox->srs->is_reverse_axis) { + if (bbox->srs->honours_authority_axis_order && !bbox->srs->is_axis_order_gis_friendly) { x1 = bbox->ymin; y1 = bbox->xmin; x2 = bbox->ymax; diff --git a/src/ows/ows_geobbox.c b/src/ows/ows_geobbox.c index fe4e7b5b..6e0619cc 100644 --- a/src/ows/ows_geobbox.c +++ b/src/ows/ows_geobbox.c @@ -139,7 +139,7 @@ ows_geobbox *ows_geobbox_set_from_str(ows * o, ows_geobbox * g, char *str) assert(str); bb = ows_bbox_init(); - ows_bbox_set_from_str(o, bb, str, 4326); + ows_bbox_set_from_str(o, bb, str, 4326, false); ows_geobbox_set_from_bbox(o, g, bb); ows_bbox_free(bb); diff --git a/src/ows/ows_srs.c b/src/ows/ows_srs.c index 94410d27..6daea4ca 100644 --- a/src/ows/ows_srs.c +++ b/src/ows/ows_srs.c @@ -44,9 +44,9 @@ ows_srs *ows_srs_init() c->srid = -1; c->auth_name = buffer_init(); c->auth_srid = 0; - c->is_degree = true; - c->is_reverse_axis = false; - c->is_eastern_axis = false; + c->is_geographic = true; + c->honours_authority_axis_order = false; + c->is_axis_order_gis_friendly = false; c->is_long = false; return c; @@ -61,9 +61,9 @@ ows_srs *ows_srs_copy(ows_srs * d, ows_srs * s) d->srid = s->srid; buffer_copy(d->auth_name, s->auth_name); d->auth_srid = s->auth_srid; - d->is_degree = s->is_degree; - d->is_reverse_axis = s->is_reverse_axis; - d->is_eastern_axis = s->is_eastern_axis; + d->is_geographic = s->is_geographic; + d->honours_authority_axis_order = s->honours_authority_axis_order; + d->is_axis_order_gis_friendly = s->is_axis_order_gis_friendly; d->is_long = s->is_long; return d; @@ -98,18 +98,20 @@ void ows_srs_flush(ows_srs * c, FILE * output) fprintf(output, " auth_name: %s\n", c->auth_name->buf); fprintf(output, " auth_srid: %i\n", c->auth_srid); - if (c->is_degree) fprintf(output, " is_degree: true\n]\n"); - else fprintf(output, " is_degree: false\n]\n"); + if (c->is_geographic) + fprintf(output, " is_geographic: true\n]\n"); + else + fprintf(output, " is_geographic: false\n]\n"); - if (c->is_reverse_axis) - fprintf(output, " is_reverse_axis: true\n]\n"); + if (c->honours_authority_axis_order) + fprintf(output, " honours_authority_axis_order: true\n]\n"); else - fprintf(output, " is_reverse_axis: false\n]\n"); + fprintf(output, " honours_authority_axis_order: false\n]\n"); - if (c->is_eastern_axis) - fprintf(output, " is_eastern_axis: true\n]\n"); + if (c->is_axis_order_gis_friendly) + fprintf(output, " is_axis_order_gis_friendly: true\n]\n"); else - fprintf(output, " is_eastern_axis: false\n]\n"); + fprintf(output, " is_axis_order_gis_friendly: false\n]\n"); if (c->is_long) fprintf(output, " is_long: true\n]\n"); @@ -118,24 +120,71 @@ void ows_srs_flush(ows_srs * c, FILE * output) } #endif +/* + * Set s->is_geographic and s->is_axis_order_gis_friendly + * from srtext. + */ +static void ows_srs_set_is_geographic_and_is_axis_order_gis_friendly_from_def( + ows_srs* s, const char* proj4text, const char* srtext) +{ + /* Use srtext in priority */ + if (srtext && srtext[0] != '\0') + { + char* srtext_horizontal = (char*) malloc(strlen(srtext) + 1); + char* ptr; + strcpy(srtext_horizontal, srtext); + + /* Remove the VERT_CS part if we are in a COMPD_CS */ + ptr = strstr(srtext_horizontal, ",VERT_CS["); + if (ptr) + *ptr = '\0'; + + s->is_axis_order_gis_friendly = true; + s->is_geographic = strstr(srtext, "PROJCS[") == NULL && + strstr(srtext, "GEOCCS[") == NULL; + + if( strstr(srtext_horizontal, "AXIS[") == NULL ) + { + /* If there is no axis definition, then due to how GDAL < 3 + * generated the WKT, this means that the axis order is not + * GIS friendly */ + s->is_axis_order_gis_friendly = false; + } + /* In case PostGIS incorporates full WKT output some day... */ + else if( strstr(srtext_horizontal, + "AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]") != NULL ) + { + s->is_axis_order_gis_friendly = false; + } + + free(srtext_horizontal); + } + else if( proj4text && proj4text[0] != '\0' ) + { + s->is_geographic = strstr(proj4text, "+units=m") == NULL; + /* This will be wrong for a number of projected CRS ! */ + s->is_axis_order_gis_friendly = !s->is_geographic; + } +} /* * Set projection value into srs structure */ -bool ows_srs_set(ows * o, ows_srs * c, const buffer * auth_name, int auth_srid) +bool ows_srs_set(ows * o, ows_srs * s, const buffer * auth_name, int auth_srid) { PGresult *res; buffer *sql; + const char* proj4text; + const char* srtext; assert(o); - assert(c); + assert(s); assert(o->pg); assert(auth_name); sql = buffer_init(); - buffer_add_str(sql, "SELECT srid, position('+units=m ' in proj4text)"); - buffer_add_str(sql, ", (position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Northing\",NORTH]]' in srtext))"); - buffer_add_str(sql, " FROM spatial_ref_sys WHERE auth_name='"); + buffer_add_str(sql, "SELECT srid, proj4text, srtext " + "FROM spatial_ref_sys WHERE auth_name='"); buffer_copy(sql, auth_name); buffer_add_str(sql, "' AND auth_srid="); buffer_add_int(sql, auth_srid); @@ -149,21 +198,15 @@ bool ows_srs_set(ows * o, ows_srs * c, const buffer * auth_name, int auth_srid) return false; } - buffer_empty(c->auth_name); - buffer_copy(c->auth_name, auth_name); - c->auth_srid = auth_srid; - - c->srid = atoi(PQgetvalue(res, 0, 0)); + buffer_empty(s->auth_name); + buffer_copy(s->auth_name, auth_name); + s->auth_srid = auth_srid; - /* Such a way to know if units is meter or degree */ - if (atoi(PQgetvalue(res, 0, 1)) == 0) - c->is_degree = true; - else - c->is_degree = false; + s->srid = atoi(PQgetvalue(res, 0, 0)); - /* Is easting-northing SRID ? */ - if (atoi(PQgetvalue(res, 0, 2)) != 0) - c->is_eastern_axis = true; + proj4text = PQgetvalue(res, 0, 1); + srtext = PQgetvalue(res, 0, 2); + ows_srs_set_is_geographic_and_is_axis_order_gis_friendly_from_def(s, proj4text, srtext); PQclear(res); return true; @@ -183,9 +226,8 @@ bool ows_srs_set_geobbox(ows * o, ows_srs * s) buffer_empty(s->auth_name); buffer_add_str(s->auth_name, "EPSG"); s->auth_srid = 4326; - s->is_degree = true; - s->is_reverse_axis = false; - s->is_eastern_axis = false; + s->is_geographic = true; + s->is_axis_order_gis_friendly = false; return true; } @@ -198,6 +240,8 @@ bool ows_srs_set_from_srid(ows * o, ows_srs * s, int srid) { PGresult *res; buffer *sql; + const char *proj4text; + const char *srtext; assert(o); assert(s); @@ -206,18 +250,16 @@ bool ows_srs_set_from_srid(ows * o, ows_srs * s, int srid) s->srid = -1; buffer_empty(s->auth_name); s->auth_srid = 0; - s->is_degree = true; - s->is_reverse_axis = false; - s->is_eastern_axis = false; + s->is_geographic = true; + s->honours_authority_axis_order = false; + s->is_axis_order_gis_friendly = false; return true; } sql = buffer_init(); - buffer_add_str(sql, "SELECT auth_name, auth_srid, "); - buffer_add_str(sql, "position('+units=m ' in proj4text), "); - buffer_add_str(sql, "(position('AXIS[\"X\",NORTH]]' in srtext) + position('AXIS[\"Northing\",NORTH]]' in srtext)) "); - buffer_add_str(sql, "FROM spatial_ref_sys WHERE srid = '"); + buffer_add_str(sql, "SELECT auth_name, auth_srid, proj4text, srtext " + "FROM spatial_ref_sys WHERE srid = '"); buffer_add_int(sql, srid); buffer_add_str(sql, "'"); @@ -234,15 +276,9 @@ bool ows_srs_set_from_srid(ows * o, ows_srs * s, int srid) s->auth_srid = atoi(PQgetvalue(res, 0, 1)); s->srid = srid; - /* Such a way to know if units is meter or degree */ - if (atoi(PQgetvalue(res, 0, 2)) == 0) - s->is_degree = true; - else - s->is_degree = false; - - /* Is easting-northing SRID ? */ - if (atoi(PQgetvalue(res, 0, 3)) != 0) - s->is_eastern_axis = true; + proj4text = PQgetvalue(res, 0, 2); + srtext = PQgetvalue(res, 0, 3); + ows_srs_set_is_geographic_and_is_axis_order_gis_friendly_from_def(s, proj4text, srtext); PQclear(res); return true; @@ -283,18 +319,18 @@ bool ows_srs_set_from_srsname(ows * o, ows_srs * s, const char *srsname) if (!strncmp((char *) srsname, "EPSG:", 5) || !strncmp((char *) srsname, "spatialreferencing.org", 22)) { sep = ':'; - s->is_reverse_axis = false; + s->honours_authority_axis_order = false; s->is_long = false; } else if (!strncmp((char *) srsname, "urn:ogc:def:crs:EPSG:", 21) || !strncmp((char *) srsname, "urn:x-ogc:def:crs:EPSG:", 23) || !strncmp((char *) srsname, "urn:EPSG:geographicCRS:", 23)) { sep = ':'; - s->is_reverse_axis = true; + s->honours_authority_axis_order = true; } else if (!strncmp((char *) srsname, "http://www.opengis.net/gml/srs/epsg.xml#", 40)) { sep = '#'; - s->is_reverse_axis = false; + s->honours_authority_axis_order = false; } else return false; /* FIXME must we really not allow other value ? */ /* Retrieve from last separator to the end of srsName string */ @@ -319,7 +355,7 @@ bool ows_srs_meter_units(ows * o, buffer * layer_name) for (ln = o->layers->first ; ln ; ln = ln->next) if (ln->layer->name && ln->layer->storage && !strcmp(ln->layer->name->buf, layer_name->buf)) - return !ln->layer->storage->is_degree; + return !ln->layer->storage->is_geographic; assert(0); /* Should not happen */ return false; diff --git a/src/ows/ows_storage.c b/src/ows/ows_storage.c index 58986451..17cacfbf 100644 --- a/src/ows/ows_storage.c +++ b/src/ows/ows_storage.c @@ -39,7 +39,7 @@ ows_layer_storage * ows_layer_storage_init() storage->schema = buffer_init(); storage->srid = -1; storage->geom_columns = list_init(); - storage->is_degree = true; + storage->is_geographic = true; storage->table = buffer_init(); storage->pkey = NULL; storage->pkey_sequence = NULL; @@ -95,7 +95,7 @@ void ows_layer_storage_flush(ows_layer_storage * storage, FILE * output) } fprintf(output, "srid: %i\n", storage->srid); - fprintf(output, "is_degree: %i\n", storage->is_degree?1:0); + fprintf(output, "is_geographic: %i\n", storage->is_geographic?1:0); if (storage->pkey) { fprintf(output, "pkey: "); @@ -461,9 +461,9 @@ static void ows_layer_storage_fill(ows * o, ows_layer * l, bool is_geom) buffer_free(sql); if (PQntuples(res) != 1) - l->storage->is_degree = true; + l->storage->is_geographic = true; else - l->storage->is_degree = false; + l->storage->is_geographic = false; PQclear(res); diff --git a/src/ows_api.h b/src/ows_api.h index 03ea2674..f8878448 100644 --- a/src/ows_api.h +++ b/src/ows_api.h @@ -123,7 +123,7 @@ void ows_bbox_free (ows_bbox * b); ows_bbox *ows_bbox_init (); bool ows_bbox_set (ows * o, ows_bbox * b, double xmin, double ymin, double xmax, double ymax, int srid); bool ows_bbox_set_from_geobbox (ows * o, ows_bbox * bb, ows_geobbox * geo); -bool ows_bbox_set_from_str (ows * o, ows_bbox * bb, const char *str, int srid); +bool ows_bbox_set_from_str (ows * o, ows_bbox * bb, const char *str, int srid, bool honours_authority_axis_order_if_no_explicit_srs); bool ows_bbox_transform (ows * o, ows_bbox * bb, int srid); void ows_bbox_to_query(ows * o, ows_bbox *bbox, buffer *query); void ows_contact_flush (ows_contact * contact, FILE * output); diff --git a/src/ows_struct.h b/src/ows_struct.h index 025c9a99..6b1d8818 100644 --- a/src/ows_struct.h +++ b/src/ows_struct.h @@ -108,7 +108,9 @@ typedef struct Ows_layer_storage { buffer * pkey_sequence; buffer * pkey_default; int pkey_column_number; - bool is_degree; + bool is_geographic; /* true for a geographic CRS (or a compound CRS + whose base is geographic), false for a projected + CRS (or a compound CRS whose base is projected) */ array * attributes; } ows_layer_storage; @@ -116,10 +118,23 @@ typedef struct Ows_srs { int srid; buffer * auth_name; int auth_srid; - bool is_degree; - bool is_reverse_axis; - bool is_eastern_axis; - bool is_long; + bool is_geographic; /* true for a geographic CRS (or a compound + CRS whose base is geographic), false for + a projected CRS (or a compound CRS whose + base is projected) */ + bool is_axis_order_gis_friendly; /* true for a CRS whose axis order is + typically easting, northing (e.g most + projected CRS, such as EPSG:32631) + false for example for EPSG:4326 (WGS 84), + EPSG:2393 (KKJ / Finland Uniform Coordinate System) */ + + /* The two below fields are not properties of the SRS, but of its context + * of use. */ + bool honours_authority_axis_order; /* true for a context where the axis order + as defined by the authority should be + respected */ + bool is_long; /* true for a context where the srsname must + be exported as a long URN */ } ows_srs; diff --git a/src/wfs/wfs_get_feature.c b/src/wfs/wfs_get_feature.c index 5d4078b8..dcb1a0e4 100644 --- a/src/wfs/wfs_get_feature.c +++ b/src/wfs/wfs_get_feature.c @@ -43,7 +43,7 @@ static void wfs_gml_bounded_by(ows * o, wfs_request * wr, double xmin, double ym assert(wr); assert(srs); - if (srs->is_degree) precision = o->degree_precision; + if (srs->is_geographic) precision = o->degree_precision; else precision = o->meter_precision; if (!srs->srid || srs->srid == -1 || (xmin == ymin && xmax == ymax && xmin == xmax)) { @@ -76,7 +76,7 @@ static void wfs_gml_bounded_by(ows * o, wfs_request * wr, double xmin, double ym else fprintf(o->output, "EPSG:"); fprintf(o->output, "%d\">", srs->srid); - if (srs->is_reverse_axis && !srs->is_eastern_axis && srs->is_long) { + if (srs->honours_authority_axis_order && !srs->is_axis_order_gis_friendly) { if (fabs(xmin) > OWS_MAX_DOUBLE || fabs(ymin) > OWS_MAX_DOUBLE || fabs(xmax) > OWS_MAX_DOUBLE || fabs(ymax) > OWS_MAX_DOUBLE) { fprintf(o->output, "%g %g", ymin, xmin); @@ -457,15 +457,18 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer buffer_add_str(select, "\","); } - if ((wr->srs && !wr->srs->is_degree) || + if ((wr->srs && !wr->srs->is_geographic) || (!wr->srs && ows_srs_meter_units(o, layer_name))) buffer_add_int(select, o->meter_precision); else buffer_add_int(select, o->degree_precision); gml_opt = 0; /* Short SRS */ - if (wr->srs && wr->srs->is_long) gml_opt += 1; /* FIXME really ? */ - if (wr->srs && wr->srs->is_eastern_axis) gml_opt += 16; + if (wr->srs && wr->srs->is_long) gml_opt += 1; + /* This will be actually without effect since PostGIS only honours flag = 16 for GML 3 */ + if (wr->srs && + wr->srs->honours_authority_axis_order && + !wr->srs->is_axis_order_gis_friendly ) gml_opt += 16; if (gml_boundedby) gml_opt += 32; buffer_add_str(select, ","); @@ -496,13 +499,14 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer if (wr->srs && wr->srs->is_long) gml_opt += 1; /* Long SRS */ if (gml_boundedby) gml_opt += 32; - if ((wr->srs && !wr->srs->is_degree) || (!wr->srs && ows_srs_meter_units(o, layer_name))) { + if ((wr->srs && !wr->srs->is_geographic) || (!wr->srs && ows_srs_meter_units(o, layer_name))) { buffer_add_int(select, o->meter_precision); - if (wr->srs && !wr->srs->is_eastern_axis && wr->srs->is_long) gml_opt += 16; } else { buffer_add_int(select, o->degree_precision); - if (wr->srs && !wr->srs->is_eastern_axis && wr->srs->is_long) gml_opt += 16; } + if (wr->srs && + wr->srs->honours_authority_axis_order && + !wr->srs->is_axis_order_gis_friendly ) gml_opt += 16; buffer_add_str(select, ", "); buffer_add_int(select, gml_opt); @@ -526,7 +530,7 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer buffer_add_str(select, "\","); } - if ((wr->srs && !wr->srs->is_degree) || + if ((wr->srs && !wr->srs->is_geographic) || (!wr->srs && ows_srs_meter_units(o, layer_name))) buffer_add_int(select, o->meter_precision); else @@ -738,6 +742,8 @@ static mlist *wfs_retrieve_sql_request_list(ows * o, wfs_request * wr) buffer_copy(sql, where); + /* fprintf(stderr, "sql = %s\n", sql->buf); */ + list_add(sql_req, sql); list_add(where_list, where); list_add_by_copy(from_list, layer_uri); diff --git a/src/wfs/wfs_request.c b/src/wfs/wfs_request.c index 1e935be6..8b69d3e2 100644 --- a/src/wfs/wfs_request.c +++ b/src/wfs/wfs_request.c @@ -399,15 +399,9 @@ static void wfs_request_check_srs(ows * o, wfs_request * wr, list * layer_name) return; } - if ((wr->format == WFS_GML311 || wr->format == WFS_GML321) && wr->srs->is_degree) { - wr->srs->is_reverse_axis = true; - wr->srs->is_long = true; - } else if (wr->format == WFS_GML311 || wr->format == WFS_GML321) { - wr->srs->is_long = true; - } else if (ows_version_get(o->request->version) == 110 && wr->srs->is_degree) { - wr->srs->is_reverse_axis = true; - wr->srs->is_long = true; - } else if (ows_version_get(o->request->version) == 110) { + if (wr->format == WFS_GML311 || wr->format == WFS_GML321 || + ows_version_get(o->request->version) == 110) { + wr->srs->honours_authority_axis_order = true; wr->srs->is_long = true; } @@ -429,6 +423,7 @@ static void wfs_request_check_bbox(ows * o, wfs_request * wr, list * layer_name) { buffer *b; int srid = 4326; /* Default srid if not srs is provided since WFS 1.1.0 */ + bool honours_authority_axis_order_if_no_explicit_srs = false; assert(o && wr && layer_name && wr->srs); @@ -437,18 +432,16 @@ static void wfs_request_check_bbox(ows * o, wfs_request * wr, list * layer_name) b = array_get(o->cgi, "bbox"); wr->bbox = ows_bbox_init(); - if (ows_version_get(o->request->version) == 100) srid = wr->srs->srid; + if (ows_version_get(o->request->version) == 100) + srid = wr->srs->srid; + else + honours_authority_axis_order_if_no_explicit_srs = true; - if (!ows_bbox_set_from_str(o, wr->bbox, b->buf, srid)) { + if (!ows_bbox_set_from_str(o, wr->bbox, b->buf, srid, honours_authority_axis_order_if_no_explicit_srs)) { ows_error(o, OWS_ERROR_INVALID_PARAMETER_VALUE, "Bad parameters for Bbox, must be Xmin,Ymin,Xmax,Ymax[,crsuri]", "NULL"); return; } - - /* related to BBOX with crsuri and srsName issue like: - bbox=34.94,-10.52,71.96,32.19,urn:ogc:def:crs:EPSG::4326 - */ - if (wr->srs->is_reverse_axis) wr->bbox->srs->is_reverse_axis = true; } From 63136ab48a545cbd7f167285cf1d139e1d30d360 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Nov 2020 01:05:19 +0100 Subject: [PATCH 16/61] Add tests for GetFeature BBOX and SRSNAME --- .../wfs10_getfeatures_france_bbox.txt | 28 +++++++++++++++++++ ...fs11_getfeatures_france_bboxwithcrsuri.txt | 27 ++++++++++++++++++ ...features_france_bboxwithcrsuri_srsname.txt | 27 ++++++++++++++++++ ...1_getfeatures_france_bboxwithoutcrsuri.txt | 27 ++++++++++++++++++ .../input/wfs10_getfeatures_france_bbox.txt | 1 + ...fs11_getfeatures_france_bboxwithcrsuri.txt | 1 + ...features_france_bboxwithcrsuri_srsname.txt | 1 + ...1_getfeatures_france_bboxwithoutcrsuri.txt | 1 + 8 files changed, 113 insertions(+) create mode 100644 demo/tests/expected/wfs10_getfeatures_france_bbox.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_france_bboxwithoutcrsuri.txt create mode 100644 demo/tests/input/wfs10_getfeatures_france_bbox.txt create mode 100644 demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri.txt create mode 100644 demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt create mode 100644 demo/tests/input/wfs11_getfeatures_france_bboxwithoutcrsuri.txt diff --git a/demo/tests/expected/wfs10_getfeatures_france_bbox.txt b/demo/tests/expected/wfs10_getfeatures_france_bbox.txt new file mode 100644 index 00000000..55aee101 --- /dev/null +++ b/demo/tests/expected/wfs10_getfeatures_france_bbox.txt @@ -0,0 +1,28 @@ +Content-Type: text/xml; subtype=gml/2.1.2 + + + +missing + + + France + FRA + Europe + 9.219166,41.366379 9.0975,41.392769 9.080555,41.474709 8.882221,41.506649 8.779999,41.588871 8.794722,41.632488 8.913887,41.67638 8.878887,41.69804 8.680275,41.751659 8.724722,41.776932 8.802219,41.894428 8.754164,41.93166 8.614721,41.89777 8.589441,41.966099 8.658609,41.978039 8.726387,42.040821 8.696665,42.10944 8.561943,42.14888 8.572777,42.214161 8.641109,42.25499 8.688055,42.27026 8.612221,42.349991 8.555832,42.376659 8.672222,42.461929 8.663332,42.507771 8.937498,42.636379 9.053053,42.6586 9.083887,42.710819 9.210554,42.73082 9.290833,42.673321 9.34111,42.73415 9.320833,42.894989 9.346388,42.958881 9.344721,43.00082 9.430277,43.005821 9.465832,42.927212 9.489443,42.81443 9.459999,42.6036 9.502857,42.56636 9.497221,42.600819 9.543055,42.429989 9.508055,42.06554 9.406944,41.906651 9.348888,41.618881 9.282776,41.607769 9.355276,41.59388 9.25083,41.41193 9.219166,41.3663792.901285,50.697048 3.035277,50.773869 3.113055,50.79332 3.193333,50.741371 3.281388,50.594151 3.28,50.538319 3.367222,50.495541 3.602222,50.497211 3.668889,50.444149 3.671944,50.346371 3.725277,50.313599 3.763611,50.351929 4.090833,50.31443 4.21611,50.26527 4.137777,50.13776 4.226388,50.0811 4.15,49.98637 4.168332,49.981369 4.458333,49.938591 4.67361,49.99638 4.7575,50.129429 4.876388,50.15498 4.851943,50.07943 4.800832,49.97776 4.88111,49.9147 4.858054,49.796379 5.097777,49.768589 5.216944,49.69054 5.276111,49.698589 5.329721,49.659981 5.307221,49.63081 5.423332,49.60915 5.473055,49.5061 5.705208,49.535229 5.783038,49.527271 5.963333,49.488319 5.981388,49.448318 6.165277,49.504711 6.362221,49.45998 6.493888,49.447201 6.594722,49.363041 6.589722,49.320271 6.78722,49.162479 6.838888,49.15498 6.847499,49.21526 7.026666,49.188869 7.038332,49.11832 7.088332,49.125259 7.361388,49.14777 7.375277,49.171928 7.486943,49.16415 7.539999,49.088871 7.74111,49.04166 7.93861,49.04887 8.192221,48.968868 8.227394,48.963711 8.133333,48.88554 7.921515,48.690029 7.801943,48.59248 7.807499,48.513321 7.771666,48.49165 7.750833,48.336651 7.604999,48.156929 7.571666,48.037209 7.615832,48.002769 7.513333,47.686932 7.588799,47.58456 7.521388,47.525822 7.452777,47.469978 7.39561,47.439671 7.178332,47.44582 7.198054,47.495258 6.990555,47.497211 7.007777,47.45499 6.978333,47.444149 6.88111,47.35693 7.023055,47.371651 7.061665,47.345539 7.010833,47.30526 6.948332,47.291931 6.694443,47.068321 6.702777,47.038601 6.587221,46.987759 6.434721,46.926929 6.452777,46.774429 6.325022,46.704479 6.129999,46.593319 6.078055,46.460819 6.124443,46.40192 6.114444,46.257771 6.060832,46.250542 5.96611,46.205261 6,46.17416 5.965833,46.14027 6.152222,46.153591 6.305554,46.252491 6.242221,46.297771 6.243931,46.322392 6.246387,46.357769 6.328333,46.406929 6.633611,46.464149 6.79611,46.432491 6.808887,46.411091 6.804937,46.405499 6.767499,46.352489 6.844443,46.27137 6.795277,46.217758 6.788054,46.142208 6.884444,46.126091 6.871387,46.051929 6.929166,46.065262 7.038747,45.931721 6.808887,45.831379 6.799166,45.780819 6.824166,45.714989 6.990832,45.63998 6.999443,45.518318 7.181388,45.411652 7.133054,45.355549 7.122776,45.301929 6.850277,45.136101 6.760833,45.16832 6.620172,45.110661 6.746666,45.02026 6.743332,44.947762 7.009999,44.848591 7.068889,44.689152 7.000833,44.69915 6.950832,44.6647 6.960278,44.628868 6.852777,44.540821 6.857222,44.507771 6.934999,44.443039 6.88611,44.415821 6.935832,44.323318 7.279444,44.156651 7.672776,44.182758 7.704166,44.072208 7.492221,43.869431 7.534765,43.783451 7.457388,43.758652 7.4407,43.757824 7.4383,43.7603 7.4358,43.7631 7.4342,43.766102 7.4325,43.769199 7.4294,43.7714 7.4247,43.773102 7.42,43.772499 7.4161,43.770599 7.4128,43.768299 7.4097,43.7658 7.4064,43.763599 7.4031,43.761398 7.4003,43.758598 7.3972,43.7561 7.3939,43.753899 7.3906,43.7514 7.3878,43.7486 7.3864,43.745602 7.3864,43.741901 7.3883,43.738899 7.39,43.735802 7.3908,43.732201 7.391187,43.728031 7.349536,43.721825 7.345833,43.720539 7.15861,43.663052 7.133888,43.564159 7.005278,43.558319 6.854444,43.427212 6.748055,43.434711 6.669722,43.31554 6.589444,43.29221 6.681389,43.22443 6.615,43.16943 6.593888,43.197491 6.375278,43.149712 6.368055,43.09277 6.201943,43.12999 6.166666,43.115551 6.18111,43.056381 6.088611,43.05249 6.126943,43.07555 6.117499,43.098049 5.934722,43.133598 5.911111,43.099991 5.862222,43.057491 5.781111,43.082489 5.780555,43.139149 5.431944,43.220829 5.36361,43.221931 5.361666,43.33527 5.322222,43.36665 5.063611,43.34082 5.012777,43.3736 5.018332,43.400829 5.230555,43.464161 5.227221,43.496101 5.162222,43.47694 5.031388,43.55666 5.016109,43.496658 5.060833,43.465549 5.06111,43.430538 4.957777,43.424992 4.876111,43.42387 4.87361,43.373322 4.756944,43.41943 4.741666,43.417488 4.816388,43.37999 4.821666,43.359989 4.606944,43.361931 4.573333,43.37999 4.601666,43.424992 4.537837,43.451408 4.399444,43.455818 4.321111,43.458321 4.312499,43.509708 4.247222,43.49194 4.240555,43.471661 4.195276,43.46138 4.124722,43.498322 4.133055,43.536652 4.062222,43.56332 3.860555,43.484711 3.471389,43.278599 3.341111,43.271099 3.102222,43.084148 3.043333,43.10693 3.030278,43.069149 3.085278,43.05027 3.037777,42.940269 3.036944,42.897209 2.963889,42.84832 2.975277,42.809429 3.012222,42.798038 3.052499,42.878601 3.049444,42.553879 3.176962,42.437611 3.150833,42.433319 3.038333,42.474979 2.678333,42.401649 2.671111,42.338322 2.476666,42.35165 2.254167,42.434711 2.086944,42.363319 1.976666,42.374699 1.953055,42.437199 1.7875,42.490261 1.710967,42.473499 1.781667,42.581661 1.541111,42.65387 1.435247,42.597149 1.383611,42.689701 0.815833,42.841091 0.667778,42.839149 0.668055,42.748039 0.676111,42.689152 0.4125,42.695259 0.291111,42.675819 0.261944,42.71748 -0.0575,42.694149 -0.123889,42.757488 -0.187778,42.78582 -0.306667,42.849152 -0.392222,42.796379 -0.500833,42.822208 -0.519167,42.790821 -0.656111,42.863602 -0.746944,42.965542 -0.818889,42.946091 -1.300556,43.071659 -1.288333,43.106091 -1.360278,43.031651 -1.440556,43.048321 -1.472778,43.091091 -1.381945,43.196651 -1.409167,43.273041 -1.62,43.256378 -1.655833,43.309429 -1.810488,43.385891 -1.652223,43.399429 -1.493333,43.561378 -1.424445,43.758881 -1.294167,44.259708 -1.208611,44.62582 -1.192222,44.66193 -1.054445,44.659988 -1.037222,44.683041 -1.134444,44.763599 -1.168889,44.7761 -1.248889,44.630821 -1.259167,44.691929 -1.194722,45.1236 -1.095278,45.552761 -1.058333,45.571381 -1.057778,45.520821 -0.808333,45.36721 -0.735833,45.24749 -0.714722,45.13055 -0.661667,45.0536 -0.560556,44.98666 -0.589167,45.021648 -0.495,44.998878 -0.519445,45.030819 -0.62,45.060261 -0.668333,45.124149 -0.737778,45.400269 -0.85,45.519161 -1.245326,45.70779 -1.230834,45.788052 -1.146111,45.803322 -0.985278,45.71526 -1.138056,45.839989 -1.071944,45.958881 -1.111389,46.006649 -1.055556,46.008598 -1.103889,46.100269 -1.152222,46.15527 -1.2025,46.15527 -1.193889,46.21526 -1.105834,46.258598 -1.112222,46.313599 -1.195,46.319149 -1.214445,46.273319 -1.405556,46.346661 -1.448611,46.338039 -1.472222,46.395821 -1.511945,46.419159 -1.673889,46.451931 -1.799445,46.486931 -1.914167,46.688599 -2.108056,46.813599 -2.13389,46.887211 -2.011049,47.020031 -1.984445,47.034431 -2.051667,47.09721 -2.239722,47.135818 -2.163611,47.165272 -2.165556,47.264992 -2.025,47.29694 -1.815834,47.237209 -1.998889,47.31749 -2.159445,47.30999 -2.273334,47.24165 -2.495833,47.29137 -2.4425,47.2911 -2.448612,47.322491 -2.553611,47.37693 -2.396111,47.40527 -2.434167,47.421101 -2.488889,47.48138 -2.361389,47.504162 -2.662222,47.5261 -2.736111,47.504162 -2.809722,47.49165 -2.912222,47.551659 -2.877223,47.564709 -2.736945,47.54388 -2.680556,47.613041 -2.768611,47.620541 -2.88,47.606098 -2.936667,47.59721 -2.960556,47.56443 -3.125278,47.59943 -3.120278,47.500542 -3.149167,47.521381 -3.132223,47.576649 -3.200556,47.659431 -3.148056,47.741379 -3.212778,47.652489 -3.354445,47.706661 -3.281389,47.78249 -3.441389,47.701382 -3.712778,47.811939 -3.847778,47.793598 -3.951111,47.89888 -4.085556,47.86832 -4.182778,47.881378 -4.155556,47.831928 -4.209723,47.799431 -4.361945,47.802761 -4.343889,47.8536 -4.419723,47.960819 -4.529445,48.022491 -4.613056,48.020821 -4.725613,48.040989 -4.662223,48.073601 -4.295,48.098881 -4.297501,48.178322 -4.43139,48.240551 -4.493056,48.236099 -4.537223,48.176102 -4.563612,48.233601 -4.623889,48.28194 -4.513056,48.30027 -4.235001,48.303879 -4.323611,48.319988 -4.318334,48.357769 -4.448611,48.33054 -4.405556,48.381939 -4.293334,48.427212 -4.763889,48.33527 -4.790556,48.421379 -4.744167,48.545818 -4.631945,48.579708 -4.428334,48.650539 -4.314167,48.670818 -4.222778,48.648319 -4.176667,48.6861 -3.968056,48.73193 -3.953333,48.65221 -3.900278,48.67638 -3.854167,48.629162 -3.810833,48.726101 -3.596111,48.675819 -3.571111,48.6861 -3.582778,48.72665 -3.532222,48.739159 -3.580834,48.76693 -3.512778,48.837212 -3.263056,48.8386 -3.220834,48.870541 -3.224167,48.79388 -3.101667,48.872211 -3.079167,48.826931 -2.948611,48.768879 -2.883611,48.68082 -2.824722,48.654991 -2.765556,48.572208 -2.653334,48.53054 -2.464723,48.62999 -2.314336,48.6926 -2.284445,48.669159 -2.329167,48.62471 -2.226389,48.61137 -2.176389,48.57943 -2.105834,48.646099 -2.0025,48.58305 -1.9825,48.514149 -1.956944,48.550819 -2.03,48.650829 -1.849167,48.709148 -1.87,48.64999 -1.840556,48.615551 -1.638056,48.61665 -1.433889,48.663601 -1.560833,48.744709 -1.605834,48.841099 -1.549167,48.922771 -1.556667,49.01582 -1.585278,49.008881 -1.610278,49.097759 -1.549445,49.219711 -1.629445,49.215549 -1.774167,49.381649 -1.8125,49.377769 -1.845834,49.49971 -1.884444,49.529148 -1.84,49.57832 -1.851944,49.642769 -1.945833,49.675541 -1.941945,49.723881 -1.482778,49.675541 -1.410833,49.70499 -1.258333,49.694439 -1.259722,49.586102 -1.299445,49.57888 -1.301667,49.54388 -1.142222,49.34388 -1.013889,49.394711 -0.436389,49.341099 -0.218333,49.274712 0.218333,49.426659 0.393055,49.458881 0.143611,49.47694 0.078056,49.511662 0.184444,49.70277 0.611944,49.857491 1.131111,49.948879 1.435555,50.09832 1.505555,50.201931 1.555,50.21944 1.656944,50.184158 1.645,50.217209 1.548055,50.266651 1.534167,50.288601 1.552778,50.359989 1.610278,50.36832 1.558889,50.402489 1.576944,50.612209 1.576111,50.864429 1.943333,50.99527 2.472777,51.070541 2.541667,51.091099 2.6125,50.887211 2.629444,50.824711 2.781944,50.75555 2.901285,50.697048 + + + diff --git a/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri.txt b/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri.txt new file mode 100644 index 00000000..4e0e0cb6 --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri.txt @@ -0,0 +1,27 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + France + FRA + Europe + 41.366379 9.219166 41.392769 9.0975 41.474709 9.080555 41.506649 8.882221 41.588871 8.779999 41.632488 8.794722 41.67638 8.913887 41.69804 8.878887 41.751659 8.680275 41.776932 8.724722 41.894428 8.802219 41.93166 8.754164 41.89777 8.614721 41.966099 8.589441 41.978039 8.658609 42.040821 8.726387 42.10944 8.696665 42.14888 8.561943 42.214161 8.572777 42.25499 8.641109 42.27026 8.688055 42.349991 8.612221 42.376659 8.555832 42.461929 8.672222 42.507771 8.663332 42.636379 8.937498 42.6586 9.053053 42.710819 9.083887 42.73082 9.210554 42.673321 9.290833 42.73415 9.34111 42.894989 9.320833 42.958881 9.346388 43.00082 9.344721 43.005821 9.430277 42.927212 9.465832 42.81443 9.489443 42.6036 9.459999 42.56636 9.502857 42.600819 9.497221 42.429989 9.543055 42.06554 9.508055 41.906651 9.406944 41.618881 9.348888 41.607769 9.282776 41.59388 9.355276 41.41193 9.25083 41.366379 9.21916650.697048 2.901285 50.773869 3.035277 50.79332 3.113055 50.741371 3.193333 50.594151 3.281388 50.538319 3.28 50.495541 3.367222 50.497211 3.602222 50.444149 3.668889 50.346371 3.671944 50.313599 3.725277 50.351929 3.763611 50.31443 4.090833 50.26527 4.21611 50.13776 4.137777 50.0811 4.226388 49.98637 4.15 49.981369 4.168332 49.938591 4.458333 49.99638 4.67361 50.129429 4.7575 50.15498 4.876388 50.07943 4.851943 49.97776 4.800832 49.9147 4.88111 49.796379 4.858054 49.768589 5.097777 49.69054 5.216944 49.698589 5.276111 49.659981 5.329721 49.63081 5.307221 49.60915 5.423332 49.5061 5.473055 49.535229 5.705208 49.527271 5.783038 49.488319 5.963333 49.448318 5.981388 49.504711 6.165277 49.45998 6.362221 49.447201 6.493888 49.363041 6.594722 49.320271 6.589722 49.162479 6.78722 49.15498 6.838888 49.21526 6.847499 49.188869 7.026666 49.11832 7.038332 49.125259 7.088332 49.14777 7.361388 49.171928 7.375277 49.16415 7.486943 49.088871 7.539999 49.04166 7.74111 49.04887 7.93861 48.968868 8.192221 48.963711 8.227394 48.88554 8.133333 48.690029 7.921515 48.59248 7.801943 48.513321 7.807499 48.49165 7.771666 48.336651 7.750833 48.156929 7.604999 48.037209 7.571666 48.002769 7.615832 47.686932 7.513333 47.58456 7.588799 47.525822 7.521388 47.469978 7.452777 47.439671 7.39561 47.44582 7.178332 47.495258 7.198054 47.497211 6.990555 47.45499 7.007777 47.444149 6.978333 47.35693 6.88111 47.371651 7.023055 47.345539 7.061665 47.30526 7.010833 47.291931 6.948332 47.068321 6.694443 47.038601 6.702777 46.987759 6.587221 46.926929 6.434721 46.774429 6.452777 46.704479 6.325022 46.593319 6.129999 46.460819 6.078055 46.40192 6.124443 46.257771 6.114444 46.250542 6.060832 46.205261 5.96611 46.17416 6 46.14027 5.965833 46.153591 6.152222 46.252491 6.305554 46.297771 6.242221 46.322392 6.243931 46.357769 6.246387 46.406929 6.328333 46.464149 6.633611 46.432491 6.79611 46.411091 6.808887 46.405499 6.804937 46.352489 6.767499 46.27137 6.844443 46.217758 6.795277 46.142208 6.788054 46.126091 6.884444 46.051929 6.871387 46.065262 6.929166 45.931721 7.038747 45.831379 6.808887 45.780819 6.799166 45.714989 6.824166 45.63998 6.990832 45.518318 6.999443 45.411652 7.181388 45.355549 7.133054 45.301929 7.122776 45.136101 6.850277 45.16832 6.760833 45.110661 6.620172 45.02026 6.746666 44.947762 6.743332 44.848591 7.009999 44.689152 7.068889 44.69915 7.000833 44.6647 6.950832 44.628868 6.960278 44.540821 6.852777 44.507771 6.857222 44.443039 6.934999 44.415821 6.88611 44.323318 6.935832 44.156651 7.279444 44.182758 7.672776 44.072208 7.704166 43.869431 7.492221 43.783451 7.534765 43.758652 7.457388 43.757824 7.4407 43.7603 7.4383 43.7631 7.4358 43.766102 7.4342 43.769199 7.4325 43.7714 7.4294 43.773102 7.4247 43.772499 7.42 43.770599 7.4161 43.768299 7.4128 43.7658 7.4097 43.763599 7.4064 43.761398 7.4031 43.758598 7.4003 43.7561 7.3972 43.753899 7.3939 43.7514 7.3906 43.7486 7.3878 43.745602 7.3864 43.741901 7.3864 43.738899 7.3883 43.735802 7.39 43.732201 7.3908 43.728031 7.391187 43.721825 7.349536 43.720539 7.345833 43.663052 7.15861 43.564159 7.133888 43.558319 7.005278 43.427212 6.854444 43.434711 6.748055 43.31554 6.669722 43.29221 6.589444 43.22443 6.681389 43.16943 6.615 43.197491 6.593888 43.149712 6.375278 43.09277 6.368055 43.12999 6.201943 43.115551 6.166666 43.056381 6.18111 43.05249 6.088611 43.07555 6.126943 43.098049 6.117499 43.133598 5.934722 43.099991 5.911111 43.057491 5.862222 43.082489 5.781111 43.139149 5.780555 43.220829 5.431944 43.221931 5.36361 43.33527 5.361666 43.36665 5.322222 43.34082 5.063611 43.3736 5.012777 43.400829 5.018332 43.464161 5.230555 43.496101 5.227221 43.47694 5.162222 43.55666 5.031388 43.496658 5.016109 43.465549 5.060833 43.430538 5.06111 43.424992 4.957777 43.42387 4.876111 43.373322 4.87361 43.41943 4.756944 43.417488 4.741666 43.37999 4.816388 43.359989 4.821666 43.361931 4.606944 43.37999 4.573333 43.424992 4.601666 43.451408 4.537837 43.455818 4.399444 43.458321 4.321111 43.509708 4.312499 43.49194 4.247222 43.471661 4.240555 43.46138 4.195276 43.498322 4.124722 43.536652 4.133055 43.56332 4.062222 43.484711 3.860555 43.278599 3.471389 43.271099 3.341111 43.084148 3.102222 43.10693 3.043333 43.069149 3.030278 43.05027 3.085278 42.940269 3.037777 42.897209 3.036944 42.84832 2.963889 42.809429 2.975277 42.798038 3.012222 42.878601 3.052499 42.553879 3.049444 42.437611 3.176962 42.433319 3.150833 42.474979 3.038333 42.401649 2.678333 42.338322 2.671111 42.35165 2.476666 42.434711 2.254167 42.363319 2.086944 42.374699 1.976666 42.437199 1.953055 42.490261 1.7875 42.473499 1.710967 42.581661 1.781667 42.65387 1.541111 42.597149 1.435247 42.689701 1.383611 42.841091 0.815833 42.839149 0.667778 42.748039 0.668055 42.689152 0.676111 42.695259 0.4125 42.675819 0.291111 42.71748 0.261944 42.694149 -0.0575 42.757488 -0.123889 42.78582 -0.187778 42.849152 -0.306667 42.796379 -0.392222 42.822208 -0.500833 42.790821 -0.519167 42.863602 -0.656111 42.965542 -0.746944 42.946091 -0.818889 43.071659 -1.300556 43.106091 -1.288333 43.031651 -1.360278 43.048321 -1.440556 43.091091 -1.472778 43.196651 -1.381945 43.273041 -1.409167 43.256378 -1.62 43.309429 -1.655833 43.385891 -1.810488 43.399429 -1.652223 43.561378 -1.493333 43.758881 -1.424445 44.259708 -1.294167 44.62582 -1.208611 44.66193 -1.192222 44.659988 -1.054445 44.683041 -1.037222 44.763599 -1.134444 44.7761 -1.168889 44.630821 -1.248889 44.691929 -1.259167 45.1236 -1.194722 45.552761 -1.095278 45.571381 -1.058333 45.520821 -1.057778 45.36721 -0.808333 45.24749 -0.735833 45.13055 -0.714722 45.0536 -0.661667 44.98666 -0.560556 45.021648 -0.589167 44.998878 -0.495 45.030819 -0.519445 45.060261 -0.62 45.124149 -0.668333 45.400269 -0.737778 45.519161 -0.85 45.70779 -1.245326 45.788052 -1.230834 45.803322 -1.146111 45.71526 -0.985278 45.839989 -1.138056 45.958881 -1.071944 46.006649 -1.111389 46.008598 -1.055556 46.100269 -1.103889 46.15527 -1.152222 46.15527 -1.2025 46.21526 -1.193889 46.258598 -1.105834 46.313599 -1.112222 46.319149 -1.195 46.273319 -1.214445 46.346661 -1.405556 46.338039 -1.448611 46.395821 -1.472222 46.419159 -1.511945 46.451931 -1.673889 46.486931 -1.799445 46.688599 -1.914167 46.813599 -2.108056 46.887211 -2.13389 47.020031 -2.011049 47.034431 -1.984445 47.09721 -2.051667 47.135818 -2.239722 47.165272 -2.163611 47.264992 -2.165556 47.29694 -2.025 47.237209 -1.815834 47.31749 -1.998889 47.30999 -2.159445 47.24165 -2.273334 47.29137 -2.495833 47.2911 -2.4425 47.322491 -2.448612 47.37693 -2.553611 47.40527 -2.396111 47.421101 -2.434167 47.48138 -2.488889 47.504162 -2.361389 47.5261 -2.662222 47.504162 -2.736111 47.49165 -2.809722 47.551659 -2.912222 47.564709 -2.877223 47.54388 -2.736945 47.613041 -2.680556 47.620541 -2.768611 47.606098 -2.88 47.59721 -2.936667 47.56443 -2.960556 47.59943 -3.125278 47.500542 -3.120278 47.521381 -3.149167 47.576649 -3.132223 47.659431 -3.200556 47.741379 -3.148056 47.652489 -3.212778 47.706661 -3.354445 47.78249 -3.281389 47.701382 -3.441389 47.811939 -3.712778 47.793598 -3.847778 47.89888 -3.951111 47.86832 -4.085556 47.881378 -4.182778 47.831928 -4.155556 47.799431 -4.209723 47.802761 -4.361945 47.8536 -4.343889 47.960819 -4.419723 48.022491 -4.529445 48.020821 -4.613056 48.040989 -4.725613 48.073601 -4.662223 48.098881 -4.295 48.178322 -4.297501 48.240551 -4.43139 48.236099 -4.493056 48.176102 -4.537223 48.233601 -4.563612 48.28194 -4.623889 48.30027 -4.513056 48.303879 -4.235001 48.319988 -4.323611 48.357769 -4.318334 48.33054 -4.448611 48.381939 -4.405556 48.427212 -4.293334 48.33527 -4.763889 48.421379 -4.790556 48.545818 -4.744167 48.579708 -4.631945 48.650539 -4.428334 48.670818 -4.314167 48.648319 -4.222778 48.6861 -4.176667 48.73193 -3.968056 48.65221 -3.953333 48.67638 -3.900278 48.629162 -3.854167 48.726101 -3.810833 48.675819 -3.596111 48.6861 -3.571111 48.72665 -3.582778 48.739159 -3.532222 48.76693 -3.580834 48.837212 -3.512778 48.8386 -3.263056 48.870541 -3.220834 48.79388 -3.224167 48.872211 -3.101667 48.826931 -3.079167 48.768879 -2.948611 48.68082 -2.883611 48.654991 -2.824722 48.572208 -2.765556 48.53054 -2.653334 48.62999 -2.464723 48.6926 -2.314336 48.669159 -2.284445 48.62471 -2.329167 48.61137 -2.226389 48.57943 -2.176389 48.646099 -2.105834 48.58305 -2.0025 48.514149 -1.9825 48.550819 -1.956944 48.650829 -2.03 48.709148 -1.849167 48.64999 -1.87 48.615551 -1.840556 48.61665 -1.638056 48.663601 -1.433889 48.744709 -1.560833 48.841099 -1.605834 48.922771 -1.549167 49.01582 -1.556667 49.008881 -1.585278 49.097759 -1.610278 49.219711 -1.549445 49.215549 -1.629445 49.381649 -1.774167 49.377769 -1.8125 49.49971 -1.845834 49.529148 -1.884444 49.57832 -1.84 49.642769 -1.851944 49.675541 -1.945833 49.723881 -1.941945 49.675541 -1.482778 49.70499 -1.410833 49.694439 -1.258333 49.586102 -1.259722 49.57888 -1.299445 49.54388 -1.301667 49.34388 -1.142222 49.394711 -1.013889 49.341099 -0.436389 49.274712 -0.218333 49.426659 0.218333 49.458881 0.393055 49.47694 0.143611 49.511662 0.078056 49.70277 0.184444 49.857491 0.611944 49.948879 1.131111 50.09832 1.435555 50.201931 1.505555 50.21944 1.555 50.184158 1.656944 50.217209 1.645 50.266651 1.548055 50.288601 1.534167 50.359989 1.552778 50.36832 1.610278 50.402489 1.558889 50.612209 1.576944 50.864429 1.576111 50.99527 1.943333 51.070541 2.472777 51.091099 2.541667 50.887211 2.6125 50.824711 2.629444 50.75555 2.781944 50.697048 2.901285 + + + diff --git a/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt b/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt new file mode 100644 index 00000000..bdfe616a --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt @@ -0,0 +1,27 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + France + FRA + Europe + 1026273 5066534 1012729 5070449 1010843 5082615 988764 5087362 977385 5099592 979024 5106086 992289 5112625 988393 5115854 966284 5123852 971232 5127623 979859 5145178 974509 5150748 958986 5145678 956172 5155903 963872 5157690 971417 5167096 968108 5177387 953111 5183307 954317 5193114 961924 5199253 967150 5201549 958708 5213551 952431 5217569 965387 5230427 964398 5237347 994918 5256788 1007781 5260151 1011214 5268059 1025314 5271089 1034251 5262379 1039848 5271594 1037590 5296002 1040435 5305715 1040250 5312097 1049774 5312858 1053732 5300899 1056360 5283769 1053082 5251829 1057853 5246199 1057226 5251408 1062328 5225609 1058432 5170802 1047176 5147006 1040713 5104060 1033354 5102405 1041425 5100337 1029798 5073292 1026273 5066534322970 6567879 337885 6581391 346544 6584815 355480 6575672 365282 6549815 365128 6540030 374837 6532541 400998 6532834 408419 6523553 408759 6506479 414696 6500764 418963 6507448 455389 6500909 469335 6492343 460615 6470168 470479 6460333 461976 6443916 464017 6443050 496299 6435648 520264 6445649 529602 6468721 542837 6473159 540116 6460043 534426 6442425 543363 6431516 540796 6411087 567482 6406296 580748 6392854 587334 6394240 593302 6387597 590797 6382582 603723 6378861 609258 6361176 635101 6366171 643765 6364807 663835 6358129 665845 6351277 686315 6360938 708239 6353274 722896 6351085 734121 6336688 733565 6329380 755550 6302476 761302 6301199 762260 6311466 782205 6306970 783504 6294962 789070 6296142 819466 6299972 821012 6304085 833443 6302760 839349 6289954 861736 6281933 883722 6283158 911954 6269581 915869 6268706 905399 6255462 881819 6222429 868508 6205995 869127 6192682 865138 6189041 862819 6163045 846585 6133002 842874 6113047 847791 6107316 836380 6054929 844781 6038017 837277 6028328 829639 6019127 823276 6014137 799088 6015149 801284 6023291 778185 6023613 780102 6016659 776824 6014874 766002 6000530 781803 6002949 786101 5998658 780442 5992043 773485 5989856 745222 5953233 746150 5948377 733286 5940076 716310 5930155 718320 5905333 704098 5893970 682388 5875944 676606 5854506 681770 5844993 680657 5821754 674689 5820590 664144 5813304 667917 5808303 664114 5802856 684862 5804997 701931 5820904 694881 5828196 695071 5832164 695345 5837868 704467 5845801 738450 5855044 756540 5849929 757962 5846473 757522 5845570 753355 5837017 761920 5823944 756447 5815314 755643 5803168 766373 5800578 764919 5788675 771351 5790814 783550 5769414 757962 5753369 756880 5745295 759663 5734793 778216 5722842 779174 5703493 799428 5686562 794048 5677670 792904 5669180 762569 5642973 752612 5648059 736954 5638960 751035 5624712 750664 5613301 780349 5597717 786905 5572717 779329 5574283 773763 5568889 774815 5563282 762848 5549521 763342 5544360 772001 5534261 766558 5530019 772093 5515614 810344 5489716 854130 5493768 857624 5476623 834030 5445258 838766 5431992 830153 5428169 828295 5428041 828028 5428423 827749 5428854 827571 5429317 827382 5429794 827037 5430134 826514 5430396 825991 5430303 825556 5430010 825189 5429656 824844 5429271 824477 5428931 824109 5428592 823798 5428160 823453 5427775 823085 5427436 822718 5427051 822406 5426620 822250 5426157 822250 5425587 822462 5425125 822651 5424648 822740 5424093 822783 5423450 818147 5422494 817734 5422296 796893 5413446 794141 5398241 779824 5397344 763033 5377226 751190 5378375 742470 5360124 733534 5356555 743769 5346195 736378 5337796 734028 5342080 709693 5334787 708889 5326103 690397 5331779 686470 5329576 688078 5320558 677781 5319965 682048 5323478 680997 5326908 660650 5332329 658022 5327204 652580 5320727 643550 5324536 643488 5333176 604681 5345645 597074 5345813 596858 5363143 592467 5367947 563679 5363993 558020 5369012 558638 5373183 582263 5382891 581892 5387791 574656 5384851 560092 5397089 558391 5387876 563369 5383104 563400 5377735 551897 5376885 542806 5376713 542528 5368969 529541 5376033 527840 5375735 536158 5369990 536745 5366927 512843 5367225 509101 5369990 512255 5376885 505150 5380935 489744 5381611 481024 5381995 480065 5389879 472799 5387152 472056 5384041 467016 5382464 459162 5388132 460090 5394016 452204 5398112 429755 5386043 386433 5354474 371931 5353327 345338 5324789 338782 5328262 337329 5322503 343452 5319627 338164 5302885 338071 5296339 329939 5288913 331206 5283010 335319 5281282 339803 5293512 339463 5244312 353658 5226758 350749 5226111 338226 5232397 298151 5221336 297347 5211794 275701 5213801 250933 5226321 232318 5215559 220041 5217274 217413 5226696 198984 5234703 190464 5232173 198334 5248512 171556 5259435 159771 5250853 154023 5264860 90818 5287815 74337 5287521 74368 5273699 75264 5264777 45919 5265702 32406 5262758 29160 5269068 -6401 5265533 -13791 5275132 -20903 5279428 -34138 5289039 -43662 5281030 -55753 5284949 -57793 5280187 -73038 5291234 -83149 5306728 -91158 5303770 -144777 5322885 -143417 5328134 -151425 5316791 -160362 5319330 -163949 5325847 -153837 5341952 -156868 5353624 -180338 5351077 -184326 5359189 -201543 5370894 -183925 5372968 -166237 5397814 -158568 5428204 -144066 5505721 -134542 5562806 -132718 5568455 -117380 5568152 -115463 5571760 -126286 5584382 -130120 5586342 -139026 5563588 -140170 5573152 -132996 5641001 -121926 5708966 -117813 5711927 -117751 5703890 -89983 5679518 -81913 5660568 -79563 5642097 -73656 5629964 -62401 5619422 -65586 5624930 -55103 5621345 -57824 5626375 -69018 5631013 -74399 5641087 -82129 5684757 -94622 5703626 -138629 5733645 -137016 5746449 -127584 5748887 -109681 5734836 -126688 5754744 -119328 5773762 -123719 5781415 -117504 5781727 -122884 5796432 -128265 5805266 -133862 5805266 -132903 5814912 -123101 5821887 -123812 5830747 -133027 5831641 -135191 5824258 -156466 5836077 -161259 5834687 -163887 5844008 -168309 5847776 -186336 5853070 -200313 5858727 -213084 5891393 -234668 5911702 -237544 5923683 -223869 5945344 -220907 5947696 -228391 5957956 -249325 5964271 -240852 5969092 -241069 5985435 -225422 5990678 -202138 5980879 -222515 5994051 -240388 5992820 -253066 5981607 -277835 5989763 -271898 5989719 -272578 5994873 -284267 6003817 -266734 6008477 -270970 6011081 -277062 6021005 -262869 6024758 -296357 6028374 -304582 6024758 -312777 6022696 -324187 6032588 -320291 6034741 -304675 6031305 -298398 6042718 -308200 6043957 -320600 6041572 -326908 6040105 -329568 6034695 -347904 6040471 -347348 6024161 -350564 6027596 -348677 6036711 -356284 6050382 -350440 6063937 -357645 6049235 -373415 6058192 -365283 6070745 -383094 6057318 -413305 6075625 -428333 6072585 -439836 6090049 -454802 6084976 -465625 6087143 -462594 6078939 -468624 6073552 -485570 6074104 -483560 6082533 -492001 6100339 -504216 6110597 -513523 6110319 -526053 6113677 -518996 6119108 -478117 6123321 -478396 6136573 -493300 6146968 -500165 6146224 -505081 6136202 -508019 6145806 -514729 6153889 -502391 6156955 -471438 6157559 -481302 6160256 -480715 6166583 -495217 6162022 -490424 6170633 -477932 6178224 -530314 6162814 -533282 6177246 -528118 6198145 -515626 6203845 -492960 6215772 -480251 6219190 -470077 6215398 -464944 6221766 -441722 6229497 -440083 6216053 -434177 6220127 -429044 6212171 -424220 6228514 -400317 6220033 -397534 6221766 -398833 6228606 -393205 6230717 -398617 6235406 -391041 6247285 -363242 6247519 -358542 6252923 -358913 6239959 -345276 6253206 -342771 6245546 -328238 6235736 -321002 6220876 -314447 6216522 -307860 6202583 -295368 6195576 -274372 6212310 -257631 6222862 -254303 6218910 -259282 6211421 -247840 6209174 -242275 6203798 -234420 6215024 -222917 6204408 -220691 6192821 -217846 6198986 -225979 6215821 -205848 6225653 -208167 6215679 -204890 6209878 -182348 6210063 -159620 6217973 -173751 6231654 -178761 6247942 -172452 6261767 -173287 6277546 -176472 6276368 -179255 6291465 -172483 6312224 -181389 6311515 -197499 6339869 -201767 6339206 -205477 6360081 -209775 6365128 -204828 6373566 -206157 6384638 -216609 6390274 -216176 6398593 -165062 6390274 -157053 6395341 -140077 6393525 -140232 6374902 -144654 6373662 -144901 6367656 -127152 6333413 -112866 6342103 -48579 6332938 -24305 6321603 24305 6347569 43755 6353086 15987 6356179 8689 6362130 20532 6394959 68121 6421632 125915 6437427 159805 6463321 167598 6481320 173102 6484366 184450 6478230 183121 6483978 172329 6492584 170783 6496407 172854 6508855 179255 6510308 173535 6516274 175545 6552983 175452 6597348 216331 6620457 275268 6633781 282937 6637424 290822 6601367 292708 6590345 309685 6578167 322970 6567879 + + + diff --git a/demo/tests/expected/wfs11_getfeatures_france_bboxwithoutcrsuri.txt b/demo/tests/expected/wfs11_getfeatures_france_bboxwithoutcrsuri.txt new file mode 100644 index 00000000..4e0e0cb6 --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_france_bboxwithoutcrsuri.txt @@ -0,0 +1,27 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + France + FRA + Europe + 41.366379 9.219166 41.392769 9.0975 41.474709 9.080555 41.506649 8.882221 41.588871 8.779999 41.632488 8.794722 41.67638 8.913887 41.69804 8.878887 41.751659 8.680275 41.776932 8.724722 41.894428 8.802219 41.93166 8.754164 41.89777 8.614721 41.966099 8.589441 41.978039 8.658609 42.040821 8.726387 42.10944 8.696665 42.14888 8.561943 42.214161 8.572777 42.25499 8.641109 42.27026 8.688055 42.349991 8.612221 42.376659 8.555832 42.461929 8.672222 42.507771 8.663332 42.636379 8.937498 42.6586 9.053053 42.710819 9.083887 42.73082 9.210554 42.673321 9.290833 42.73415 9.34111 42.894989 9.320833 42.958881 9.346388 43.00082 9.344721 43.005821 9.430277 42.927212 9.465832 42.81443 9.489443 42.6036 9.459999 42.56636 9.502857 42.600819 9.497221 42.429989 9.543055 42.06554 9.508055 41.906651 9.406944 41.618881 9.348888 41.607769 9.282776 41.59388 9.355276 41.41193 9.25083 41.366379 9.21916650.697048 2.901285 50.773869 3.035277 50.79332 3.113055 50.741371 3.193333 50.594151 3.281388 50.538319 3.28 50.495541 3.367222 50.497211 3.602222 50.444149 3.668889 50.346371 3.671944 50.313599 3.725277 50.351929 3.763611 50.31443 4.090833 50.26527 4.21611 50.13776 4.137777 50.0811 4.226388 49.98637 4.15 49.981369 4.168332 49.938591 4.458333 49.99638 4.67361 50.129429 4.7575 50.15498 4.876388 50.07943 4.851943 49.97776 4.800832 49.9147 4.88111 49.796379 4.858054 49.768589 5.097777 49.69054 5.216944 49.698589 5.276111 49.659981 5.329721 49.63081 5.307221 49.60915 5.423332 49.5061 5.473055 49.535229 5.705208 49.527271 5.783038 49.488319 5.963333 49.448318 5.981388 49.504711 6.165277 49.45998 6.362221 49.447201 6.493888 49.363041 6.594722 49.320271 6.589722 49.162479 6.78722 49.15498 6.838888 49.21526 6.847499 49.188869 7.026666 49.11832 7.038332 49.125259 7.088332 49.14777 7.361388 49.171928 7.375277 49.16415 7.486943 49.088871 7.539999 49.04166 7.74111 49.04887 7.93861 48.968868 8.192221 48.963711 8.227394 48.88554 8.133333 48.690029 7.921515 48.59248 7.801943 48.513321 7.807499 48.49165 7.771666 48.336651 7.750833 48.156929 7.604999 48.037209 7.571666 48.002769 7.615832 47.686932 7.513333 47.58456 7.588799 47.525822 7.521388 47.469978 7.452777 47.439671 7.39561 47.44582 7.178332 47.495258 7.198054 47.497211 6.990555 47.45499 7.007777 47.444149 6.978333 47.35693 6.88111 47.371651 7.023055 47.345539 7.061665 47.30526 7.010833 47.291931 6.948332 47.068321 6.694443 47.038601 6.702777 46.987759 6.587221 46.926929 6.434721 46.774429 6.452777 46.704479 6.325022 46.593319 6.129999 46.460819 6.078055 46.40192 6.124443 46.257771 6.114444 46.250542 6.060832 46.205261 5.96611 46.17416 6 46.14027 5.965833 46.153591 6.152222 46.252491 6.305554 46.297771 6.242221 46.322392 6.243931 46.357769 6.246387 46.406929 6.328333 46.464149 6.633611 46.432491 6.79611 46.411091 6.808887 46.405499 6.804937 46.352489 6.767499 46.27137 6.844443 46.217758 6.795277 46.142208 6.788054 46.126091 6.884444 46.051929 6.871387 46.065262 6.929166 45.931721 7.038747 45.831379 6.808887 45.780819 6.799166 45.714989 6.824166 45.63998 6.990832 45.518318 6.999443 45.411652 7.181388 45.355549 7.133054 45.301929 7.122776 45.136101 6.850277 45.16832 6.760833 45.110661 6.620172 45.02026 6.746666 44.947762 6.743332 44.848591 7.009999 44.689152 7.068889 44.69915 7.000833 44.6647 6.950832 44.628868 6.960278 44.540821 6.852777 44.507771 6.857222 44.443039 6.934999 44.415821 6.88611 44.323318 6.935832 44.156651 7.279444 44.182758 7.672776 44.072208 7.704166 43.869431 7.492221 43.783451 7.534765 43.758652 7.457388 43.757824 7.4407 43.7603 7.4383 43.7631 7.4358 43.766102 7.4342 43.769199 7.4325 43.7714 7.4294 43.773102 7.4247 43.772499 7.42 43.770599 7.4161 43.768299 7.4128 43.7658 7.4097 43.763599 7.4064 43.761398 7.4031 43.758598 7.4003 43.7561 7.3972 43.753899 7.3939 43.7514 7.3906 43.7486 7.3878 43.745602 7.3864 43.741901 7.3864 43.738899 7.3883 43.735802 7.39 43.732201 7.3908 43.728031 7.391187 43.721825 7.349536 43.720539 7.345833 43.663052 7.15861 43.564159 7.133888 43.558319 7.005278 43.427212 6.854444 43.434711 6.748055 43.31554 6.669722 43.29221 6.589444 43.22443 6.681389 43.16943 6.615 43.197491 6.593888 43.149712 6.375278 43.09277 6.368055 43.12999 6.201943 43.115551 6.166666 43.056381 6.18111 43.05249 6.088611 43.07555 6.126943 43.098049 6.117499 43.133598 5.934722 43.099991 5.911111 43.057491 5.862222 43.082489 5.781111 43.139149 5.780555 43.220829 5.431944 43.221931 5.36361 43.33527 5.361666 43.36665 5.322222 43.34082 5.063611 43.3736 5.012777 43.400829 5.018332 43.464161 5.230555 43.496101 5.227221 43.47694 5.162222 43.55666 5.031388 43.496658 5.016109 43.465549 5.060833 43.430538 5.06111 43.424992 4.957777 43.42387 4.876111 43.373322 4.87361 43.41943 4.756944 43.417488 4.741666 43.37999 4.816388 43.359989 4.821666 43.361931 4.606944 43.37999 4.573333 43.424992 4.601666 43.451408 4.537837 43.455818 4.399444 43.458321 4.321111 43.509708 4.312499 43.49194 4.247222 43.471661 4.240555 43.46138 4.195276 43.498322 4.124722 43.536652 4.133055 43.56332 4.062222 43.484711 3.860555 43.278599 3.471389 43.271099 3.341111 43.084148 3.102222 43.10693 3.043333 43.069149 3.030278 43.05027 3.085278 42.940269 3.037777 42.897209 3.036944 42.84832 2.963889 42.809429 2.975277 42.798038 3.012222 42.878601 3.052499 42.553879 3.049444 42.437611 3.176962 42.433319 3.150833 42.474979 3.038333 42.401649 2.678333 42.338322 2.671111 42.35165 2.476666 42.434711 2.254167 42.363319 2.086944 42.374699 1.976666 42.437199 1.953055 42.490261 1.7875 42.473499 1.710967 42.581661 1.781667 42.65387 1.541111 42.597149 1.435247 42.689701 1.383611 42.841091 0.815833 42.839149 0.667778 42.748039 0.668055 42.689152 0.676111 42.695259 0.4125 42.675819 0.291111 42.71748 0.261944 42.694149 -0.0575 42.757488 -0.123889 42.78582 -0.187778 42.849152 -0.306667 42.796379 -0.392222 42.822208 -0.500833 42.790821 -0.519167 42.863602 -0.656111 42.965542 -0.746944 42.946091 -0.818889 43.071659 -1.300556 43.106091 -1.288333 43.031651 -1.360278 43.048321 -1.440556 43.091091 -1.472778 43.196651 -1.381945 43.273041 -1.409167 43.256378 -1.62 43.309429 -1.655833 43.385891 -1.810488 43.399429 -1.652223 43.561378 -1.493333 43.758881 -1.424445 44.259708 -1.294167 44.62582 -1.208611 44.66193 -1.192222 44.659988 -1.054445 44.683041 -1.037222 44.763599 -1.134444 44.7761 -1.168889 44.630821 -1.248889 44.691929 -1.259167 45.1236 -1.194722 45.552761 -1.095278 45.571381 -1.058333 45.520821 -1.057778 45.36721 -0.808333 45.24749 -0.735833 45.13055 -0.714722 45.0536 -0.661667 44.98666 -0.560556 45.021648 -0.589167 44.998878 -0.495 45.030819 -0.519445 45.060261 -0.62 45.124149 -0.668333 45.400269 -0.737778 45.519161 -0.85 45.70779 -1.245326 45.788052 -1.230834 45.803322 -1.146111 45.71526 -0.985278 45.839989 -1.138056 45.958881 -1.071944 46.006649 -1.111389 46.008598 -1.055556 46.100269 -1.103889 46.15527 -1.152222 46.15527 -1.2025 46.21526 -1.193889 46.258598 -1.105834 46.313599 -1.112222 46.319149 -1.195 46.273319 -1.214445 46.346661 -1.405556 46.338039 -1.448611 46.395821 -1.472222 46.419159 -1.511945 46.451931 -1.673889 46.486931 -1.799445 46.688599 -1.914167 46.813599 -2.108056 46.887211 -2.13389 47.020031 -2.011049 47.034431 -1.984445 47.09721 -2.051667 47.135818 -2.239722 47.165272 -2.163611 47.264992 -2.165556 47.29694 -2.025 47.237209 -1.815834 47.31749 -1.998889 47.30999 -2.159445 47.24165 -2.273334 47.29137 -2.495833 47.2911 -2.4425 47.322491 -2.448612 47.37693 -2.553611 47.40527 -2.396111 47.421101 -2.434167 47.48138 -2.488889 47.504162 -2.361389 47.5261 -2.662222 47.504162 -2.736111 47.49165 -2.809722 47.551659 -2.912222 47.564709 -2.877223 47.54388 -2.736945 47.613041 -2.680556 47.620541 -2.768611 47.606098 -2.88 47.59721 -2.936667 47.56443 -2.960556 47.59943 -3.125278 47.500542 -3.120278 47.521381 -3.149167 47.576649 -3.132223 47.659431 -3.200556 47.741379 -3.148056 47.652489 -3.212778 47.706661 -3.354445 47.78249 -3.281389 47.701382 -3.441389 47.811939 -3.712778 47.793598 -3.847778 47.89888 -3.951111 47.86832 -4.085556 47.881378 -4.182778 47.831928 -4.155556 47.799431 -4.209723 47.802761 -4.361945 47.8536 -4.343889 47.960819 -4.419723 48.022491 -4.529445 48.020821 -4.613056 48.040989 -4.725613 48.073601 -4.662223 48.098881 -4.295 48.178322 -4.297501 48.240551 -4.43139 48.236099 -4.493056 48.176102 -4.537223 48.233601 -4.563612 48.28194 -4.623889 48.30027 -4.513056 48.303879 -4.235001 48.319988 -4.323611 48.357769 -4.318334 48.33054 -4.448611 48.381939 -4.405556 48.427212 -4.293334 48.33527 -4.763889 48.421379 -4.790556 48.545818 -4.744167 48.579708 -4.631945 48.650539 -4.428334 48.670818 -4.314167 48.648319 -4.222778 48.6861 -4.176667 48.73193 -3.968056 48.65221 -3.953333 48.67638 -3.900278 48.629162 -3.854167 48.726101 -3.810833 48.675819 -3.596111 48.6861 -3.571111 48.72665 -3.582778 48.739159 -3.532222 48.76693 -3.580834 48.837212 -3.512778 48.8386 -3.263056 48.870541 -3.220834 48.79388 -3.224167 48.872211 -3.101667 48.826931 -3.079167 48.768879 -2.948611 48.68082 -2.883611 48.654991 -2.824722 48.572208 -2.765556 48.53054 -2.653334 48.62999 -2.464723 48.6926 -2.314336 48.669159 -2.284445 48.62471 -2.329167 48.61137 -2.226389 48.57943 -2.176389 48.646099 -2.105834 48.58305 -2.0025 48.514149 -1.9825 48.550819 -1.956944 48.650829 -2.03 48.709148 -1.849167 48.64999 -1.87 48.615551 -1.840556 48.61665 -1.638056 48.663601 -1.433889 48.744709 -1.560833 48.841099 -1.605834 48.922771 -1.549167 49.01582 -1.556667 49.008881 -1.585278 49.097759 -1.610278 49.219711 -1.549445 49.215549 -1.629445 49.381649 -1.774167 49.377769 -1.8125 49.49971 -1.845834 49.529148 -1.884444 49.57832 -1.84 49.642769 -1.851944 49.675541 -1.945833 49.723881 -1.941945 49.675541 -1.482778 49.70499 -1.410833 49.694439 -1.258333 49.586102 -1.259722 49.57888 -1.299445 49.54388 -1.301667 49.34388 -1.142222 49.394711 -1.013889 49.341099 -0.436389 49.274712 -0.218333 49.426659 0.218333 49.458881 0.393055 49.47694 0.143611 49.511662 0.078056 49.70277 0.184444 49.857491 0.611944 49.948879 1.131111 50.09832 1.435555 50.201931 1.505555 50.21944 1.555 50.184158 1.656944 50.217209 1.645 50.266651 1.548055 50.288601 1.534167 50.359989 1.552778 50.36832 1.610278 50.402489 1.558889 50.612209 1.576944 50.864429 1.576111 50.99527 1.943333 51.070541 2.472777 51.091099 2.541667 50.887211 2.6125 50.824711 2.629444 50.75555 2.781944 50.697048 2.901285 + + + diff --git a/demo/tests/input/wfs10_getfeatures_france_bbox.txt b/demo/tests/input/wfs10_getfeatures_france_bbox.txt new file mode 100644 index 00000000..7da50bf2 --- /dev/null +++ b/demo/tests/input/wfs10_getfeatures_france_bbox.txt @@ -0,0 +1 @@ +SERVICE=WFS&REQUEST=GetFeature&VERSION=1.0.0&TYPENAME=tows:world&bbox=2,49,3,50 diff --git a/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri.txt b/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri.txt new file mode 100644 index 00000000..9ce1b082 --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri.txt @@ -0,0 +1 @@ +SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=tows:world&bbox=222638,6274861,333958,6446275,urn:ogc:def:crs:EPSG::3857 diff --git a/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt b/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt new file mode 100644 index 00000000..15e50230 --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_france_bboxwithcrsuri_srsname.txt @@ -0,0 +1 @@ +SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=tows:world&SRSNAME=urn:ogc:def:crs:EPSG::3857&bbox=222638,6274861,333958,6446275,urn:ogc:def:crs:EPSG::3857 diff --git a/demo/tests/input/wfs11_getfeatures_france_bboxwithoutcrsuri.txt b/demo/tests/input/wfs11_getfeatures_france_bboxwithoutcrsuri.txt new file mode 100644 index 00000000..ce6d231a --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_france_bboxwithoutcrsuri.txt @@ -0,0 +1 @@ +SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&TYPENAME=tows:world&bbox=49,2,50,3 From f40765ac3ade9a2d722d4228b271cce32455519e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Nov 2020 17:07:57 +0100 Subject: [PATCH 17/61] Fix build with -DOWS_DEBUG --- src/ows/ows_layer.c | 4 ++-- src/wfs/wfs_request.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ows/ows_layer.c b/src/ows/ows_layer.c index 582bb39f..4f881dba 100644 --- a/src/ows/ows_layer.c +++ b/src/ows/ows_layer.c @@ -672,13 +672,13 @@ void ows_layer_flush(ows_layer * l, FILE * output) if(l->pkey) { fprintf(output, "pkey: "); - list_flush(l->pkey, output); + buffer_flush(l->pkey, output); fprintf(output, "\n"); } if(l->pkey_sequence) { fprintf(output, "pkey_sequence: "); - list_flush(l->pkey_sequence, output); + buffer_flush(l->pkey_sequence, output); fprintf(output, "\n"); } } diff --git a/src/wfs/wfs_request.c b/src/wfs/wfs_request.c index 8b69d3e2..001fd528 100644 --- a/src/wfs/wfs_request.c +++ b/src/wfs/wfs_request.c @@ -153,7 +153,7 @@ void wfs_request_flush(wfs_request * wr, FILE * output) if (wr->callback) { fprintf(output, " callback -> "); - list_flush(wr->callback, output); + buffer_flush(wr->callback, output); fprintf(output, "\n"); } From 99e30478cee16062de563f6411cf7acc805f9451 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 27 Nov 2020 18:18:59 +0100 Subject: [PATCH 18/61] Transaction support: handle srsName in wfs:Insert w.r.t axis swapping --- .github/workflows/linux.sh | 1 + demo/check.sh | 43 ++++++++++++++++++- .../input/wfst10_france_insert.xml | 30 +++++++++++++ .../input/wfst10_world_insert.xml | 30 +++++++++++++ .../input/wfst11_france_insert.xml | 30 +++++++++++++ .../input/wfst11_world_insert.xml | 30 +++++++++++++ ...st11_world_insert_srsname_in_wfsinsert.xml | 30 +++++++++++++ demo/tinyows_no_checkschema.xml | 24 +++++++++++ src/fe/fe_spatial_ops.c | 28 +++++++++--- src/ows/ows_psql.c | 39 +++++++++++++++-- src/ows_api.h | 2 +- src/wfs/wfs_transaction.c | 25 ++++++----- 12 files changed, 290 insertions(+), 22 deletions(-) create mode 100644 demo/tests/transactions/input/wfst10_france_insert.xml create mode 100644 demo/tests/transactions/input/wfst10_world_insert.xml create mode 100644 demo/tests/transactions/input/wfst11_france_insert.xml create mode 100644 demo/tests/transactions/input/wfst11_world_insert.xml create mode 100644 demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml create mode 100644 demo/tinyows_no_checkschema.xml diff --git a/.github/workflows/linux.sh b/.github/workflows/linux.sh index fc1e38c9..32584465 100755 --- a/.github/workflows/linux.sh +++ b/.github/workflows/linux.sh @@ -22,6 +22,7 @@ echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.c /etc/init.d/postgresql start make install-demo +cp -f demo/tinyows_no_checkschema.xml /etc/tinyows.xml make check # wget https://github.com/MapServer/tinyows/commit/633ca487113d032e261a4a5c8b5f3b7850580f4f.patch diff --git a/demo/check.sh b/demo/check.sh index be80d00a..6cd38add 100755 --- a/demo/check.sh +++ b/demo/check.sh @@ -4,6 +4,9 @@ set -eu RET=0 +PGUSER=postgres +DB=tinyows_demo + for i in demo/tests/input/*; do echo "Running $i" QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt @@ -19,6 +22,44 @@ if test "$RET" -eq "0"; then echo "Tests OK !" else echo "Tests failed !" + exit $RET fi -exit $RET \ No newline at end of file +i=demo/tests/transactions/input/wfst10_france_insert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep SUCCESS || (cat /tmp/output.txt && /bin/false) +echo "select st_astext(geom) from france where id_geofla = -1234;" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2171610 802820,2171611 802820,2171611 802821,2171610 802820)))" +echo "delete from france where id_geofla = -1234" | su $PGUSER -c "psql $DB" + + +i=demo/tests/transactions/input/wfst10_world_insert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep SUCCESS || (cat /tmp/output.txt && /bin/false) +echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))" +echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB" + + +i=demo/tests/transactions/input/wfst11_france_insert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep "1" || (cat /tmp/output.txt && /bin/false) +echo "select st_astext(geom) from france where id_geofla = -1234;" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2171610 802820,2171611 802820,2171611 802821,2171610 802820)))" +echo "delete from france where id_geofla = -1234" | su $PGUSER -c "psql $DB" + + +i=demo/tests/transactions/input/wfst11_world_insert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep "1" || (cat /tmp/output.txt && /bin/false) +echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))" +echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB" + + +i=demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep "1" || (cat /tmp/output.txt && /bin/false) +echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))" +echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB" diff --git a/demo/tests/transactions/input/wfst10_france_insert.xml b/demo/tests/transactions/input/wfst10_france_insert.xml new file mode 100644 index 00000000..3d1a81bf --- /dev/null +++ b/demo/tests/transactions/input/wfst10_france_insert.xml @@ -0,0 +1,30 @@ + + + + + -1234 + + + + + + + 2171610,802820 2171611,802820 2171611,802821 2171610,802820 + + + + + + + + + diff --git a/demo/tests/transactions/input/wfst10_world_insert.xml b/demo/tests/transactions/input/wfst10_world_insert.xml new file mode 100644 index 00000000..939df53b --- /dev/null +++ b/demo/tests/transactions/input/wfst10_world_insert.xml @@ -0,0 +1,30 @@ + + + + + -1234 + + + + + + + 2,49 2,50 3,50 2,49 + + + + + + + + + diff --git a/demo/tests/transactions/input/wfst11_france_insert.xml b/demo/tests/transactions/input/wfst11_france_insert.xml new file mode 100644 index 00000000..519afc54 --- /dev/null +++ b/demo/tests/transactions/input/wfst11_france_insert.xml @@ -0,0 +1,30 @@ + + + + + -1234 + + + + + + + 2171610,802820 2171611,802820 2171611,802821 2171610,802820 + + + + + + + + + diff --git a/demo/tests/transactions/input/wfst11_world_insert.xml b/demo/tests/transactions/input/wfst11_world_insert.xml new file mode 100644 index 00000000..2577f117 --- /dev/null +++ b/demo/tests/transactions/input/wfst11_world_insert.xml @@ -0,0 +1,30 @@ + + + + + -1234 + + + + + + + 49,2 50,2 50,3 49,2 + + + + + + + + + diff --git a/demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml b/demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml new file mode 100644 index 00000000..66866f35 --- /dev/null +++ b/demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml @@ -0,0 +1,30 @@ + + + + + -1234 + + + + + + + 49,2 50,2 50,3 49,2 + + + + + + + + + diff --git a/demo/tinyows_no_checkschema.xml b/demo/tinyows_no_checkschema.xml new file mode 100644 index 00000000..1ec6237e --- /dev/null +++ b/demo/tinyows_no_checkschema.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/src/fe/fe_spatial_ops.c b/src/fe/fe_spatial_ops.c index 6e4f10b3..e9811926 100644 --- a/src/fe/fe_spatial_ops.c +++ b/src/fe/fe_spatial_ops.c @@ -233,7 +233,8 @@ static buffer *fe_spatial_functions(ows * o, buffer * typename, filter_encoding buffer *geom, *layer_name; xmlNodePtr p; xmlChar *srsname; - int srid = -1; + ows_srs* parent_srs = NULL; + bool free_parent_srs = false; assert(typename); assert(fe); @@ -260,11 +261,20 @@ static buffer *fe_spatial_functions(ows * o, buffer * typename, filter_encoding /* jump to the next element if there are spaces */ while (n->type != XML_ELEMENT_NODE) n = n->next; - if (o->request->request.wfs->srs) srid = o->request->request.wfs->srs->srid; - else srid = ows_srs_get_srid_from_layer(o, layer_name); + if (o->request->request.wfs->srs) { + parent_srs = o->request->request.wfs->srs; + } + else { + int srid = ows_srs_get_srid_from_layer(o, layer_name); + if (srid > 0) { + parent_srs = ows_srs_init(); + ows_srs_set_from_srid(o, parent_srs, srid); + free_parent_srs = true; + } + } if (!strcmp((char *) n->name, "Box") || !strcmp((char *) n->name, "Envelope")) { - + int srid = -1; srsname = xmlGetProp(n, (xmlChar *) "srsName"); if (srsname) { s = ows_srs_init(); @@ -287,9 +297,12 @@ static buffer *fe_spatial_functions(ows * o, buffer * typename, filter_encoding } else fe->sql = fe_envelope(o, typename, fe, fe->sql, n); } else { - geom = ows_psql_gml_to_sql(o, n, srid); + int srid; + geom = ows_psql_gml_to_sql(o, n, parent_srs); if (!geom) { fe->error_code = FE_ERROR_GEOMETRY; + if (free_parent_srs) + ows_srs_free(parent_srs); return fe->sql; } @@ -319,6 +332,9 @@ static buffer *fe_spatial_functions(ows * o, buffer * typename, filter_encoding buffer_add(fe->sql, ')'); + if (free_parent_srs) + ows_srs_free(parent_srs); + return fe->sql; } @@ -370,7 +386,7 @@ static buffer *fe_distance_functions(ows * o, buffer * typename, filter_encoding buffer_add_str(fe->sql, "ST_Transform("); /* display the geometry */ - sql = ows_psql_gml_to_sql(o, n, 0); + sql = ows_psql_gml_to_sql(o, n, NULL); if (sql) { buffer_copy(fe->sql, sql); buffer_free(sql); diff --git a/src/ows/ows_psql.c b/src/ows/ows_psql.c index ebc6daec..cc6076cd 100644 --- a/src/ows/ows_psql.c +++ b/src/ows/ows_psql.c @@ -752,11 +752,12 @@ static xmlNodePtr ows_psql_recursive_parse_gml(ows * o, xmlNodePtr n, xmlNodePtr * Transform a GML geometry to PostGIS EWKT * Return NULL on error */ -buffer * ows_psql_gml_to_sql(ows * o, xmlNodePtr n, int srid) +buffer * ows_psql_gml_to_sql(ows * o, xmlNodePtr n, const ows_srs* parent_srs) { PGresult *res; xmlNodePtr g; buffer *result, *sql, *gml; + ows_srs* srs_geom = NULL; assert(o); assert(n); @@ -764,22 +765,52 @@ buffer * ows_psql_gml_to_sql(ows * o, xmlNodePtr n, int srid) g = ows_psql_recursive_parse_gml(o, n, NULL); if (!g) return NULL; /* No Geometry founded in GML doc */ + /* Look for a srsName attribute on the geometry itself */ + if (xmlHasProp(g, (xmlChar *) "srsName")) { + xmlChar* attr = xmlGetProp(g, (xmlChar *) "srsName"); + srs_geom = ows_srs_init(); + + if (!ows_srs_set_from_srsname(o, srs_geom, (char *) attr)) { + ows_srs_free(srs_geom); + xmlFree(attr); + return NULL; + } + + xmlFree(attr); + } + /* Retrieve the sub doc and launch GML parse via PostGIS */ gml = buffer_init(); cgi_add_xml_into_buffer(gml, g); sql = buffer_init(); - buffer_add_str(sql, "SELECT ST_GeomFromGML('"); + buffer_add_str(sql, "SELECT "); + if (srs_geom == NULL && parent_srs != NULL && + parent_srs->honours_authority_axis_order && + !parent_srs->is_axis_order_gis_friendly) { + buffer_add_str(sql, "ST_FlipCoordinates("); + } + /* ST_GeomFromGML handles the axis swapping if the geometry has a srsName */ + buffer_add_str(sql, "ST_GeomFromGML('"); buffer_add_str(sql, gml->buf); - if (ows_version_get(o->postgis_version) >= 200) { + if (ows_version_get(o->postgis_version) >= 200 && + (srs_geom != NULL || parent_srs != NULL)) { buffer_add_str(sql, "',"); - buffer_add_int(sql, srid); + buffer_add_int(sql, srs_geom ? srs_geom->srid : parent_srs->srid); buffer_add_str(sql, ")"); } else { /* Means PostGIS 1.5 */ buffer_add_str(sql, "')"); } + if (srs_geom == NULL && parent_srs != NULL && + parent_srs->honours_authority_axis_order && + !parent_srs->is_axis_order_gis_friendly) { + /* Close ST_FlipCoordinates */ + buffer_add_str(sql, ")"); + } + + if (srs_geom) ows_srs_free(srs_geom); res = ows_psql_exec(o, sql->buf); buffer_free(gml); diff --git a/src/ows_api.h b/src/ows_api.h index f8878448..01e21db1 100644 --- a/src/ows_api.h +++ b/src/ows_api.h @@ -195,7 +195,7 @@ bool ows_psql_is_numeric(buffer * type); buffer *ows_psql_type (ows * o, buffer * layer_name, buffer * property); buffer *ows_psql_generate_id (ows * o, buffer * layer_name); int ows_psql_number_features(ows * o, list * from, list * where); -buffer * ows_psql_gml_to_sql(ows * o, xmlNodePtr n, int srid); +buffer * ows_psql_gml_to_sql(ows * o, xmlNodePtr n, const ows_srs* parent_srs); char *ows_psql_escape_string(ows *o, const char *content); int ows_psql_geometry_srid(ows *o, const char *geom); void ows_request_check (ows * o, ows_request * or, const array * cgi, const char *query); diff --git a/src/wfs/wfs_transaction.c b/src/wfs/wfs_transaction.c index a777e4f4..0fc570d0 100644 --- a/src/wfs/wfs_transaction.c +++ b/src/wfs/wfs_transaction.c @@ -324,8 +324,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo array * table; char *escaped; list *l; - ows_srs * srs_root; - int srid_root = 0; + ows_srs * srs_root = NULL; xmlChar *attr = NULL; enum wfs_insert_idgen idgen = WFS_GENERATE_NEW; enum wfs_insert_idgen handle_idgen = WFS_GENERATE_NEW; @@ -377,8 +376,6 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo return result; } - srid_root = srs_root->srid; - ows_srs_free(srs_root); xmlFree(attr); attr = NULL; } @@ -407,6 +404,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(values); buffer_free(handle); if (layer_name) buffer_free(layer_name); + if (srs_root) ows_srs_free(srs_root); result = buffer_from_str("Error unknown or not writable Layer Name"); return result; } @@ -433,6 +431,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(sql); buffer_free(values); buffer_free(layer_name); + if (srs_root) ows_srs_free(srs_root); result = buffer_from_str("Error unknown Layer Name or not id column available"); return result; } @@ -556,6 +555,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(column); buffer_free(id); filter_encoding_free(fe); + if (srs_root) ows_srs_free(srs_root); return result; } buffer_copy(values, fe->sql); @@ -564,7 +564,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo } else if (!strcmp((char *) elemt->name, "Null")) { buffer_add_str(values, "''"); } else { - gml = ows_psql_gml_to_sql(o, elemt, srid_root); + gml = ows_psql_gml_to_sql(o, elemt, srs_root); if (gml) { buffer_add_str(values, "'"); buffer_copy(values, gml); @@ -576,6 +576,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(column); buffer_free(id); buffer_free(layer_name); + if (srs_root) ows_srs_free(srs_root); result = buffer_from_str("Error invalid Geometry"); return result; @@ -613,6 +614,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo result = wfs_execute_transaction_request(o, wr, sql); if (!buffer_cmp(result, "PGRES_COMMAND_OK")) { buffer_free(sql); + if (srs_root) ows_srs_free(srs_root); return result; } buffer_empty(sql); @@ -620,6 +622,7 @@ static buffer *wfs_insert_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo } buffer_free(sql); + if (srs_root) ows_srs_free(srs_root); return result; } @@ -828,8 +831,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo xmlChar *content; char *escaped; array *table; - ows_srs *srs_root; - int srid_root = 0; + ows_srs *srs_root = NULL; xmlChar *attr = NULL; list *l; @@ -857,8 +859,6 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo return result; } - srid_root = srs_root->srid; - ows_srs_free(srs_root); xmlFree(attr); attr = NULL; } @@ -874,6 +874,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo if (!layer_name || !s || !t) { if (typename) buffer_free(typename); buffer_free(sql); + if (srs_root) ows_srs_free(srs_root); result = buffer_from_str("Typename provided is unknown or not writable"); return result; } @@ -958,6 +959,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(typename); buffer_free(property_name); filter_encoding_free(fe); + if (srs_root) ows_srs_free(srs_root); return result; } @@ -967,7 +969,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo } else if (!strcmp((char *) elemt->name, "Null")) { buffer_add_str(values, "''"); } else { - gml = ows_psql_gml_to_sql(o, elemt, srid_root); + gml = ows_psql_gml_to_sql(o, elemt, srs_root); if (gml) { buffer_add_str(values, "'"); buffer_copy(values, gml); @@ -978,6 +980,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(typename); buffer_free(property_name); buffer_free(sql); + if (srs_root) ows_srs_free(srs_root); result = buffer_from_str("Invalid GML Geometry"); return result; } @@ -1005,6 +1008,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(values); buffer_free(sql); buffer_free(typename); + if (srs_root) ows_srs_free(srs_root); return result; } else { @@ -1026,6 +1030,7 @@ static buffer *wfs_update_xml(ows * o, wfs_request * wr, xmlDocPtr xmldoc, xmlNo buffer_free(typename); buffer_free(sql); + if (srs_root) ows_srs_free(srs_root); return result; } From 2852676ba5f485d8ac73be4814a5decf9ac770d5 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 29 Nov 2020 18:50:52 +0100 Subject: [PATCH 19/61] ows_srs_set_is_geographic_and_is_axis_order_gis_friendly_from_def(): improve tests --- src/ows/ows_srs.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/ows/ows_srs.c b/src/ows/ows_srs.c index 6daea4ca..03611829 100644 --- a/src/ows/ows_srs.c +++ b/src/ows/ows_srs.c @@ -140,19 +140,31 @@ static void ows_srs_set_is_geographic_and_is_axis_order_gis_friendly_from_def( *ptr = '\0'; s->is_axis_order_gis_friendly = true; - s->is_geographic = strstr(srtext, "PROJCS[") == NULL && - strstr(srtext, "GEOCCS[") == NULL; + s->is_geographic = (strstr(srtext, "PROJCS[") == NULL && + strstr(srtext, "GEOCCS[") == NULL && + strstr(srtext, "BOUNDCRS[") == NULL) || + strstr(srtext, "BOUNDCRS[SOURCECRS[GEOGCRS") != NULL; - if( strstr(srtext_horizontal, "AXIS[") == NULL ) + if( strstr(srtext_horizontal, "AXIS[") == NULL && + strstr(srtext_horizontal, "GEOCCS[") == NULL ) { /* If there is no axis definition, then due to how GDAL < 3 - * generated the WKT, this means that the axis order is not - * GIS friendly */ + * generated the WKT, this means that the axis order is not + * GIS friendly */ s->is_axis_order_gis_friendly = false; } - /* In case PostGIS incorporates full WKT output some day... */ else if( strstr(srtext_horizontal, - "AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]") != NULL ) + "AXIS[\"Latitude\",NORTH],AXIS[\"Longitude\",EAST]") != NULL ) + { + s->is_axis_order_gis_friendly = false; + } + else if( strstr(srtext_horizontal, + "AXIS[\"Northing\",NORTH],AXIS[\"Easting\",EAST]") != NULL ) + { + s->is_axis_order_gis_friendly = false; + } + else if( strstr(srtext_horizontal, + "AXIS[\"geodetic latitude (Lat)\",north,ORDER[1]") != NULL ) { s->is_axis_order_gis_friendly = false; } From 708e7cb734196c6d07991df0db8166e52d004258 Mon Sep 17 00:00:00 2001 From: Louis Jencka Date: Tue, 19 May 2020 11:58:05 -0600 Subject: [PATCH 20/61] Implement matchCase for PropertyIsLike filter --- src/fe/fe_comparison_ops.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/fe/fe_comparison_ops.c b/src/fe/fe_comparison_ops.c index e96e23c7..19575eac 100644 --- a/src/fe/fe_comparison_ops.c +++ b/src/fe/fe_comparison_ops.c @@ -152,29 +152,42 @@ static buffer *fe_binary_comparison_op(ows * o, buffer * typename, filter_encodi */ static buffer *fe_property_is_like(ows * o, buffer * typename, filter_encoding * fe, xmlNodePtr n) { - xmlChar *content, *wildcard, *singlechar, *escape; + xmlChar *content, *wildcard, *singlechar, *escape, *matchcase; buffer *pg_string; char *escaped; + bool sensitive_case = true; assert(o && typename && fe && n); wildcard = xmlGetProp(n, (xmlChar *) "wildCard"); singlechar = xmlGetProp(n, (xmlChar *) "singleChar"); + matchcase = xmlGetProp(n, (xmlChar *) "matchCase"); if (ows_version_get(o->request->version) == 100) escape = xmlGetProp(n, (xmlChar *) "escape"); else escape = xmlGetProp(n, (xmlChar *) "escapeChar"); + /* By default, comparison is case sensitive */ + if (matchcase && !strcmp((char *) matchcase, "false")) sensitive_case = false; n = n->children; while (n->type != XML_ELEMENT_NODE) n = n->next; /* eat spaces */ + /* If comparison are explicitly not case sensitive */ + if (!sensitive_case) buffer_add_str(fe->sql, "LOWER("); + /* We need to cast as varchar at least for timestamp PostgreSQL data type */ buffer_add_str(fe->sql, " CAST(\""); fe->sql = fe_property_name(o, typename, fe, fe->sql, n, false, true); - buffer_add_str(fe->sql, "\" AS varchar) LIKE E"); + buffer_add_str(fe->sql, "\" AS varchar)"); + + if (!sensitive_case) { + buffer_add_str(fe->sql, ") LIKE LOWER(E"); + } else { + buffer_add_str(fe->sql, " LIKE E"); + } n = n->next; @@ -200,9 +213,12 @@ static buffer *fe_property_is_like(ows * o, buffer * typename, filter_encoding * } buffer_add_str(fe->sql, "'"); + if (!sensitive_case) buffer_add_str(fe->sql, ")"); + xmlFree(content); xmlFree(wildcard); xmlFree(singlechar); + xmlFree(matchcase); xmlFree(escape); buffer_free(pg_string); From f4e0a921dfc855b3aeef1873910e850e1ec4e3e7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 22 Apr 2021 15:19:14 +0200 Subject: [PATCH 21/61] Fix -Wformat-security related --- src/wfs/wfs_get_feature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wfs/wfs_get_feature.c b/src/wfs/wfs_get_feature.c index dcb1a0e4..261d4184 100644 --- a/src/wfs/wfs_get_feature.c +++ b/src/wfs/wfs_get_feature.c @@ -795,7 +795,7 @@ static void wfs_geojson_display_results(ows * o, wfs_request * wr, mlist * reque assert(wr->callback); fprintf(o->output, "Content-Type: application/javascript\n\n"); - fprintf(o->output, wr->callback->buf); + fprintf(o->output, "%s", wr->callback->buf); fprintf(o->output, "("); } else fprintf(o->output, "Content-Type: application/json\n\n"); From 23a61cdf56401da9d90455a699bb8074a0c485b7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 22 Apr 2021 16:36:45 +0200 Subject: [PATCH 22/61] Add support for geometry less tables --- .github/workflows/linux.sh | 3 +- demo/check.sh | 8 + demo/install.sh.in | 7 +- demo/tests/expected/wfs10_describe.txt | 11 ++ demo/tests/expected/wfs10_getcaps.txt | 5 + .../wfs10_getfeatures_geometry_less.txt | 26 +++ demo/tests/expected/wfs11_describe.txt | 11 ++ demo/tests/expected/wfs11_getcaps.txt | 4 + .../wfs11_getfeatures_geometry_less.txt | 25 +++ .../input/wfs10_getfeatures_geometry_less.txt | 1 + .../input/wfs11_getfeatures_geometry_less.txt | 1 + .../input/wfst11_geometry_less_insert.xml | 18 ++ demo/tinyows_no_checkschema.xml | 7 + src/ows/ows_geobbox.c | 11 +- src/ows/ows_storage.c | 39 ++--- src/wfs/wfs_get_capabilities.c | 161 +++++++++--------- 16 files changed, 231 insertions(+), 107 deletions(-) create mode 100644 demo/tests/expected/wfs10_getfeatures_geometry_less.txt create mode 100644 demo/tests/expected/wfs11_getfeatures_geometry_less.txt create mode 100644 demo/tests/input/wfs10_getfeatures_geometry_less.txt create mode 100644 demo/tests/input/wfs11_getfeatures_geometry_less.txt create mode 100644 demo/tests/transactions/input/wfst11_geometry_less_insert.xml diff --git a/.github/workflows/linux.sh b/.github/workflows/linux.sh index 32584465..90e2887b 100755 --- a/.github/workflows/linux.sh +++ b/.github/workflows/linux.sh @@ -21,6 +21,7 @@ echo "local all postgres trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf /etc/init.d/postgresql start +rm -f /etc/tinyows.xml make install-demo cp -f demo/tinyows_no_checkschema.xml /etc/tinyows.xml make check @@ -32,4 +33,4 @@ make check # make install-test100 # rm -f /etc/tinyows.xml -# make install-test110 \ No newline at end of file +# make install-test110 diff --git a/demo/check.sh b/demo/check.sh index 6cd38add..46d4d552 100755 --- a/demo/check.sh +++ b/demo/check.sh @@ -63,3 +63,11 @@ QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && cat /tmp/output.txt | grep "1" || (cat /tmp/output.txt && /bin/false) echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))" echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB" + + +i=demo/tests/transactions/input/wfst11_geometry_less_insert.xml +echo "Running $i" +QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false) +cat /tmp/output.txt | grep "1" || (cat /tmp/output.txt && /bin/false) +echo "select textcol from geometry_less where intcol = -1234;" | su $PGUSER -c "psql -t $DB" | grep "minus 1234" +echo "delete from geometry_less where intcol = -1234" | su $PGUSER -c "psql $DB" diff --git a/demo/install.sh.in b/demo/install.sh.in index e1928f85..89de7d51 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -48,4 +48,9 @@ echo "Import layer data: france_dept" $SHP2PGSQL -s 27582 -I -W latin1 demo/france.shp france > _france.sql su $PGUSER -c "$PGBIN/psql $DB < _france.sql" -rm _world.sql _france.sql +echo "Import non spatial layer" +echo "CREATE TABLE geometry_less(id SERIAL PRIMARY KEY, intcol INTEGER, textcol TEXT);" > _geometry_less.sql +echo "INSERT INTO geometry_less (intcol, textcol) VALUES (123, 'foo');" >> _geometry_less.sql +su $PGUSER -c "$PGBIN/psql $DB < _geometry_less.sql" + +rm _world.sql _france.sql _geometry_less.sql diff --git a/demo/tests/expected/wfs10_describe.txt b/demo/tests/expected/wfs10_describe.txt index 146b9f80..2520c207 100644 --- a/demo/tests/expected/wfs10_describe.txt +++ b/demo/tests/expected/wfs10_describe.txt @@ -37,4 +37,15 @@ Content-Type: text/xml; subtype=gml/2.1.2; + + + + + + + + + + + \ No newline at end of file diff --git a/demo/tests/expected/wfs10_getcaps.txt b/demo/tests/expected/wfs10_getcaps.txt index f22b30f4..d0bacb39 100644 --- a/demo/tests/expected/wfs10_getcaps.txt +++ b/demo/tests/expected/wfs10_getcaps.txt @@ -89,6 +89,11 @@ version='1.0.0' updateSequence='0' French Administrative Sub Boundaries (IGN - GeoFLA Departements) EPSG:27582 + + + tows:geometry_less + Geometry less layer + diff --git a/demo/tests/expected/wfs10_getfeatures_geometry_less.txt b/demo/tests/expected/wfs10_getfeatures_geometry_less.txt new file mode 100644 index 00000000..ead1ddb4 --- /dev/null +++ b/demo/tests/expected/wfs10_getfeatures_geometry_less.txt @@ -0,0 +1,26 @@ +Content-Type: text/xml; subtype=gml/2.1.2 + + + +missing + + + 123 + foo + + + diff --git a/demo/tests/expected/wfs11_describe.txt b/demo/tests/expected/wfs11_describe.txt index aad422c2..558730cd 100644 --- a/demo/tests/expected/wfs11_describe.txt +++ b/demo/tests/expected/wfs11_describe.txt @@ -37,4 +37,15 @@ Content-Type: text/xml; subtype=gml/3.1.1; + + + + + + + + + + + \ No newline at end of file diff --git a/demo/tests/expected/wfs11_getcaps.txt b/demo/tests/expected/wfs11_getcaps.txt index 6091c9cf..6af1e862 100644 --- a/demo/tests/expected/wfs11_getcaps.txt +++ b/demo/tests/expected/wfs11_getcaps.txt @@ -126,6 +126,10 @@ Content-Type: application/xml urn:ogc:def:crs:EPSG::27582 -6.091001 41.347435 10.812651 50.803540 + + tows:geometry_less + Geometry less layer + diff --git a/demo/tests/expected/wfs11_getfeatures_geometry_less.txt b/demo/tests/expected/wfs11_getfeatures_geometry_less.txt new file mode 100644 index 00000000..ac971085 --- /dev/null +++ b/demo/tests/expected/wfs11_getfeatures_geometry_less.txt @@ -0,0 +1,25 @@ +Content-Type: text/xml; subtype=gml/3.1.1 + + + + + + 123 + foo + + + diff --git a/demo/tests/input/wfs10_getfeatures_geometry_less.txt b/demo/tests/input/wfs10_getfeatures_geometry_less.txt new file mode 100644 index 00000000..d1717a24 --- /dev/null +++ b/demo/tests/input/wfs10_getfeatures_geometry_less.txt @@ -0,0 +1 @@ +service=WFS&version=1.0.0&request=GetFeature&typename=tows:geometry_less diff --git a/demo/tests/input/wfs11_getfeatures_geometry_less.txt b/demo/tests/input/wfs11_getfeatures_geometry_less.txt new file mode 100644 index 00000000..ba9d23c6 --- /dev/null +++ b/demo/tests/input/wfs11_getfeatures_geometry_less.txt @@ -0,0 +1 @@ +service=WFS&version=1.1.0&request=GetFeature&typename=tows:geometry_less diff --git a/demo/tests/transactions/input/wfst11_geometry_less_insert.xml b/demo/tests/transactions/input/wfst11_geometry_less_insert.xml new file mode 100644 index 00000000..869f7072 --- /dev/null +++ b/demo/tests/transactions/input/wfst11_geometry_less_insert.xml @@ -0,0 +1,18 @@ + + + + + -1234 + minus 1234 + + + diff --git a/demo/tinyows_no_checkschema.xml b/demo/tinyows_no_checkschema.xml index 1ec6237e..65bcee86 100644 --- a/demo/tinyows_no_checkschema.xml +++ b/demo/tinyows_no_checkschema.xml @@ -21,4 +21,11 @@ name="france" title="French Administrative Sub Boundaries (IGN - GeoFLA Departements)" /> + + diff --git a/src/ows/ows_geobbox.c b/src/ows/ows_geobbox.c index 6e0619cc..80d82d06 100644 --- a/src/ows/ows_geobbox.c +++ b/src/ows/ows_geobbox.c @@ -157,17 +157,18 @@ ows_geobbox *ows_geobbox_compute(ows * o, buffer * layer_name) PGresult *res; ows_geobbox *g; ows_bbox *bb; - list *geom; - list_node *ln; + const list *geom; + const list_node *ln; bool first = true; assert(o); assert(layer_name); - sql = buffer_init(); - geom = ows_psql_geometry_column(o, layer_name); - assert(geom); + if( geom->first == NULL ) + return NULL; + + sql = buffer_init(); g = ows_geobbox_init(); xmin = ymin = xmax = ymax = 0.0; diff --git a/src/ows/ows_storage.c b/src/ows/ows_storage.c index 17cacfbf..850fcbc8 100644 --- a/src/ows/ows_storage.c +++ b/src/ows/ows_storage.c @@ -437,34 +437,28 @@ static void ows_layer_storage_fill(ows * o, ows_layer * l, bool is_geom) res = ows_psql_exec(o, sql->buf); buffer_empty(sql); - if (PQresultStatus(res) != PGRES_TUPLES_OK || PQntuples(res) == 0) { - PQclear(res); - - ows_error(o, OWS_ERROR_REQUEST_SQL_FAILED, - "All config file layers are not availables in geometry_columns or geography_columns", - "storage"); - return; - } + if (PQresultStatus(res) == PGRES_TUPLES_OK && PQntuples(res) > 0) { - l->storage->srid = atoi(PQgetvalue(res, 0, 0)); + l->storage->srid = atoi(PQgetvalue(res, 0, 0)); - for (i = 0, end = PQntuples(res); i < end; i++) - list_add_str(l->storage->geom_columns, PQgetvalue(res, i, 1)); + for (i = 0, end = PQntuples(res); i < end; i++) + list_add_str(l->storage->geom_columns, PQgetvalue(res, i, 1)); - buffer_add_str(sql, "SELECT * FROM spatial_ref_sys WHERE srid="); - buffer_add_str(sql, PQgetvalue(res, 0, 0)); - buffer_add_str(sql, " AND proj4text like '%%units=m%%'"); + buffer_add_str(sql, "SELECT * FROM spatial_ref_sys WHERE srid="); + buffer_add_str(sql, PQgetvalue(res, 0, 0)); + buffer_add_str(sql, " AND proj4text like '%%units=m%%'"); - PQclear(res); + PQclear(res); - res = ows_psql_exec(o, sql->buf); - buffer_free(sql); + res = ows_psql_exec(o, sql->buf); + buffer_free(sql); - if (PQntuples(res) != 1) - l->storage->is_geographic = true; - else - l->storage->is_geographic = false; + if (PQntuples(res) != 1) + l->storage->is_geographic = true; + else + l->storage->is_geographic = false; + } PQclear(res); ows_storage_fill_pkey(o, l); @@ -539,8 +533,7 @@ void ows_layers_storage_fill(ows * o) } if (!filled) { - if (ln->layer->storage) ows_layer_storage_free(ln->layer->storage); - ln->layer->storage = NULL; + ows_layer_storage_fill(o, ln->layer, false); } } diff --git a/src/wfs/wfs_get_capabilities.c b/src/wfs/wfs_get_capabilities.c index ecf56bec..4b12bad6 100644 --- a/src/wfs/wfs_get_capabilities.c +++ b/src/wfs/wfs_get_capabilities.c @@ -209,9 +209,6 @@ static void wfs_feature_type_list(ows * o) ows_layer_node *ln; ows_geobbox *gb; - int srid_int; - buffer *srid; - buffer *srs; list_node *keyword, *l_srid; int s; bool writable, retrievable; @@ -311,33 +308,43 @@ static void wfs_feature_type_list(ows * o) } /* SRS */ - srid = buffer_init(); - srid_int = ows_srs_get_srid_from_layer(o, ln->layer->name); - buffer_add_int(srid, srid_int); - srs = ows_srs_get_from_a_srid(o, srid_int); - - if (srs->use) { - if (ows_version_get(o->request->version) == 100) { - fprintf(o->output, " "); - buffer_flush(srs, o->output); - fprintf(o->output, "\n"); - } else if (ows_version_get(o->request->version) == 110) { - fprintf(o->output, " urn:ogc:def:crs:EPSG::%s\n", srid->buf); - - if (ln->layer->srid) { - for (l_srid = ln->layer->srid->first; l_srid; l_srid = l_srid->next) { - if (!buffer_cmp(srid, l_srid->value->buf)) { - fprintf(o->output, " urn:ogc:def:crs:EPSG::%s\n", l_srid->value->buf); + { + buffer *srs = NULL; + + buffer* srid = buffer_init(); + int srid_int = ows_srs_get_srid_from_layer(o, ln->layer->name); + buffer_add_int(srid, srid_int); + if( srid_int != -1 ) + srs = ows_srs_get_from_a_srid(o, srid_int); + + if (srs && srs->use) { + if (ows_version_get(o->request->version) == 100) { + fprintf(o->output, " "); + buffer_flush(srs, o->output); + fprintf(o->output, "\n"); + } else if (ows_version_get(o->request->version) == 110) { + fprintf(o->output, " urn:ogc:def:crs:EPSG::%s\n", srid->buf); + + if (ln->layer->srid) { + for (l_srid = ln->layer->srid->first; l_srid; l_srid = l_srid->next) { + if (!buffer_cmp(srid, l_srid->value->buf)) { + fprintf(o->output, " urn:ogc:def:crs:EPSG::%s\n", l_srid->value->buf); + } + } } } + } else { + if (ows_version_get(o->request->version) == 100) + fprintf(o->output, " \n"); + else if (ows_version_get(o->request->version) == 110) + fprintf(o->output, " "); } - } - } else { - if (ows_version_get(o->request->version) == 100) - fprintf(o->output, " \n"); - else if (ows_version_get(o->request->version) == 110) - fprintf(o->output, " "); + + buffer_free(srid); + if( srs ) + buffer_free(srs); } + /* Operations */ if (retrievable != ln->layer->retrievable || writable != ln->layer->writable) { fprintf(o->output, " \n"); @@ -374,59 +381,59 @@ static void wfs_feature_type_list(ows * o) gb->south = ln->layer->geobbox->south; gb->north = ln->layer->geobbox->north; } - assert(gb); - - for (s = 0; s < ln->layer->depth; s++) fprintf(o->output, " "); - - if (ows_version_get(o->request->version) == 100) - fprintf(o->output, " request->version) == 110) - fprintf(o->output, " "); - - if (gb->east != DBL_MIN) { - if (ows_version_get(o->request->version) == 100) { - if (gb->west < gb->east) - fprintf(o->output, " minx='%.*f'", o->degree_precision, gb->west); - else - fprintf(o->output, " minx='%.*f'", o->degree_precision, gb->east); - - if (gb->north < gb->south) - fprintf(o->output, " miny='%.*f'", o->degree_precision, gb->north); - else - fprintf(o->output, " miny='%.*f'", o->degree_precision, gb->south); - - if (gb->west < gb->east) - fprintf(o->output, " maxx='%.*f'", o->degree_precision, gb->east); - else - fprintf(o->output, " maxx='%.*f'", o->degree_precision, gb->west); - - if (gb->north < gb->south) - fprintf(o->output, " maxy='%.*f'", o->degree_precision, gb->south); - else - fprintf(o->output, " maxy='%.*f'", o->degree_precision, gb->north); - - fprintf(o->output, " />\n"); - } else if (ows_version_get(o->request->version) == 110) { - fprintf(o->output, " %.*f %.*f", - o->degree_precision, gb->west, o->degree_precision, gb->south); - fprintf(o->output, " %.*f %.*f", - o->degree_precision, gb->east, o->degree_precision, gb->north); - } - } else { - if (ows_version_get(o->request->version) == 100) { - fprintf(o->output, " minx='0' miny='0' maxx='0' maxy='0'/>\n"); - } else if (ows_version_get(o->request->version) == 110) { - fprintf(o->output, " 0 0"); - fprintf(o->output, " 0 0"); - } - } - if (ows_version_get(o->request->version) == 110) - fprintf(o->output, " \n"); + if( gb ) + { + for (s = 0; s < ln->layer->depth; s++) fprintf(o->output, " "); - buffer_free(srid); - buffer_free(srs); - ows_geobbox_free(gb); + if (ows_version_get(o->request->version) == 100) + fprintf(o->output, " request->version) == 110) + fprintf(o->output, " "); + + if (gb->east != DBL_MIN) { + if (ows_version_get(o->request->version) == 100) { + if (gb->west < gb->east) + fprintf(o->output, " minx='%.*f'", o->degree_precision, gb->west); + else + fprintf(o->output, " minx='%.*f'", o->degree_precision, gb->east); + + if (gb->north < gb->south) + fprintf(o->output, " miny='%.*f'", o->degree_precision, gb->north); + else + fprintf(o->output, " miny='%.*f'", o->degree_precision, gb->south); + + if (gb->west < gb->east) + fprintf(o->output, " maxx='%.*f'", o->degree_precision, gb->east); + else + fprintf(o->output, " maxx='%.*f'", o->degree_precision, gb->west); + + if (gb->north < gb->south) + fprintf(o->output, " maxy='%.*f'", o->degree_precision, gb->south); + else + fprintf(o->output, " maxy='%.*f'", o->degree_precision, gb->north); + + fprintf(o->output, " />\n"); + } else if (ows_version_get(o->request->version) == 110) { + fprintf(o->output, " %.*f %.*f", + o->degree_precision, gb->west, o->degree_precision, gb->south); + fprintf(o->output, " %.*f %.*f", + o->degree_precision, gb->east, o->degree_precision, gb->north); + } + } else { + if (ows_version_get(o->request->version) == 100) { + fprintf(o->output, " minx='0' miny='0' maxx='0' maxy='0'/>\n"); + } else if (ows_version_get(o->request->version) == 110) { + fprintf(o->output, " 0 0"); + fprintf(o->output, " 0 0"); + } + } + + if (ows_version_get(o->request->version) == 110) + fprintf(o->output, " \n"); + + ows_geobbox_free(gb); + } fprintf(o->output, "\n"); } From e1c2c187d3404fd50a147ce8edb9a0aae0debf34 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 26 Apr 2021 17:10:25 +0200 Subject: [PATCH 23/61] Fix crash when invalid 'pkey' is specified in configuration file --- src/ows/ows_psql.c | 21 --------------------- src/ows/ows_storage.c | 33 +++++++-------------------------- src/ows_api.h | 1 - src/ows_struct.h | 1 - 4 files changed, 7 insertions(+), 49 deletions(-) diff --git a/src/ows/ows_psql.c b/src/ows/ows_psql.c index cc6076cd..b480d9f6 100644 --- a/src/ows/ows_psql.c +++ b/src/ows/ows_psql.c @@ -70,27 +70,6 @@ PGresult * ows_psql_exec(ows *o, const char *sql) } -/* - * Return the column number of the id column from table matching layer name - * (needed in wfs_get_feature only) - */ -int ows_psql_column_number_id_column(ows * o, buffer * layer_name) -{ - ows_layer_node *ln = NULL; - - assert(o); - assert(o->layers); - assert(layer_name); - - for (ln = o->layers->first ; ln ; ln = ln->next) - if (ln->layer->name && ln->layer->storage - && !strcmp(ln->layer->name->buf, layer_name->buf)) - return ln->layer->storage->pkey_column_number; - - return -1; -} - - /* * Return geometry columns from the table matching layer name */ diff --git a/src/ows/ows_storage.c b/src/ows/ows_storage.c index 850fcbc8..514a0ed5 100644 --- a/src/ows/ows_storage.c +++ b/src/ows/ows_storage.c @@ -44,7 +44,6 @@ ows_layer_storage * ows_layer_storage_init() storage->pkey = NULL; storage->pkey_sequence = NULL; storage->pkey_default = NULL; - storage->pkey_column_number = -1; storage->attributes = array_init(); storage->not_null_columns = NULL; @@ -103,8 +102,6 @@ void ows_layer_storage_flush(ows_layer_storage * storage, FILE * output) fprintf(output, "\n"); } - fprintf(output, "pkey_column_number: %i\n", storage->pkey_column_number); - if (storage->pkey_sequence) { fprintf(output, "pkey_sequence: "); buffer_flush(storage->pkey_sequence, output); @@ -225,28 +222,6 @@ static void ows_storage_fill_pkey(ows * o, ows_layer * l) buffer_empty(sql); PQclear(res); - /* Retrieve the Pkey column number */ - buffer_add_str(sql, "SELECT a.attnum FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n"); - buffer_add_str(sql, " WHERE a.attrelid = c.oid AND a.atttypid = t.oid AND n.nspname='"); - buffer_copy(sql, l->storage->schema); - buffer_add_str(sql, "' AND c.relname='"); - buffer_copy(sql, l->storage->table); - buffer_add_str(sql, "' AND a.attname='"); - buffer_copy(sql, l->storage->pkey); - buffer_add_str(sql, "'"); - res = ows_psql_exec(o, sql->buf); - if (PQresultStatus(res) != PGRES_TUPLES_OK) { - PQclear(res); - buffer_free(sql); - ows_error(o, OWS_ERROR_REQUEST_SQL_FAILED, "Unable to find pkey column number.", "pkey_column number"); - return; - } - - /* -1 because column number start at 1 */ - l->storage->pkey_column_number = atoi(PQgetvalue(res, 0, 0)) - 1; - buffer_empty(sql); - PQclear(res); - /* Now try to find a sequence related to this Pkey */ buffer_add_str(sql, "SELECT pg_get_serial_sequence('"); buffer_copy(sql, l->storage->schema); @@ -258,10 +233,16 @@ static void ows_storage_fill_pkey(ows * o, ows_layer * l) res = ows_psql_exec(o, sql->buf); if (PQresultStatus(res) != PGRES_TUPLES_OK) { + char message[256]; + snprintf(message, sizeof(message), + "Unable to use pg_get_serial_sequence(%s, %s, %s).", + l->storage->schema->buf, + l->storage->table->buf, + l->storage->pkey->buf); PQclear(res); buffer_free(sql); ows_error(o, OWS_ERROR_REQUEST_SQL_FAILED, - "Unable to use pg_get_serial_sequence.", "pkey_sequence retrieve"); + message, "pkey_sequence retrieve"); return; } diff --git a/src/ows_api.h b/src/ows_api.h index 01e21db1..a0805128 100644 --- a/src/ows_api.h +++ b/src/ows_api.h @@ -185,7 +185,6 @@ buffer *ows_psql_id_column (ows * o, buffer * layer_name); buffer *ows_psql_column_constraint_name(ows * o, buffer * column_name, buffer * table_name); list *ows_psql_column_check_constraint(ows * o, buffer * constraint_name); buffer *ows_psql_column_character_maximum_length(ows * o, buffer * column_name, buffer * table_name); -int ows_psql_column_number_id_column(ows * o, buffer * layer_name); bool ows_psql_is_geometry_column (ows * o, buffer * layer_name, buffer * column); bool ows_psql_is_geometry_valid(ows * o, buffer * geom); list *ows_psql_not_null_properties (ows * o, buffer * layer_name); diff --git a/src/ows_struct.h b/src/ows_struct.h index 6b1d8818..0805a5b2 100644 --- a/src/ows_struct.h +++ b/src/ows_struct.h @@ -107,7 +107,6 @@ typedef struct Ows_layer_storage { buffer * pkey; buffer * pkey_sequence; buffer * pkey_default; - int pkey_column_number; bool is_geographic; /* true for a geographic CRS (or a compound CRS whose base is geographic), false for a projected CRS (or a compound CRS whose base is projected) */ From 54a4d8a98c7b81db88ec45c3acf9f960e51fb1d5 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 27 Apr 2021 09:05:52 +0200 Subject: [PATCH 24/61] ows_layer_storage_fill(): fix crash when several bad configured layers are found --- src/ows/ows_storage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ows/ows_storage.c b/src/ows/ows_storage.c index 514a0ed5..0b486d54 100644 --- a/src/ows/ows_storage.c +++ b/src/ows/ows_storage.c @@ -443,7 +443,9 @@ static void ows_layer_storage_fill(ows * o, ows_layer * l, bool is_geom) PQclear(res); ows_storage_fill_pkey(o, l); + if( o->exit ) return; ows_storage_fill_attributes(o, l); + if( o->exit ) return; ows_storage_fill_not_null(o, l); } @@ -501,6 +503,7 @@ void ows_layers_storage_fill(ows * o) if ( buffer_cmp(ln->layer->storage->schema, (char *) PQgetvalue(res, i, 0)) && buffer_cmp(ln->layer->storage->table, (char *) PQgetvalue(res, i, 1))) { ows_layer_storage_fill(o, ln->layer, true); + if( o->exit ) break; filled = true; } } @@ -509,12 +512,14 @@ void ows_layers_storage_fill(ows * o) if ( buffer_cmp(ln->layer->storage->schema, (char *) PQgetvalue(res_g, i, 0)) && buffer_cmp(ln->layer->storage->table, (char *) PQgetvalue(res_g, i, 1))) { ows_layer_storage_fill(o, ln->layer, false); + if( o->exit ) break; filled = true; } } if (!filled) { ows_layer_storage_fill(o, ln->layer, false); + if( o->exit ) break; } } From 81ef81c1f3652378441dec85b10e38ecd9807a1b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 27 Apr 2021 11:34:24 +0200 Subject: [PATCH 25/61] Do not list non-existing tables --- demo/tinyows_no_checkschema.xml | 7 +++++++ src/ows/ows_storage.c | 26 ++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/demo/tinyows_no_checkschema.xml b/demo/tinyows_no_checkschema.xml index 65bcee86..9fd3f951 100644 --- a/demo/tinyows_no_checkschema.xml +++ b/demo/tinyows_no_checkschema.xml @@ -28,4 +28,11 @@ name="geometry_less" title="Geometry less layer" /> + + diff --git a/src/ows/ows_storage.c b/src/ows/ows_storage.c index 0b486d54..43d69c84 100644 --- a/src/ows/ows_storage.c +++ b/src/ows/ows_storage.c @@ -518,8 +518,30 @@ void ows_layers_storage_fill(ows * o) } if (!filled) { - ows_layer_storage_fill(o, ln->layer, false); - if( o->exit ) break; + PGresult* res_t; + + sql = buffer_init(); + buffer_add_str(sql, "SELECT 1 FROM information_schema.tables WHERE table_schema='"); + buffer_copy(sql, ln->layer->storage->schema); + buffer_add_str(sql,"' and table_name='"); + buffer_copy(sql, ln->layer->storage->table); + buffer_add_str(sql,"'"); + res_t = ows_psql_exec(o, sql->buf); + buffer_free(sql); + if (PQresultStatus(res_t) == PGRES_TUPLES_OK && PQntuples(res_t) > 0) { + filled = true; + } + PQclear(res_t); + + if (filled) { + ows_layer_storage_fill(o, ln->layer, false); + if( o->exit ) break; + } + } + + if (!filled) { + if (ln->layer->storage) ows_layer_storage_free(ln->layer->storage); + ln->layer->storage = NULL; } } From 9a77deb26372ba3b57770d9de9edd8d660e4fc2a Mon Sep 17 00:00:00 2001 From: jmckenna Date: Fri, 11 Jun 2021 11:39:50 -0300 Subject: [PATCH 26/61] update for 1.2.0 release --- VERSION | 2 +- doc/Doxyfile | 2 +- src/ows_define.h.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 524cb552..26aaba0e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.1 +1.2.0 diff --git a/doc/Doxyfile b/doc/Doxyfile index a44e8b91..5cebf81c 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -23,7 +23,7 @@ PROJECT_NAME = tinyows # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.1.0 +PROJECT_NUMBER = 1.2.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/src/ows_define.h.in b/src/ows_define.h.in index aebf6c8a..d3ff65dd 100644 --- a/src/ows_define.h.in +++ b/src/ows_define.h.in @@ -28,7 +28,7 @@ #define OWS_DEBUG #endif -#define TINYOWS_VERSION "1.1.0" +#define TINYOWS_VERSION "1.2.0" #define TINYOWS_FCGI @USE_FCGI@ #define OWS_CONFIG_FILE_PATH "/etc/tinyows.xml" From d859249e9146fff22ce2c4c5428d79fee1e5f953 Mon Sep 17 00:00:00 2001 From: jmckenna Date: Fri, 11 Jun 2021 11:47:49 -0300 Subject: [PATCH 27/61] update for 1.2.0 release --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..7cbea683 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +TinyOWS is a simple WFS-T server based on PostGIS spatial database. + +TinyOWS was written with the following things in mind: +- KISS approach ! +- As OGC standard compliant as possible, aiming to support: + - WFS (1.0 and 1.1) + - FE (1.0 and 1.1) +- Performance is a matter, maps are cool as they're quick to display +- Clean source code + + +Code quality policy: +All code must meet the following rules : +- gcc -c99 -pedantic -Wall compile without any warning (make) +- Unit test with Valgrind error and leak free (make valgrind) +- Pass trought OGC CITE WFS-T tests (1.0.0 and 1.1.0 SF-0) + +Code dynamically linked with the following other librairies: +- PostgreSQL 8.x and 9.x +- libxml 2.9.x +- flex From 479da1eb03473c04e4b55cb4fd6a0bafc333deea Mon Sep 17 00:00:00 2001 From: jmckenna Date: Fri, 11 Jun 2021 12:16:40 -0300 Subject: [PATCH 28/61] update for 1.2.0 release --- LICENSE | 2 +- NEWS | 24 +++++++++++++++++++----- README.md | 23 +++++++++++++++++++---- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index 5a2e4e62..d32f01f0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) <2007-2012> +Copyright (c) <2007-2021> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NEWS b/NEWS index e4374ffb..438fb1a8 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,19 @@ -1.1.0 +1.2.0 (2021-06-11) *in memory of Olivier Courtin* + - Fix custom types conversion (Vincent Mora) + - Add support for geometry-less tables (Even Rouault) + - Do not list non-existing tables (Even Rouault) + - ows_layer_storage_fill(): fix crash when several bad configured layers are found (Even Rouault) + - Fix crash when invalid 'pkey' is specified in configuration file (Even Rouault) + - Implement matchCase for PropertyIsLike filter (Louis Jencka) + - Fix axis order issue on GetFeature 1.1 (Even Rouault) + - Avoid repeated prefix of the typename (Even Rouault) + - fe_distance_functions(): fix crashes / incorrect behaviour (Even Rouault) + - Fix unable to use separator chars as underscore in typename (Olivier Courtin) + +1.1.1 (2015-06-29) + - security release (Olivier Courtin) + +1.1.0 (2012-11-13) - Add include_items and exclude_items config handling. To choose exactly which columns to retrieve (Serge Dikiy) - XSD max length and enumeration constraint handling (Serge Dikiy & Alan Boudreault) - First real support of typename namespace provided in request (Olivier Courtin) @@ -9,7 +24,7 @@ - Extent layer's properties allowed to inherit (Olivier Courtin) - Several bugfixes as usual (special thanks to Andreas Peri, Serge Dikiy and Jukka Rahkonen for detailled reports) -1.0.0 (08/02/2012) +1.0.0 (2012-02-08) - Configuration change with broken backward compatibility: * default config file is now /etc/tinyows.xml * default schema dir is now $PREFIX/share/tinyows/schema @@ -33,14 +48,13 @@ - Lot of debug stuff (a special thanks to Boris Leukert, Jukka Rahkonen and Even Rouault for detailled reports) - Security fixes (SQL Injection vulnerability - Reported by Even Rouault) - -0.9.0 (19/06/2010) +0.9.0 (2010-06-19) - Fast-CGI support - Error log handle - Improve --check behaviour - And a still a lot of debug stuff -0.8.0 (01/05/2010) +0.8.0 (2010-05-01) - PostgreSQL schema support - Command line --check option, to check configure stuff - JSON output format for GetFeature (use OUTPUTFORMAT=application/json) diff --git a/README.md b/README.md index 7cbea683..41e2c887 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,36 @@ +# TinyOWS + TinyOWS is a simple WFS-T server based on PostGIS spatial database. +## Documentation Home + +https://mapserver.org/tinyows/ + +## Approach + TinyOWS was written with the following things in mind: - KISS approach ! - As OGC standard compliant as possible, aiming to support: - WFS (1.0 and 1.1) - FE (1.0 and 1.1) -- Performance is a matter, maps are cool as they're quick to display +- Performance is important, maps are cool when they're quick to display - Clean source code +## Code quality policy -Code quality policy: All code must meet the following rules : - gcc -c99 -pedantic -Wall compile without any warning (make) - Unit test with Valgrind error and leak free (make valgrind) -- Pass trought OGC CITE WFS-T tests (1.0.0 and 1.1.0 SF-0) +- Pass throught OGC CITE WFS-T tests (1.0.0 and 1.1.0 SF-0) Code dynamically linked with the following other librairies: -- PostgreSQL 8.x and 9.x +- PostgreSQL - libxml 2.9.x - flex + +## Credits + +In memory of Olivier Courtin, the original developer of TinyOWS and +visionary. + + From b04ae50338fa0034b80d70ef793c153db6cb4ba0 Mon Sep 17 00:00:00 2001 From: jmckenna Date: Fri, 11 Jun 2021 12:16:50 -0300 Subject: [PATCH 29/61] update for 1.2.0 release --- README | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 README diff --git a/README b/README deleted file mode 100644 index 7cbea683..00000000 --- a/README +++ /dev/null @@ -1,21 +0,0 @@ -TinyOWS is a simple WFS-T server based on PostGIS spatial database. - -TinyOWS was written with the following things in mind: -- KISS approach ! -- As OGC standard compliant as possible, aiming to support: - - WFS (1.0 and 1.1) - - FE (1.0 and 1.1) -- Performance is a matter, maps are cool as they're quick to display -- Clean source code - - -Code quality policy: -All code must meet the following rules : -- gcc -c99 -pedantic -Wall compile without any warning (make) -- Unit test with Valgrind error and leak free (make valgrind) -- Pass trought OGC CITE WFS-T tests (1.0.0 and 1.1.0 SF-0) - -Code dynamically linked with the following other librairies: -- PostgreSQL 8.x and 9.x -- libxml 2.9.x -- flex From 4667912ec9d629ba8f3457886e19debd159e8b80 Mon Sep 17 00:00:00 2001 From: jmckenna Date: Sat, 12 Jun 2021 14:19:29 -0300 Subject: [PATCH 30/61] handle mapfile check --- src/mapfile/mapfile.c | 1042 ++++++++++++++++++----------------------- src/mapfile/mapfile.l | 3 +- 2 files changed, 450 insertions(+), 595 deletions(-) diff --git a/src/mapfile/mapfile.c b/src/mapfile/mapfile.c index 742a6716..899d09c3 100644 --- a/src/mapfile/mapfile.c +++ b/src/mapfile/mapfile.c @@ -54,7 +54,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -141,7 +142,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -153,12 +162,7 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern yy_size_t yyleng; +extern int yyleng; extern FILE *yyin, *yyout; @@ -184,6 +188,11 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -201,7 +210,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - yy_size_t yy_n_chars; + int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -271,8 +280,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -yy_size_t yyleng; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -300,7 +309,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -461,11 +470,11 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 1, 1, 1, 1, 7, 1, 34, 35, 36, 37, + 1, 1, 1, 1, 7, 1, 29, 29, 29, 29, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 29, 55, 56, - 57, 58, 1, 1, 1, 1, 1, 1, 1, 1, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -482,96 +491,94 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[59] = +static yyconst flex_int32_t yy_meta[34] = { 0, 1, 2, 2, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3 + 3, 3, 3 } ; static yyconst flex_int16_t yy_base[706] = { 0, - 0, 45, 82, 0, 133, 0, 7, 20, 29, 52, - 72, 152, 181, 192, 203, 208, 214, 229, 267, 316, - 365, 418, 462, 0, 507, 558, 80, 120, 235, 240, - 609, 0, 658, 0, 241, 242, 706, 0, 243, 260, - 287, 288, 295, 333, 757, 806, 339, 340, 855, 898, - 941, 986, 341, 342, 385, 386, 391, 394, 373, 1613, - 1613, 1613, 360, 1613, 337, 13, 16, 9, 22, 11, - 40, 95, 105, 60, 43, 48, 116, 135, 193, 138, - 139, 388, 141, 153, 181, 191, 404, 226, 1613, 1613, - 338, 326, 327, 321, 0, 26, 12, 0, 254, 0, - - 78, 292, 0, 278, 309, 306, 293, 290, 0, 288, - 288, 0, 303, 323, 407, 433, 432, 338, 405, 436, - 452, 450, 455, 437, 453, 448, 473, 444, 481, 488, - 483, 488, 485, 491, 493, 509, 509, 502, 503, 506, - 509, 509, 505, 510, 522, 520, 538, 543, 538, 557, - 545, 560, 547, 550, 565, 567, 240, 237, 238, 1613, - 231, 565, 567, 556, 559, 555, 562, 578, 54, 576, - 572, 571, 585, 605, 606, 612, 614, 606, 610, 622, - 609, 609, 616, 631, 633, 630, 58, 623, 639, 220, - 1613, 209, 198, 1613, 194, 0, 165, 188, 0, 444, - - 155, 658, 0, 178, 153, 0, 669, 117, 662, 116, - 1613, 71, 68, 1613, 63, 0, 666, 653, 0, 671, - 655, 678, 668, 664, 676, 689, 679, 679, 704, 703, - 705, 716, 703, 711, 721, 166, 707, 715, 717, 221, - 732, 234, 723, 748, 734, 730, 755, 739, 743, 293, - 751, 761, 766, 762, 772, 765, 760, 772, 420, 782, - 782, 773, 787, 776, 780, 795, 797, 812, 803, 808, - 35, 1613, 19, 1613, 809, 1613, 816, 822, 805, 821, - 824, 825, 826, 816, 823, 818, 835, 834, 834, 858, - 847, 1613, 845, 852, 851, 869, 867, 1613, 855, 876, - - 863, 1613, 0, 1613, 0, 0, 860, 0, 877, 864, - 870, 887, 876, 878, 882, 895, 912, 896, 915, 906, - 917, 922, 920, 913, 907, 1613, 914, 913, 926, 931, - 928, 942, 940, 939, 951, 949, 962, 955, 948, 966, - 970, 955, 965, 963, 964, 966, 975, 973, 991, 990, - 1002, 992, 1002, 999, 998, 1010, 996, 1010, 1014, 1006, - 1002, 1015, 1011, 1010, 1025, 1013, 1024, 1613, 1018, 1035, - 721, 1026, 1042, 1043, 1036, 1040, 1029, 1040, 1054, 1055, - 1056, 1057, 1059, 1055, 1061, 0, 1050, 1066, 1613, 1613, - 1051, 1070, 1071, 1613, 1064, 1076, 1613, 1070, 1079, 1613, - - 1071, 1613, 1086, 1076, 1083, 1087, 1095, 1088, 1092, 1613, - 1100, 1092, 1102, 1103, 1108, 1105, 1100, 1111, 1115, 1103, - 1119, 1613, 1115, 1109, 1613, 1613, 1116, 1120, 1128, 1129, - 1134, 1613, 1613, 1137, 1613, 1123, 1140, 1141, 1150, 1147, - 1135, 1613, 1152, 1137, 1159, 1150, 1159, 1163, 1150, 1155, - 1170, 1613, 1613, 1154, 1155, 1159, 1163, 1178, 1183, 1176, - 1187, 1183, 1169, 1177, 1182, 1613, 1185, 1206, 1203, 1613, - 1189, 1613, 1208, 1613, 1613, 1202, 1215, 1208, 1613, 1198, - 1205, 1205, 1204, 1213, 1613, 1613, 1613, 1218, 1214, 1222, - 1613, 1231, 1613, 1218, 1217, 1613, 1219, 1234, 1613, 1226, - - 1227, 1227, 1613, 1242, 1235, 1255, 1245, 1259, 1260, 1247, - 1247, 1613, 1613, 1267, 1251, 1254, 1251, 1255, 1257, 1260, - 1259, 1260, 1278, 1275, 1613, 1613, 1274, 1269, 1270, 1272, - 1291, 1613, 1279, 1280, 1278, 1302, 1294, 1306, 1613, 1298, - 1308, 1298, 1299, 1613, 1305, 1613, 1613, 1301, 1613, 1306, - 1308, 1318, 1313, 1327, 1313, 1312, 1330, 1331, 1320, 1329, - 1330, 1342, 1345, 0, 1336, 1347, 1345, 1613, 1339, 1353, - 1358, 1363, 1356, 1365, 1366, 1367, 1613, 1370, 1613, 1361, - 1368, 1376, 1356, 1377, 1367, 1379, 1382, 1370, 1377, 1613, - 1388, 1613, 1386, 1375, 1386, 1395, 1613, 1403, 1613, 1613, - - 1386, 1398, 1397, 1410, 1404, 1404, 1613, 1407, 1613, 1613, - 1410, 1409, 1613, 1613, 1410, 1613, 1613, 1406, 1409, 1613, - 1418, 1418, 1613, 1613, 1613, 1433, 1613, 1415, 1420, 1613, - 1425, 1427, 1439, 1613, 1431, 1613, 1434, 1435, 1445, 1441, - 1455, 1613, 1439, 1458, 1613, 1444, 1613, 1458, 1613, 1453, - 1454, 1459, 1613, 1455, 1456, 1613, 1453, 1459, 1465, 1466, - 1472, 1613, 1482, 1472, 1486, 1613, 1613, 1613, 1474, 1491, - 1484, 1484, 1613, 1613, 1613, 1613, 1531, 1534, 1537, 1540, - 1543, 1546, 1549, 1552, 1555, 1558, 1561, 1564, 1567, 1570, - 1573, 1576, 1579, 1582, 1585, 1588, 1591, 18, 5, 1594, - - 1597, 1600, 1603, 1606, 1609 + 0, 19, 30, 0, 56, 0, 82, 101, 120, 131, + 142, 153, 164, 175, 186, 205, 224, 235, 247, 270, + 293, 320, 338, 0, 357, 383, 12, 13, 14, 22, + 409, 0, 432, 0, 42, 43, 455, 0, 61, 62, + 74, 75, 92, 94, 481, 504, 120, 142, 527, 544, + 561, 580, 164, 178, 180, 181, 600, 617, 912, 913, + 913, 913, 907, 913, 904, 888, 887, 899, 884, 897, + 882, 16, 1, 895, 874, 876, 872, 887, 55, 886, + 885, 95, 874, 883, 874, 871, 2, 880, 913, 913, + 887, 884, 885, 882, 0, 115, 90, 0, 866, 0, + + 126, 210, 0, 865, 881, 878, 879, 876, 0, 860, + 858, 0, 858, 853, 79, 36, 183, 852, 864, 853, + 866, 861, 864, 844, 858, 851, 110, 843, 855, 858, + 183, 853, 843, 841, 191, 854, 57, 845, 839, 837, + 837, 835, 828, 830, 838, 828, 844, 839, 830, 841, + 826, 839, 824, 825, 836, 131, 839, 836, 837, 913, + 834, 828, 828, 814, 815, 808, 813, 825, 800, 817, + 810, 802, 806, 815, 813, 817, 816, 803, 802, 812, + 797, 794, 796, 809, 808, 801, 783, 786, 792, 807, + 913, 804, 805, 913, 802, 0, 148, 803, 0, 215, + + 800, 794, 0, 170, 800, 0, 254, 797, 791, 797, + 913, 794, 795, 913, 792, 0, 786, 770, 0, 784, + 766, 785, 771, 764, 770, 781, 769, 765, 84, 778, + 769, 775, 756, 762, 769, 749, 752, 755, 755, 744, + 766, 742, 753, 144, 758, 752, 762, 742, 741, 734, + 746, 754, 750, 744, 192, 741, 734, 744, 726, 750, + 748, 736, 747, 729, 728, 732, 730, 742, 729, 732, + 743, 913, 740, 913, 726, 913, 731, 735, 715, 727, + 728, 727, 726, 714, 719, 710, 722, 714, 709, 722, + 707, 913, 702, 706, 700, 715, 711, 913, 697, 715, + + 699, 913, 0, 913, 0, 0, 694, 0, 708, 693, + 660, 664, 613, 608, 607, 605, 620, 602, 618, 607, + 615, 618, 613, 604, 592, 913, 593, 589, 599, 602, + 594, 603, 588, 583, 590, 586, 597, 583, 572, 586, + 588, 568, 575, 570, 569, 563, 570, 566, 575, 563, + 571, 557, 565, 560, 556, 563, 546, 558, 559, 549, + 541, 552, 544, 537, 550, 536, 538, 913, 530, 544, + 523, 529, 541, 540, 529, 531, 514, 520, 532, 530, + 529, 527, 527, 518, 522, 0, 509, 522, 913, 913, + 505, 518, 517, 913, 505, 515, 913, 507, 514, 913, + + 496, 913, 509, 496, 498, 498, 504, 493, 495, 913, + 501, 487, 495, 494, 495, 490, 483, 489, 491, 477, + 488, 913, 482, 471, 913, 913, 476, 475, 481, 480, + 483, 913, 913, 478, 913, 462, 477, 473, 476, 471, + 455, 913, 469, 452, 466, 455, 462, 464, 449, 452, + 462, 913, 913, 444, 441, 201, 444, 453, 452, 443, + 147, 447, 431, 428, 426, 913, 425, 224, 441, 913, + 421, 913, 438, 913, 913, 426, 436, 427, 913, 414, + 418, 413, 407, 414, 913, 913, 913, 416, 410, 414, + 913, 418, 913, 399, 395, 913, 394, 407, 913, 391, + + 390, 384, 913, 402, 385, 403, 388, 400, 399, 380, + 378, 913, 913, 396, 377, 378, 373, 371, 371, 371, + 368, 367, 381, 376, 913, 913, 370, 363, 362, 360, + 371, 913, 356, 355, 349, 368, 358, 366, 913, 355, + 363, 347, 345, 913, 349, 913, 913, 343, 913, 346, + 346, 351, 343, 355, 339, 336, 348, 344, 327, 331, + 327, 337, 332, 0, 321, 330, 325, 913, 313, 325, + 326, 329, 320, 323, 322, 321, 913, 321, 913, 310, + 315, 318, 287, 306, 294, 304, 303, 289, 291, 913, + 300, 913, 296, 283, 286, 293, 913, 299, 913, 913, + + 278, 284, 281, 290, 282, 272, 913, 269, 913, 913, + 270, 267, 913, 913, 266, 913, 913, 260, 261, 913, + 265, 263, 913, 913, 913, 275, 913, 254, 257, 913, + 258, 258, 257, 913, 247, 913, 248, 247, 249, 243, + 255, 913, 235, 249, 913, 231, 913, 239, 913, 224, + 223, 222, 913, 216, 208, 913, 202, 206, 198, 197, + 199, 913, 192, 170, 179, 913, 913, 913, 117, 97, + 54, 24, 913, 913, 913, 913, 637, 640, 643, 646, + 649, 652, 655, 658, 661, 664, 667, 670, 673, 676, + 679, 682, 685, 688, 691, 694, 697, 8, 5, 700, + + 703, 706, 709, 712, 715 } ; static yyconst flex_int16_t yy_def[706] = @@ -656,380 +663,220 @@ static yyconst flex_int16_t yy_def[706] = 676, 676, 676, 676, 676 } ; -static yyconst flex_int16_t yy_nxt[1672] = +static yyconst flex_int16_t yy_nxt[947] = { 0, - 676, 61, 62, 63, 64, 65, 61, 219, 89, 90, - 91, 66, 92, 201, 201, 67, 164, 199, 166, 68, - 216, 89, 90, 91, 272, 92, 60, 198, 198, 199, - 89, 90, 93, 162, 94, 61, 163, 66, 272, 60, - 66, 67, 164, 165, 166, 68, 61, 62, 63, 64, - 65, 61, 60, 89, 90, 93, 66, 94, 61, 162, - 67, 167, 163, 66, 68, 60, 66, 171, 214, 165, - 172, 214, 173, 61, 62, 96, 211, 97, 98, 205, - 205, 206, 66, 99, 60, 281, 67, 167, 299, 66, - 68, 69, 70, 171, 71, 60, 172, 72, 173, 60, - - 73, 60, 74, 75, 76, 77, 78, 79, 80, 99, - 281, 81, 169, 299, 168, 163, 170, 69, 70, 211, - 71, 60, 304, 72, 60, 60, 73, 60, 74, 75, - 76, 77, 78, 79, 80, 60, 81, 60, 169, 60, - 168, 163, 170, 174, 82, 83, 175, 84, 85, 179, - 180, 86, 87, 61, 62, 96, 304, 97, 98, 88, - 302, 60, 183, 99, 184, 60, 198, 198, 199, 174, - 82, 83, 175, 84, 85, 179, 180, 86, 87, 205, - 205, 206, 89, 90, 101, 88, 102, 103, 183, 99, - 184, 302, 104, 89, 90, 101, 325, 102, 103, 194, - - 185, 194, 176, 104, 89, 90, 105, 177, 106, 89, - 90, 105, 186, 106, 191, 89, 90, 107, 104, 108, - 61, 325, 60, 191, 178, 66, 185, 60, 176, 104, - 89, 90, 107, 177, 108, 61, 160, 189, 186, 60, - 66, 160, 272, 272, 60, 60, 60, 60, 60, 178, - 60, 66, 329, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 189, 60, 331, 66, 60, 61, 62, - 63, 60, 65, 61, 202, 60, 60, 329, 110, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 111, - 331, 60, 60, 208, 208, 214, 214, 206, 209, 60, - - 202, 60, 60, 60, 110, 60, 60, 60, 217, 218, - 60, 211, 211, 147, 60, 111, 60, 61, 62, 63, - 60, 65, 61, 220, 209, 340, 194, 110, 60, 60, - 194, 191, 60, 60, 217, 218, 60, 60, 111, 147, - 60, 191, 160, 60, 60, 60, 60, 221, 60, 220, - 340, 147, 60, 110, 149, 149, 60, 60, 150, 150, - 60, 60, 229, 160, 111, 60, 61, 62, 63, 60, - 65, 61, 676, 221, 60, 676, 113, 147, 60, 676, - 149, 149, 60, 60, 150, 150, 60, 60, 229, 60, - 60, 114, 676, 676, 157, 60, 158, 157, 60, 158, - - 60, 60, 113, 676, 60, 60, 60, 181, 162, 60, - 60, 187, 182, 60, 676, 188, 230, 114, 60, 61, - 62, 63, 60, 65, 61, 222, 60, 60, 223, 113, - 60, 60, 60, 181, 162, 60, 60, 187, 182, 60, - 224, 188, 230, 226, 114, 201, 201, 227, 676, 199, - 676, 222, 349, 228, 223, 113, 676, 231, 676, 232, - 225, 233, 234, 235, 236, 237, 224, 676, 239, 226, - 114, 115, 116, 227, 117, 118, 119, 349, 120, 228, - 121, 122, 123, 231, 76, 232, 225, 233, 234, 235, - 236, 237, 240, 162, 239, 241, 676, 115, 116, 244, - - 117, 118, 119, 238, 120, 245, 121, 122, 123, 242, - 76, 60, 246, 676, 243, 247, 249, 252, 240, 162, - 248, 241, 124, 253, 250, 244, 60, 254, 238, 255, - 256, 245, 257, 125, 258, 242, 126, 259, 246, 243, - 251, 247, 249, 252, 260, 261, 248, 676, 124, 253, - 250, 676, 60, 254, 262, 255, 256, 263, 257, 125, - 258, 126, 60, 259, 264, 251, 265, 266, 267, 268, - 260, 261, 269, 124, 249, 274, 275, 60, 276, 277, - 262, 278, 279, 263, 125, 280, 676, 126, 270, 282, - 264, 283, 265, 266, 267, 268, 676, 284, 269, 124, - - 249, 274, 275, 60, 276, 277, 285, 278, 279, 676, - 125, 280, 126, 60, 270, 282, 286, 283, 287, 288, - 127, 289, 128, 284, 60, 290, 129, 130, 60, 291, - 292, 293, 285, 294, 131, 132, 676, 295, 296, 676, - 297, 676, 286, 298, 287, 288, 127, 289, 128, 300, - 60, 290, 129, 130, 60, 291, 292, 293, 301, 294, - 131, 132, 60, 295, 296, 133, 297, 134, 303, 298, - 208, 208, 305, 60, 206, 300, 306, 60, 307, 135, - 136, 308, 309, 137, 301, 310, 676, 138, 311, 676, - 312, 133, 676, 134, 303, 313, 314, 315, 305, 60, - - 316, 676, 306, 60, 307, 135, 136, 308, 309, 137, - 319, 310, 138, 139, 311, 140, 312, 141, 142, 317, - 320, 313, 314, 315, 321, 318, 316, 143, 144, 322, - 323, 145, 324, 326, 676, 146, 319, 327, 328, 139, - 330, 140, 332, 141, 142, 317, 320, 335, 336, 676, - 321, 318, 446, 143, 144, 322, 323, 145, 324, 326, - 146, 60, 337, 327, 328, 338, 330, 333, 332, 339, - 341, 342, 60, 335, 336, 147, 60, 446, 334, 343, - 344, 345, 274, 148, 676, 346, 347, 348, 337, 350, - 351, 338, 352, 333, 353, 339, 341, 342, 60, 676, - - 354, 147, 60, 334, 355, 343, 344, 345, 274, 148, - 60, 346, 347, 348, 356, 350, 351, 357, 352, 358, - 353, 60, 359, 360, 147, 60, 354, 361, 362, 363, - 355, 364, 148, 676, 365, 366, 367, 368, 369, 370, - 356, 676, 371, 357, 676, 358, 372, 60, 359, 360, - 147, 60, 373, 361, 362, 363, 374, 364, 148, 60, - 365, 366, 367, 368, 369, 370, 375, 151, 371, 376, - 60, 377, 372, 378, 60, 152, 676, 379, 373, 380, - 381, 382, 374, 383, 676, 384, 385, 676, 386, 387, - 388, 676, 375, 151, 389, 376, 60, 377, 390, 378, - - 60, 152, 60, 379, 391, 380, 381, 382, 392, 383, - 151, 384, 385, 60, 386, 387, 388, 60, 152, 676, - 389, 393, 394, 395, 390, 396, 397, 676, 398, 399, - 391, 400, 401, 402, 392, 676, 151, 676, 403, 60, - 404, 405, 406, 60, 152, 60, 407, 393, 394, 395, - 408, 396, 397, 153, 398, 399, 154, 400, 401, 402, - 60, 155, 409, 156, 403, 410, 404, 405, 406, 411, - 412, 413, 407, 414, 415, 676, 408, 416, 417, 153, - 676, 418, 154, 419, 420, 421, 60, 155, 409, 156, - 60, 410, 422, 423, 424, 411, 412, 413, 153, 414, - - 415, 154, 425, 416, 417, 60, 155, 418, 156, 419, - 420, 421, 426, 427, 428, 429, 430, 431, 422, 423, - 424, 432, 433, 434, 153, 435, 436, 154, 425, 437, - 438, 60, 155, 439, 156, 440, 441, 442, 426, 427, - 428, 429, 430, 431, 443, 444, 445, 432, 433, 434, - 447, 435, 436, 448, 449, 437, 438, 450, 451, 439, - 452, 440, 441, 442, 453, 454, 455, 456, 457, 458, - 443, 444, 445, 459, 460, 461, 447, 462, 463, 448, - 449, 464, 465, 450, 451, 452, 466, 467, 468, 469, - 453, 454, 455, 456, 457, 458, 470, 471, 472, 459, - - 460, 461, 473, 462, 463, 474, 475, 464, 465, 476, - 477, 478, 466, 467, 468, 469, 479, 480, 481, 482, - 483, 484, 470, 471, 472, 485, 486, 487, 473, 488, - 489, 474, 475, 490, 491, 476, 477, 478, 492, 493, - 494, 495, 479, 480, 481, 482, 483, 484, 496, 497, - 498, 485, 486, 487, 499, 488, 489, 500, 501, 490, - 491, 502, 503, 504, 492, 493, 494, 495, 505, 506, - 507, 508, 509, 510, 496, 497, 498, 511, 512, 513, - 499, 514, 516, 500, 501, 517, 515, 502, 503, 504, - 518, 519, 522, 523, 505, 506, 507, 508, 509, 510, - - 520, 524, 521, 511, 512, 513, 525, 514, 516, 526, - 529, 517, 515, 527, 530, 531, 518, 519, 522, 523, - 532, 528, 533, 534, 535, 536, 520, 524, 521, 537, - 538, 539, 525, 540, 541, 526, 529, 542, 543, 527, - 530, 531, 544, 545, 546, 547, 532, 528, 533, 534, - 535, 536, 548, 549, 551, 537, 538, 539, 550, 540, - 541, 552, 553, 542, 543, 554, 555, 556, 544, 545, - 546, 547, 557, 558, 559, 560, 561, 562, 548, 549, - 551, 563, 564, 550, 565, 566, 567, 552, 553, 568, - 569, 554, 555, 556, 570, 571, 572, 573, 557, 558, - - 559, 560, 561, 562, 574, 575, 576, 563, 564, 577, - 565, 566, 567, 578, 579, 568, 569, 580, 581, 582, - 570, 571, 572, 573, 583, 584, 585, 586, 587, 588, - 574, 575, 576, 589, 577, 590, 591, 592, 593, 578, - 579, 594, 595, 580, 581, 582, 596, 597, 598, 599, - 583, 584, 585, 586, 587, 588, 600, 601, 602, 589, - 603, 590, 591, 592, 593, 604, 605, 594, 595, 606, - 607, 608, 596, 597, 598, 599, 609, 610, 611, 612, - 613, 614, 600, 601, 602, 615, 603, 616, 617, 618, - 619, 604, 605, 620, 621, 606, 607, 608, 622, 623, - - 624, 625, 609, 610, 611, 612, 613, 614, 626, 627, - 628, 615, 616, 629, 617, 618, 619, 630, 631, 620, - 621, 632, 633, 634, 622, 623, 624, 625, 635, 636, - 637, 638, 639, 640, 626, 627, 628, 641, 642, 629, - 643, 644, 645, 630, 631, 646, 647, 632, 633, 634, - 648, 649, 650, 651, 635, 636, 637, 638, 639, 640, - 652, 653, 654, 641, 642, 655, 643, 644, 645, 656, - 657, 646, 647, 658, 659, 660, 648, 649, 650, 651, - 661, 662, 663, 676, 664, 665, 652, 653, 654, 666, - 667, 655, 668, 669, 670, 656, 657, 671, 672, 658, - - 659, 660, 673, 674, 675, 676, 661, 662, 663, 664, - 676, 665, 676, 676, 676, 666, 667, 676, 668, 669, - 670, 676, 676, 671, 672, 676, 676, 676, 673, 674, - 675, 60, 60, 60, 95, 95, 95, 100, 100, 100, - 109, 109, 109, 112, 112, 112, 159, 159, 159, 161, - 161, 161, 190, 190, 190, 192, 192, 192, 193, 193, - 193, 195, 195, 195, 196, 676, 196, 197, 197, 197, - 200, 200, 200, 203, 676, 203, 204, 204, 204, 207, - 207, 207, 210, 210, 210, 212, 212, 212, 213, 213, - 213, 215, 215, 215, 271, 271, 271, 273, 273, 273, - - 198, 198, 198, 201, 201, 201, 205, 205, 205, 208, - 208, 208, 59, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 61, 62, 63, 64, 65, 61, 219, 169, 187, + 216, 66, 170, 188, 676, 67, 60, 60, 60, 68, + 61, 62, 63, 64, 65, 61, 60, 60, 60, 60, + 66, 60, 60, 60, 67, 168, 163, 60, 68, 69, + 70, 60, 71, 224, 675, 72, 60, 60, 73, 60, + 74, 75, 76, 77, 78, 79, 80, 60, 60, 81, + 60, 60, 60, 225, 176, 60, 60, 82, 83, 177, + 84, 85, 250, 674, 86, 87, 60, 60, 60, 60, + 60, 60, 88, 89, 90, 91, 178, 92, 251, 60, + 60, 201, 201, 60, 60, 199, 60, 222, 60, 317, + + 223, 60, 89, 90, 91, 318, 92, 60, 673, 60, + 147, 60, 147, 60, 181, 162, 198, 198, 199, 182, + 60, 89, 90, 93, 60, 94, 61, 205, 205, 206, + 162, 66, 89, 90, 93, 149, 94, 61, 249, 150, + 238, 672, 66, 61, 62, 96, 60, 97, 98, 198, + 198, 199, 270, 99, 61, 62, 96, 149, 97, 98, + 520, 150, 521, 333, 99, 89, 90, 101, 60, 102, + 103, 205, 205, 206, 334, 104, 89, 90, 101, 60, + 102, 103, 60, 60, 60, 60, 104, 89, 90, 105, + 671, 106, 670, 60, 226, 60, 60, 60, 227, 60, + + 60, 345, 274, 669, 228, 60, 89, 90, 105, 242, + 106, 208, 208, 247, 243, 206, 201, 201, 248, 668, + 199, 667, 666, 514, 60, 89, 90, 107, 515, 108, + 61, 527, 665, 664, 663, 66, 89, 90, 107, 528, + 108, 61, 662, 661, 660, 659, 66, 60, 61, 62, + 63, 60, 65, 61, 658, 208, 208, 657, 110, 206, + 656, 655, 654, 653, 652, 651, 650, 649, 648, 111, + 60, 61, 62, 63, 60, 65, 61, 647, 646, 645, + 644, 110, 643, 642, 641, 640, 639, 638, 637, 636, + 635, 634, 111, 60, 61, 62, 63, 60, 65, 61, + + 633, 632, 631, 630, 113, 629, 628, 627, 626, 625, + 624, 623, 622, 621, 620, 619, 618, 617, 616, 114, + 60, 61, 62, 63, 60, 65, 61, 615, 614, 613, + 612, 113, 611, 610, 609, 608, 607, 606, 605, 604, + 603, 602, 601, 600, 599, 598, 114, 115, 116, 597, + 117, 118, 119, 596, 120, 595, 121, 122, 123, 594, + 76, 60, 593, 592, 591, 590, 589, 588, 587, 586, + 585, 584, 124, 583, 582, 581, 60, 580, 579, 578, + 577, 576, 575, 125, 574, 573, 126, 60, 572, 571, + 570, 569, 568, 567, 566, 565, 564, 563, 124, 562, + + 561, 560, 60, 559, 558, 557, 556, 555, 554, 125, + 553, 552, 126, 60, 551, 550, 549, 548, 547, 546, + 127, 545, 128, 544, 60, 543, 129, 130, 60, 542, + 541, 540, 539, 538, 131, 132, 60, 537, 536, 133, + 535, 134, 534, 533, 532, 531, 530, 60, 529, 526, + 525, 60, 524, 135, 136, 523, 522, 137, 519, 518, + 517, 138, 139, 516, 140, 513, 141, 142, 512, 511, + 510, 509, 508, 507, 506, 505, 143, 144, 504, 503, + 145, 502, 501, 500, 146, 60, 499, 498, 497, 496, + 495, 494, 493, 492, 491, 490, 60, 489, 488, 147, + + 60, 487, 486, 485, 484, 483, 482, 148, 60, 481, + 480, 479, 478, 477, 476, 475, 474, 473, 472, 60, + 471, 470, 147, 60, 469, 468, 467, 466, 465, 464, + 148, 60, 463, 462, 461, 460, 459, 458, 457, 151, + 456, 455, 60, 454, 453, 452, 60, 152, 60, 451, + 450, 449, 448, 447, 446, 445, 151, 444, 443, 60, + 442, 441, 440, 60, 152, 60, 439, 438, 437, 436, + 435, 434, 433, 153, 432, 431, 154, 430, 429, 428, + 60, 155, 427, 156, 60, 426, 425, 424, 423, 422, + 421, 420, 153, 419, 418, 154, 417, 416, 415, 60, + + 155, 414, 156, 157, 60, 158, 413, 412, 411, 410, + 409, 408, 407, 406, 405, 60, 404, 403, 402, 60, + 157, 60, 158, 401, 400, 399, 398, 397, 396, 395, + 394, 393, 60, 392, 391, 390, 60, 60, 60, 60, + 95, 95, 95, 100, 100, 100, 109, 109, 109, 112, + 112, 112, 159, 159, 159, 161, 161, 161, 190, 190, + 190, 192, 192, 192, 193, 193, 193, 195, 195, 195, + 196, 389, 196, 197, 197, 197, 200, 200, 200, 203, + 388, 203, 204, 204, 204, 207, 207, 207, 210, 210, + 210, 212, 212, 212, 213, 213, 213, 215, 215, 215, + + 271, 271, 271, 273, 273, 273, 198, 198, 198, 201, + 201, 201, 205, 205, 205, 208, 208, 208, 387, 386, + 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, + 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, + 365, 364, 363, 362, 361, 272, 272, 360, 359, 358, + 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, + 347, 346, 344, 343, 342, 341, 340, 339, 338, 337, + 336, 335, 332, 331, 330, 329, 328, 327, 326, 325, + 324, 323, 322, 321, 320, 319, 316, 315, 314, 313, + 312, 311, 310, 309, 308, 307, 306, 214, 214, 211, + + 211, 305, 304, 304, 303, 302, 302, 194, 194, 191, + 191, 301, 300, 299, 298, 297, 296, 295, 294, 293, + 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, + 282, 281, 280, 279, 278, 277, 276, 275, 274, 160, + 160, 272, 272, 269, 268, 267, 266, 265, 264, 263, + 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, + 252, 249, 246, 245, 244, 241, 240, 239, 237, 236, + 235, 234, 233, 232, 231, 230, 229, 221, 220, 218, + 217, 214, 214, 211, 211, 209, 202, 194, 194, 191, + 191, 189, 186, 185, 184, 183, 180, 179, 175, 174, + + 173, 172, 171, 167, 166, 165, 164, 163, 162, 160, + 160, 676, 59, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676 + 676, 676, 676, 676, 676, 676 } ; -static yyconst flex_int16_t yy_chk[1672] = +static yyconst flex_int16_t yy_chk[947] = { 0, - 0, 1, 1, 1, 1, 1, 1, 699, 7, 7, - 7, 1, 7, 97, 97, 1, 68, 97, 70, 1, - 698, 8, 8, 8, 273, 8, 7, 96, 96, 96, - 9, 9, 9, 66, 9, 9, 67, 1, 271, 8, - 9, 1, 68, 69, 70, 1, 2, 2, 2, 2, - 2, 2, 7, 10, 10, 10, 2, 10, 10, 66, - 2, 71, 67, 10, 2, 8, 9, 74, 215, 69, - 75, 213, 76, 11, 11, 11, 212, 11, 11, 101, - 101, 101, 2, 11, 27, 169, 2, 71, 187, 10, - 2, 3, 3, 74, 3, 27, 75, 3, 76, 27, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, - 169, 3, 73, 187, 72, 72, 73, 3, 3, 210, - 3, 27, 208, 3, 28, 27, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 28, 3, 5, 73, 28, - 72, 72, 73, 77, 5, 5, 78, 5, 5, 80, - 81, 5, 5, 12, 12, 12, 205, 12, 12, 5, - 201, 28, 83, 12, 84, 28, 197, 197, 197, 77, - 5, 5, 78, 5, 5, 80, 81, 5, 5, 204, - 204, 204, 13, 13, 13, 5, 13, 13, 83, 12, - 84, 198, 13, 14, 14, 14, 236, 14, 14, 195, - - 85, 193, 79, 14, 15, 15, 15, 79, 15, 16, - 16, 16, 86, 16, 192, 17, 17, 17, 13, 17, - 17, 236, 15, 190, 79, 17, 85, 16, 79, 14, - 18, 18, 18, 79, 18, 18, 161, 88, 86, 29, - 18, 159, 158, 157, 30, 35, 36, 39, 15, 79, - 29, 17, 240, 16, 29, 30, 35, 36, 39, 30, - 35, 36, 39, 88, 40, 242, 18, 19, 19, 19, - 19, 19, 19, 19, 99, 40, 29, 240, 19, 40, - 29, 30, 35, 36, 39, 30, 35, 36, 39, 19, - 242, 41, 42, 102, 102, 108, 107, 102, 104, 43, - - 99, 40, 41, 42, 19, 40, 41, 42, 110, 111, - 43, 106, 105, 43, 43, 19, 20, 20, 20, 20, - 20, 20, 20, 113, 104, 250, 94, 20, 41, 42, - 93, 92, 41, 42, 110, 111, 43, 44, 20, 43, - 43, 91, 65, 47, 48, 53, 54, 114, 44, 113, - 250, 44, 44, 20, 47, 48, 53, 54, 47, 48, - 53, 54, 118, 63, 20, 21, 21, 21, 21, 21, - 21, 21, 59, 114, 44, 0, 21, 44, 44, 0, - 47, 48, 53, 54, 47, 48, 53, 54, 118, 55, - 56, 21, 0, 0, 57, 57, 57, 58, 58, 58, - - 55, 56, 21, 0, 55, 56, 57, 82, 82, 58, - 57, 87, 82, 58, 0, 87, 119, 21, 22, 22, - 22, 22, 22, 22, 22, 115, 55, 56, 115, 22, - 55, 56, 57, 82, 82, 58, 57, 87, 82, 58, - 116, 87, 119, 117, 22, 200, 200, 117, 0, 200, - 0, 115, 259, 117, 115, 22, 0, 120, 0, 121, - 116, 122, 123, 124, 125, 126, 116, 0, 128, 117, - 22, 23, 23, 117, 23, 23, 23, 259, 23, 117, - 23, 23, 23, 120, 23, 121, 116, 122, 123, 124, - 125, 126, 129, 127, 128, 130, 0, 23, 23, 132, - - 23, 23, 23, 127, 23, 133, 23, 23, 23, 131, - 23, 25, 134, 0, 131, 135, 136, 138, 129, 127, - 135, 130, 25, 139, 137, 132, 25, 140, 127, 141, - 142, 133, 143, 25, 144, 131, 25, 145, 134, 131, - 137, 135, 136, 138, 146, 147, 135, 0, 25, 139, - 137, 0, 25, 140, 148, 141, 142, 149, 143, 25, - 144, 25, 26, 145, 150, 137, 151, 152, 153, 154, - 146, 147, 155, 26, 156, 162, 163, 26, 164, 165, - 148, 166, 167, 149, 26, 168, 0, 26, 156, 170, - 150, 171, 151, 152, 153, 154, 0, 172, 155, 26, - - 156, 162, 163, 26, 164, 165, 173, 166, 167, 0, - 26, 168, 26, 31, 156, 170, 174, 171, 175, 176, - 31, 177, 31, 172, 31, 178, 31, 31, 31, 179, - 180, 181, 173, 182, 31, 31, 0, 183, 184, 0, - 185, 0, 174, 186, 175, 176, 31, 177, 31, 188, - 31, 178, 31, 31, 31, 179, 180, 181, 189, 182, - 31, 31, 33, 183, 184, 33, 185, 33, 202, 186, - 207, 207, 209, 33, 207, 188, 217, 33, 218, 33, - 33, 220, 221, 33, 189, 222, 0, 33, 223, 0, - 224, 33, 0, 33, 202, 225, 226, 227, 209, 33, - - 228, 0, 217, 33, 218, 33, 33, 220, 221, 33, - 230, 222, 33, 37, 223, 37, 224, 37, 37, 229, - 231, 225, 226, 227, 232, 229, 228, 37, 37, 233, - 234, 37, 235, 237, 0, 37, 230, 238, 239, 37, - 241, 37, 243, 37, 37, 229, 231, 245, 246, 0, - 232, 229, 371, 37, 37, 233, 234, 37, 235, 237, - 37, 45, 247, 238, 239, 248, 241, 244, 243, 249, - 251, 252, 45, 245, 246, 45, 45, 371, 244, 253, - 254, 255, 255, 45, 0, 256, 257, 258, 247, 260, - 261, 248, 262, 244, 263, 249, 251, 252, 45, 0, - - 264, 45, 45, 244, 265, 253, 254, 255, 255, 45, - 46, 256, 257, 258, 266, 260, 261, 267, 262, 268, - 263, 46, 269, 270, 46, 46, 264, 275, 277, 278, - 265, 279, 46, 0, 280, 281, 282, 283, 284, 285, - 266, 0, 286, 267, 0, 268, 287, 46, 269, 270, - 46, 46, 288, 275, 277, 278, 289, 279, 46, 49, - 280, 281, 282, 283, 284, 285, 290, 49, 286, 291, - 49, 293, 287, 294, 49, 49, 0, 295, 288, 296, - 297, 299, 289, 300, 0, 301, 307, 0, 309, 310, - 311, 0, 290, 49, 312, 291, 49, 293, 313, 294, - - 49, 49, 50, 295, 314, 296, 297, 299, 315, 300, - 50, 301, 307, 50, 309, 310, 311, 50, 50, 0, - 312, 316, 317, 318, 313, 319, 320, 0, 321, 322, - 314, 323, 324, 325, 315, 0, 50, 0, 327, 50, - 328, 329, 330, 50, 50, 51, 331, 316, 317, 318, - 332, 319, 320, 51, 321, 322, 51, 323, 324, 325, - 51, 51, 333, 51, 327, 334, 328, 329, 330, 335, - 336, 337, 331, 338, 339, 0, 332, 340, 341, 51, - 0, 342, 51, 343, 344, 345, 51, 51, 333, 51, - 52, 334, 346, 347, 348, 335, 336, 337, 52, 338, - - 339, 52, 349, 340, 341, 52, 52, 342, 52, 343, - 344, 345, 350, 351, 352, 353, 354, 355, 346, 347, - 348, 356, 357, 358, 52, 359, 360, 52, 349, 361, - 362, 52, 52, 363, 52, 364, 365, 366, 350, 351, - 352, 353, 354, 355, 367, 369, 370, 356, 357, 358, - 372, 359, 360, 373, 374, 361, 362, 375, 376, 363, - 377, 364, 365, 366, 378, 379, 380, 381, 382, 383, - 367, 369, 370, 384, 385, 387, 372, 388, 391, 373, - 374, 392, 393, 375, 376, 377, 395, 396, 398, 399, - 378, 379, 380, 381, 382, 383, 401, 403, 404, 384, - - 385, 387, 405, 388, 391, 406, 407, 392, 393, 408, - 409, 411, 395, 396, 398, 399, 412, 413, 414, 415, - 416, 417, 401, 403, 404, 418, 419, 420, 405, 421, - 423, 406, 407, 424, 427, 408, 409, 411, 428, 429, - 430, 431, 412, 413, 414, 415, 416, 417, 434, 436, - 437, 418, 419, 420, 438, 421, 423, 439, 440, 424, - 427, 441, 443, 444, 428, 429, 430, 431, 445, 446, - 447, 448, 449, 450, 434, 436, 437, 451, 454, 455, - 438, 456, 457, 439, 440, 458, 456, 441, 443, 444, - 459, 460, 462, 463, 445, 446, 447, 448, 449, 450, - - 461, 464, 461, 451, 454, 455, 465, 456, 457, 467, - 469, 458, 456, 468, 471, 473, 459, 460, 462, 463, - 476, 468, 477, 478, 480, 481, 461, 464, 461, 482, - 483, 484, 465, 488, 489, 467, 469, 490, 492, 468, - 471, 473, 494, 495, 497, 498, 476, 468, 477, 478, - 480, 481, 500, 501, 504, 482, 483, 484, 502, 488, - 489, 505, 506, 490, 492, 507, 508, 509, 494, 495, - 497, 498, 510, 511, 514, 515, 516, 517, 500, 501, - 504, 518, 519, 502, 520, 521, 522, 505, 506, 523, - 524, 507, 508, 509, 527, 528, 529, 530, 510, 511, - - 514, 515, 516, 517, 531, 533, 534, 518, 519, 535, - 520, 521, 522, 536, 537, 523, 524, 538, 540, 541, - 527, 528, 529, 530, 542, 543, 545, 548, 550, 551, - 531, 533, 534, 552, 535, 553, 554, 555, 556, 536, - 537, 557, 558, 538, 540, 541, 559, 560, 561, 562, - 542, 543, 545, 548, 550, 551, 563, 565, 566, 552, - 567, 553, 554, 555, 556, 569, 570, 557, 558, 571, - 572, 573, 559, 560, 561, 562, 574, 575, 576, 578, - 580, 581, 563, 565, 566, 582, 567, 583, 584, 585, - 586, 569, 570, 587, 588, 571, 572, 573, 589, 591, - - 593, 594, 574, 575, 576, 578, 580, 581, 595, 596, - 598, 582, 583, 601, 584, 585, 586, 602, 603, 587, - 588, 604, 605, 606, 589, 591, 593, 594, 608, 611, - 612, 615, 618, 619, 595, 596, 598, 621, 622, 601, - 626, 628, 629, 602, 603, 631, 632, 604, 605, 606, - 633, 635, 637, 638, 608, 611, 612, 615, 618, 619, - 639, 640, 641, 621, 622, 643, 626, 628, 629, 644, - 646, 631, 632, 648, 650, 651, 633, 635, 637, 638, - 652, 654, 655, 0, 657, 658, 639, 640, 641, 659, - 660, 643, 661, 663, 664, 644, 646, 665, 669, 648, - - 650, 651, 670, 671, 672, 0, 652, 654, 655, 657, - 0, 658, 0, 0, 0, 659, 660, 0, 661, 663, - 664, 0, 0, 665, 669, 0, 0, 0, 670, 671, - 672, 677, 677, 677, 678, 678, 678, 679, 679, 679, - 680, 680, 680, 681, 681, 681, 682, 682, 682, 683, - 683, 683, 684, 684, 684, 685, 685, 685, 686, 686, - 686, 687, 687, 687, 688, 0, 688, 689, 689, 689, - 690, 690, 690, 691, 0, 691, 692, 692, 692, 693, - 693, 693, 694, 694, 694, 695, 695, 695, 696, 696, - 696, 697, 697, 697, 700, 700, 700, 701, 701, 701, - - 702, 702, 702, 703, 703, 703, 704, 704, 704, 705, - 705, 705, 676, 676, 676, 676, 676, 676, 676, 676, + 0, 1, 1, 1, 1, 1, 1, 699, 73, 87, + 698, 1, 73, 87, 0, 1, 27, 28, 29, 1, + 2, 2, 2, 2, 2, 2, 30, 27, 28, 29, + 2, 27, 28, 29, 2, 72, 72, 30, 2, 3, + 3, 30, 3, 116, 672, 3, 35, 36, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 35, 36, 3, + 5, 35, 36, 116, 79, 39, 40, 5, 5, 79, + 5, 5, 137, 671, 5, 5, 39, 40, 41, 42, + 39, 40, 5, 7, 7, 7, 79, 7, 137, 41, + 42, 97, 97, 41, 42, 97, 43, 115, 44, 229, + + 115, 7, 8, 8, 8, 229, 8, 43, 670, 44, + 43, 43, 44, 44, 82, 82, 96, 96, 96, 82, + 8, 9, 9, 9, 47, 9, 9, 101, 101, 101, + 127, 9, 10, 10, 10, 47, 10, 10, 156, 47, + 127, 669, 10, 11, 11, 11, 48, 11, 11, 197, + 197, 197, 156, 11, 12, 12, 12, 48, 12, 12, + 461, 48, 461, 244, 12, 13, 13, 13, 53, 13, + 13, 204, 204, 204, 244, 13, 14, 14, 14, 53, + 14, 14, 54, 53, 55, 56, 14, 15, 15, 15, + 665, 15, 664, 54, 117, 55, 56, 54, 117, 55, + + 56, 255, 255, 663, 117, 15, 16, 16, 16, 131, + 16, 102, 102, 135, 131, 102, 200, 200, 135, 661, + 200, 660, 659, 456, 16, 17, 17, 17, 456, 17, + 17, 468, 658, 657, 655, 17, 18, 18, 18, 468, + 18, 18, 654, 652, 651, 650, 18, 19, 19, 19, + 19, 19, 19, 19, 648, 207, 207, 646, 19, 207, + 644, 643, 641, 640, 639, 638, 637, 635, 633, 19, + 20, 20, 20, 20, 20, 20, 20, 632, 631, 629, + 628, 20, 626, 622, 621, 619, 618, 615, 612, 611, + 608, 606, 20, 21, 21, 21, 21, 21, 21, 21, + + 605, 604, 603, 602, 21, 601, 598, 596, 595, 594, + 593, 591, 589, 588, 587, 586, 585, 584, 583, 21, + 22, 22, 22, 22, 22, 22, 22, 582, 581, 580, + 578, 22, 576, 575, 574, 573, 572, 571, 570, 569, + 567, 566, 565, 563, 562, 561, 22, 23, 23, 560, + 23, 23, 23, 559, 23, 558, 23, 23, 23, 557, + 23, 25, 556, 555, 554, 553, 552, 551, 550, 548, + 545, 543, 25, 542, 541, 540, 25, 538, 537, 536, + 535, 534, 533, 25, 531, 530, 25, 26, 529, 528, + 527, 524, 523, 522, 521, 520, 519, 518, 26, 517, + + 516, 515, 26, 514, 511, 510, 509, 508, 507, 26, + 506, 505, 26, 31, 504, 502, 501, 500, 498, 497, + 31, 495, 31, 494, 31, 492, 31, 31, 31, 490, + 489, 488, 484, 483, 31, 31, 33, 482, 481, 33, + 480, 33, 478, 477, 476, 473, 471, 33, 469, 467, + 465, 33, 464, 33, 33, 463, 462, 33, 460, 459, + 458, 33, 37, 457, 37, 455, 37, 37, 454, 451, + 450, 449, 448, 447, 446, 445, 37, 37, 444, 443, + 37, 441, 440, 439, 37, 45, 438, 437, 436, 434, + 431, 430, 429, 428, 427, 424, 45, 423, 421, 45, + + 45, 420, 419, 418, 417, 416, 415, 45, 46, 414, + 413, 412, 411, 409, 408, 407, 406, 405, 404, 46, + 403, 401, 46, 46, 399, 398, 396, 395, 393, 392, + 46, 49, 391, 388, 387, 385, 384, 383, 382, 49, + 381, 380, 49, 379, 378, 377, 49, 49, 50, 376, + 375, 374, 373, 372, 371, 370, 50, 369, 367, 50, + 366, 365, 364, 50, 50, 51, 363, 362, 361, 360, + 359, 358, 357, 51, 356, 355, 51, 354, 353, 352, + 51, 51, 351, 51, 52, 350, 349, 348, 347, 346, + 345, 344, 52, 343, 342, 52, 341, 340, 339, 52, + + 52, 338, 52, 57, 57, 57, 337, 336, 335, 334, + 333, 332, 331, 330, 329, 57, 328, 327, 325, 57, + 58, 58, 58, 324, 323, 322, 321, 320, 319, 318, + 317, 316, 58, 315, 314, 313, 58, 677, 677, 677, + 678, 678, 678, 679, 679, 679, 680, 680, 680, 681, + 681, 681, 682, 682, 682, 683, 683, 683, 684, 684, + 684, 685, 685, 685, 686, 686, 686, 687, 687, 687, + 688, 312, 688, 689, 689, 689, 690, 690, 690, 691, + 311, 691, 692, 692, 692, 693, 693, 693, 694, 694, + 694, 695, 695, 695, 696, 696, 696, 697, 697, 697, + + 700, 700, 700, 701, 701, 701, 702, 702, 702, 703, + 703, 703, 704, 704, 704, 705, 705, 705, 310, 309, + 307, 301, 300, 299, 297, 296, 295, 294, 293, 291, + 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, + 280, 279, 278, 277, 275, 273, 271, 270, 269, 268, + 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, + 257, 256, 254, 253, 252, 251, 250, 249, 248, 247, + 246, 245, 243, 242, 241, 240, 239, 238, 237, 236, + 235, 234, 233, 232, 231, 230, 228, 227, 226, 225, + 224, 223, 222, 221, 220, 218, 217, 215, 213, 212, + + 210, 209, 208, 205, 202, 201, 198, 195, 193, 192, + 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, + 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, + 159, 158, 157, 155, 154, 153, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, + 138, 136, 134, 133, 132, 130, 129, 128, 126, 125, + 124, 123, 122, 121, 120, 119, 118, 114, 113, 111, + 110, 108, 107, 106, 105, 104, 99, 94, 93, 92, + 91, 88, 86, 85, 84, 83, 81, 80, 78, 77, + + 76, 75, 74, 71, 70, 69, 68, 67, 66, 65, + 63, 59, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676 + 676, 676, 676, 676, 676, 676 } ; static yy_state_type yy_last_accepting_state; @@ -1046,8 +893,8 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "src/mapfile/mapfile.l" -#line 2 "src/mapfile/mapfile.l" +#line 1 "mapfile.l" +#line 2 "mapfile.l" #include @@ -1587,13 +1434,14 @@ static void end_layer() if (!map_l->storage->schema->use) buffer_add_str(map_l->storage->schema, "public"); if (!map_is_dump) map_l->retrievable=map_l->writable = false; - + map_l->name_prefix = buffer_init(); buffer_copy(map_l->name_prefix, map_l->name); if (map_l->ns_prefix->use) { buffer_add_head(map_l->name_prefix, ':'); buffer_add_head_str(map_l->name_prefix, map_l->ns_prefix->buf); } + map_l->name_no_uri = buffer_init(); buffer_copy(map_l->name_no_uri, map_l->name); if (map_l->ns_uri->use) { buffer_add_head(map_l->name, ':'); @@ -1635,7 +1483,7 @@ static void end_layer() -#line 1639 "src/mapfile/mapfile.c" +#line 1486 "src/mapfile/mapfile.c" #define INITIAL 0 #define MAP 1 @@ -1672,7 +1520,7 @@ static void end_layer() * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ -#ifndef _WIN32 + #ifndef _WIN32 #include #endif #endif @@ -1704,7 +1552,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -yy_size_t yyget_leng (void ); +int yyget_leng (void ); char *yyget_text (void ); @@ -1754,7 +1602,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1762,7 +1615,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1773,7 +1626,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - yy_size_t n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1855,10 +1708,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 598 "src/mapfile/mapfile.l" +#line 599 "mapfile.l" -#line 1860 "src/mapfile/mapfile.c" +#line 1712 "src/mapfile/mapfile.c" if ( !(yy_init) ) { @@ -1939,23 +1792,23 @@ YY_DECL case 1: YY_RULE_SETUP -#line 600 "src/mapfile/mapfile.l" +#line 601 "mapfile.l" { char c ; for (c=input() ; c && c != '\n' ; c=input()); } YY_BREAK case 2: YY_RULE_SETUP -#line 601 "src/mapfile/mapfile.l" +#line 602 "mapfile.l" { yy_push_state(INCLUDE); OWS_MAP_DBG } YY_BREAK case 3: YY_RULE_SETUP -#line 604 "src/mapfile/mapfile.l" +#line 605 "mapfile.l" { /*LEGEND rule must appears before END... */ yy_push_state(LEGEND); OWS_MAP_DBG } YY_BREAK case 4: YY_RULE_SETUP -#line 607 "src/mapfile/mapfile.l" +#line 608 "mapfile.l" { OWS_MAP_EATLINE if (yy_top_state() == INITIAL && YY_START != MAP) { @@ -1969,483 +1822,483 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 618 "src/mapfile/mapfile.l" +#line 619 "mapfile.l" { yy_push_state(MAP); OWS_MAP_DBG } YY_BREAK case 6: YY_RULE_SETUP -#line 619 "src/mapfile/mapfile.l" +#line 620 "mapfile.l" { yy_push_state(WEB); OWS_MAP_DBG } YY_BREAK case 7: YY_RULE_SETUP -#line 620 "src/mapfile/mapfile.l" +#line 621 "mapfile.l" { yy_push_state(QUERYMAP); OWS_MAP_DBG } YY_BREAK case 8: YY_RULE_SETUP -#line 621 "src/mapfile/mapfile.l" +#line 622 "mapfile.l" { OWS_MAP_EATLINE /* must be before SYMBOL */ } YY_BREAK case 9: YY_RULE_SETUP -#line 622 "src/mapfile/mapfile.l" +#line 623 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 10: YY_RULE_SETUP -#line 623 "src/mapfile/mapfile.l" +#line 624 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 11: YY_RULE_SETUP -#line 624 "src/mapfile/mapfile.l" +#line 625 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 12: YY_RULE_SETUP -#line 625 "src/mapfile/mapfile.l" +#line 626 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 13: YY_RULE_SETUP -#line 626 "src/mapfile/mapfile.l" +#line 627 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 14: YY_RULE_SETUP -#line 627 "src/mapfile/mapfile.l" +#line 628 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 15: YY_RULE_SETUP -#line 628 "src/mapfile/mapfile.l" +#line 629 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 16: YY_RULE_SETUP -#line 629 "src/mapfile/mapfile.l" +#line 630 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 17: YY_RULE_SETUP -#line 630 "src/mapfile/mapfile.l" +#line 631 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 18: YY_RULE_SETUP -#line 631 "src/mapfile/mapfile.l" +#line 632 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 19: YY_RULE_SETUP -#line 632 "src/mapfile/mapfile.l" +#line 633 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 20: YY_RULE_SETUP -#line 633 "src/mapfile/mapfile.l" +#line 634 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 21: YY_RULE_SETUP -#line 634 "src/mapfile/mapfile.l" +#line 635 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 22: YY_RULE_SETUP -#line 635 "src/mapfile/mapfile.l" +#line 636 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 23: YY_RULE_SETUP -#line 636 "src/mapfile/mapfile.l" +#line 637 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 24: YY_RULE_SETUP -#line 637 "src/mapfile/mapfile.l" +#line 638 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 25: YY_RULE_SETUP -#line 638 "src/mapfile/mapfile.l" +#line 639 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 26: YY_RULE_SETUP -#line 639 "src/mapfile/mapfile.l" +#line 640 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 27: YY_RULE_SETUP -#line 640 "src/mapfile/mapfile.l" +#line 641 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 28: YY_RULE_SETUP -#line 641 "src/mapfile/mapfile.l" +#line 642 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 29: YY_RULE_SETUP -#line 642 "src/mapfile/mapfile.l" +#line 643 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 30: YY_RULE_SETUP -#line 643 "src/mapfile/mapfile.l" +#line 644 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 31: YY_RULE_SETUP -#line 644 "src/mapfile/mapfile.l" +#line 645 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 32: YY_RULE_SETUP -#line 645 "src/mapfile/mapfile.l" +#line 646 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 33: YY_RULE_SETUP -#line 646 "src/mapfile/mapfile.l" +#line 647 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 34: YY_RULE_SETUP -#line 647 "src/mapfile/mapfile.l" +#line 648 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 35: YY_RULE_SETUP -#line 648 "src/mapfile/mapfile.l" +#line 649 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 36: YY_RULE_SETUP -#line 649 "src/mapfile/mapfile.l" +#line 650 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 37: YY_RULE_SETUP -#line 650 "src/mapfile/mapfile.l" +#line 651 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 38: YY_RULE_SETUP -#line 651 "src/mapfile/mapfile.l" +#line 652 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 39: YY_RULE_SETUP -#line 652 "src/mapfile/mapfile.l" +#line 653 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 40: YY_RULE_SETUP -#line 653 "src/mapfile/mapfile.l" +#line 654 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 41: YY_RULE_SETUP -#line 654 "src/mapfile/mapfile.l" +#line 655 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 42: YY_RULE_SETUP -#line 655 "src/mapfile/mapfile.l" +#line 656 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 43: YY_RULE_SETUP -#line 656 "src/mapfile/mapfile.l" +#line 657 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 44: YY_RULE_SETUP -#line 657 "src/mapfile/mapfile.l" +#line 658 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 45: YY_RULE_SETUP -#line 658 "src/mapfile/mapfile.l" +#line 659 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 46: YY_RULE_SETUP -#line 659 "src/mapfile/mapfile.l" +#line 660 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 47: YY_RULE_SETUP -#line 660 "src/mapfile/mapfile.l" +#line 661 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 48: YY_RULE_SETUP -#line 661 "src/mapfile/mapfile.l" +#line 662 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 49: YY_RULE_SETUP -#line 662 "src/mapfile/mapfile.l" +#line 663 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 50: YY_RULE_SETUP -#line 663 "src/mapfile/mapfile.l" +#line 664 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 51: YY_RULE_SETUP -#line 664 "src/mapfile/mapfile.l" +#line 665 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 52: YY_RULE_SETUP -#line 665 "src/mapfile/mapfile.l" +#line 666 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 53: YY_RULE_SETUP -#line 666 "src/mapfile/mapfile.l" +#line 667 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 54: YY_RULE_SETUP -#line 667 "src/mapfile/mapfile.l" +#line 668 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 55: YY_RULE_SETUP -#line 668 "src/mapfile/mapfile.l" +#line 669 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 56: YY_RULE_SETUP -#line 669 "src/mapfile/mapfile.l" +#line 670 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 57: YY_RULE_SETUP -#line 670 "src/mapfile/mapfile.l" +#line 671 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 58: YY_RULE_SETUP -#line 671 "src/mapfile/mapfile.l" +#line 672 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 59: YY_RULE_SETUP -#line 672 "src/mapfile/mapfile.l" +#line 673 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 60: YY_RULE_SETUP -#line 673 "src/mapfile/mapfile.l" +#line 674 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 61: YY_RULE_SETUP -#line 674 "src/mapfile/mapfile.l" +#line 675 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 62: YY_RULE_SETUP -#line 675 "src/mapfile/mapfile.l" +#line 676 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 63: YY_RULE_SETUP -#line 676 "src/mapfile/mapfile.l" +#line 677 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 64: YY_RULE_SETUP -#line 677 "src/mapfile/mapfile.l" +#line 678 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 65: YY_RULE_SETUP -#line 678 "src/mapfile/mapfile.l" +#line 679 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 66: YY_RULE_SETUP -#line 679 "src/mapfile/mapfile.l" +#line 680 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 67: YY_RULE_SETUP -#line 680 "src/mapfile/mapfile.l" +#line 681 "mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 68: YY_RULE_SETUP -#line 682 "src/mapfile/mapfile.l" +#line 683 "mapfile.l" { yy_push_state(SYMBOL); OWS_MAP_DBG } YY_BREAK case 69: YY_RULE_SETUP -#line 683 "src/mapfile/mapfile.l" +#line 684 "mapfile.l" { yy_push_state(SCALEBAR); OWS_MAP_DBG } YY_BREAK case 70: YY_RULE_SETUP -#line 684 "src/mapfile/mapfile.l" +#line 685 "mapfile.l" { yy_push_state(REFERENCE); OWS_MAP_DBG } YY_BREAK case 71: YY_RULE_SETUP -#line 685 "src/mapfile/mapfile.l" +#line 686 "mapfile.l" { yy_push_state(OUTPUTFORMAT); OWS_MAP_DBG } YY_BREAK case 72: YY_RULE_SETUP -#line 686 "src/mapfile/mapfile.l" +#line 687 "mapfile.l" { yy_push_state(METADATA); OWS_MAP_DBG } YY_BREAK case 73: YY_RULE_SETUP -#line 687 "src/mapfile/mapfile.l" +#line 688 "mapfile.l" { yy_push_state(GRID); OWS_MAP_DBG } YY_BREAK case 74: YY_RULE_SETUP -#line 688 "src/mapfile/mapfile.l" +#line 689 "mapfile.l" { yy_push_state(JOIN); OWS_MAP_DBG } YY_BREAK case 75: YY_RULE_SETUP -#line 689 "src/mapfile/mapfile.l" +#line 690 "mapfile.l" { yy_push_state(LAYER_METADATA); OWS_MAP_DBG } YY_BREAK case 76: YY_RULE_SETUP -#line 690 "src/mapfile/mapfile.l" +#line 691 "mapfile.l" { yy_push_state(CLASS); OWS_MAP_DBG } YY_BREAK case 77: YY_RULE_SETUP -#line 691 "src/mapfile/mapfile.l" +#line 692 "mapfile.l" { yy_push_state(STYLE); OWS_MAP_DBG } YY_BREAK case 78: YY_RULE_SETUP -#line 692 "src/mapfile/mapfile.l" +#line 693 "mapfile.l" { yy_push_state(LABEL); OWS_MAP_DBG } YY_BREAK case 79: YY_RULE_SETUP -#line 693 "src/mapfile/mapfile.l" +#line 694 "mapfile.l" { yy_push_state(PROJECTION); OWS_MAP_DBG } YY_BREAK case 80: YY_RULE_SETUP -#line 694 "src/mapfile/mapfile.l" +#line 695 "mapfile.l" { yy_push_state(PATTERN); OWS_MAP_DBG } YY_BREAK case 81: YY_RULE_SETUP -#line 695 "src/mapfile/mapfile.l" +#line 696 "mapfile.l" { yy_push_state(POINTS); OWS_MAP_DBG } YY_BREAK case 82: YY_RULE_SETUP -#line 696 "src/mapfile/mapfile.l" +#line 697 "mapfile.l" { yy_push_state(LABEL); OWS_MAP_DBG } YY_BREAK case 83: YY_RULE_SETUP -#line 697 "src/mapfile/mapfile.l" +#line 698 "mapfile.l" { yy_push_state(LAYER); map_l = ows_layer_init(); OWS_MAP_DBG } YY_BREAK case 84: YY_RULE_SETUP -#line 698 "src/mapfile/mapfile.l" +#line 699 "mapfile.l" { yy_push_state(FEATURE); OWS_MAP_DBG } YY_BREAK case 85: YY_RULE_SETUP -#line 699 "src/mapfile/mapfile.l" +#line 700 "mapfile.l" { BEGIN PROPERTIES; map_prop_state = MAP_NAME; } YY_BREAK case 86: YY_RULE_SETUP -#line 700 "src/mapfile/mapfile.l" +#line 701 "mapfile.l" { BEGIN LAYER_PROPERTIES; map_layer_prop_state = MAP_LAYER_NAME; } YY_BREAK case 87: YY_RULE_SETUP -#line 701 "src/mapfile/mapfile.l" +#line 702 "mapfile.l" { BEGIN LAYER_PROPERTIES; map_layer_prop_state = MAP_LAYER_CONNECTION; } YY_BREAK case 88: YY_RULE_SETUP -#line 702 "src/mapfile/mapfile.l" +#line 703 "mapfile.l" { BEGIN LAYER_CONNECTIONTYPE; } YY_BREAK case 89: YY_RULE_SETUP -#line 703 "src/mapfile/mapfile.l" +#line 704 "mapfile.l" { BEGIN LAYER; map_is_postgis=true; } YY_BREAK case 90: YY_RULE_SETUP -#line 704 "src/mapfile/mapfile.l" +#line 705 "mapfile.l" { BEGIN LAYER; map_is_postgis=false; } YY_BREAK case 91: YY_RULE_SETUP -#line 705 "src/mapfile/mapfile.l" +#line 706 "mapfile.l" { BEGIN LAYER_DUMP; } YY_BREAK case 92: YY_RULE_SETUP -#line 706 "src/mapfile/mapfile.l" +#line 707 "mapfile.l" { BEGIN LAYER; map_is_dump=true; } YY_BREAK case 93: YY_RULE_SETUP -#line 707 "src/mapfile/mapfile.l" +#line 708 "mapfile.l" { BEGIN LAYER; map_is_dump=false; } YY_BREAK case 94: /* rule 94 can match eol */ YY_RULE_SETUP -#line 709 "src/mapfile/mapfile.l" +#line 710 "mapfile.l" {} YY_BREAK case 95: /* rule 95 can match eol */ YY_RULE_SETUP -#line 711 "src/mapfile/mapfile.l" +#line 712 "mapfile.l" {metadata_key(yytext, true); BEGIN METADATA_VALUE;} YY_BREAK case 96: /* rule 96 can match eol */ YY_RULE_SETUP -#line 712 "src/mapfile/mapfile.l" +#line 713 "mapfile.l" {metadata_value(yytext, true); BEGIN METADATA;} YY_BREAK case 97: /* rule 97 can match eol */ YY_RULE_SETUP -#line 713 "src/mapfile/mapfile.l" +#line 714 "mapfile.l" {metadata_layer_key(yytext, true); BEGIN LAYER_METADATA_VALUE;} YY_BREAK case 98: /* rule 98 can match eol */ YY_RULE_SETUP -#line 714 "src/mapfile/mapfile.l" +#line 715 "mapfile.l" {metadata_layer_value(yytext, true); BEGIN LAYER_METADATA;} YY_BREAK case 99: /* rule 99 can match eol */ YY_RULE_SETUP -#line 715 "src/mapfile/mapfile.l" +#line 716 "mapfile.l" { char *p, *q; @@ -2479,40 +2332,40 @@ YY_RULE_SETUP case 100: /* rule 100 can match eol */ YY_RULE_SETUP -#line 746 "src/mapfile/mapfile.l" +#line 747 "mapfile.l" {properties(yytext, true); BEGIN MAP;} YY_BREAK case 101: YY_RULE_SETUP -#line 747 "src/mapfile/mapfile.l" +#line 748 "mapfile.l" {properties(yytext, false); BEGIN MAP;} YY_BREAK case 102: /* rule 102 can match eol */ YY_RULE_SETUP -#line 748 "src/mapfile/mapfile.l" +#line 749 "mapfile.l" {layer_properties(yytext, true); BEGIN LAYER;} YY_BREAK case 103: YY_RULE_SETUP -#line 749 "src/mapfile/mapfile.l" +#line 750 "mapfile.l" {layer_properties(yytext, false); BEGIN LAYER;} YY_BREAK case 104: /* rule 104 can match eol */ YY_RULE_SETUP -#line 750 "src/mapfile/mapfile.l" +#line 751 "mapfile.l" {} YY_BREAK case 105: YY_RULE_SETUP -#line 751 "src/mapfile/mapfile.l" +#line 752 "mapfile.l" {} YY_BREAK case 106: /* rule 106 can match eol */ YY_RULE_SETUP -#line 752 "src/mapfile/mapfile.l" +#line 753 "mapfile.l" {} YY_BREAK case YY_STATE_EOF(INITIAL): @@ -2544,7 +2397,7 @@ case YY_STATE_EOF(SYMBOL): case YY_STATE_EOF(PATTERN): case YY_STATE_EOF(POINTS): case YY_STATE_EOF(INCLUDE): -#line 754 "src/mapfile/mapfile.l" +#line 755 "mapfile.l" { /* End of main file */ if (map_include_stack_ptr == 0 && YY_START == 0) yyterminate(); @@ -2562,10 +2415,10 @@ case YY_STATE_EOF(INCLUDE): YY_BREAK case 107: YY_RULE_SETUP -#line 769 "src/mapfile/mapfile.l" +#line 770 "mapfile.l" ECHO; YY_BREAK -#line 2567 "src/mapfile/mapfile.c" +#line 2419 "src/mapfile/mapfile.c" case YY_END_OF_BUFFER: { @@ -2750,7 +2603,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2764,7 +2617,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - yy_size_t new_size = b->yy_buf_size * 2; + int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2795,7 +2648,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); + (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2917,7 +2770,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2941,7 +2794,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return 0; + return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -3189,7 +3042,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - yy_size_t num_to_alloc; + int num_to_alloc; if (!(yy_buffer_stack)) { @@ -3281,16 +3134,17 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; - yy_size_t n, i; + yy_size_t n; + int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3409,7 +3263,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -yy_size_t yyget_leng (void) +int yyget_leng (void) { return yyleng; } @@ -3565,7 +3419,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 769 "src/mapfile/mapfile.l" +#line 770 "mapfile.l" diff --git a/src/mapfile/mapfile.l b/src/mapfile/mapfile.l index 36066e90..ecb29461 100644 --- a/src/mapfile/mapfile.l +++ b/src/mapfile/mapfile.l @@ -538,13 +538,14 @@ static void end_layer() if (!map_l->storage->schema->use) buffer_add_str(map_l->storage->schema, "public"); if (!map_is_dump) map_l->retrievable=map_l->writable = false; - + map_l->name_prefix = buffer_init(); buffer_copy(map_l->name_prefix, map_l->name); if (map_l->ns_prefix->use) { buffer_add_head(map_l->name_prefix, ':'); buffer_add_head_str(map_l->name_prefix, map_l->ns_prefix->buf); } + map_l->name_no_uri = buffer_init(); buffer_copy(map_l->name_no_uri, map_l->name); if (map_l->ns_uri->use) { buffer_add_head(map_l->name, ':'); From 857b4c076874329a282f92afc9926114f7a57c0b Mon Sep 17 00:00:00 2001 From: jmckenna Date: Sat, 12 Jun 2021 14:54:03 -0300 Subject: [PATCH 31/61] don't regenerate mapfile.c --- src/mapfile/mapfile.c | 1044 +++++++++++++++++++++++------------------ 1 file changed, 596 insertions(+), 448 deletions(-) diff --git a/src/mapfile/mapfile.c b/src/mapfile/mapfile.c index 899d09c3..9e9791b9 100644 --- a/src/mapfile/mapfile.c +++ b/src/mapfile/mapfile.c @@ -54,6 +54,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,8 +85,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -142,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -162,7 +153,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -188,11 +184,6 @@ extern FILE *yyin, *yyout; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -210,7 +201,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -280,8 +271,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -309,7 +300,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -470,11 +461,11 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 1, 1, 1, 1, 7, 1, 29, 29, 29, 29, + 1, 1, 1, 1, 7, 1, 34, 35, 36, 37, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 1, 1, 1, 1, 1, 1, 1, 1, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 29, 55, 56, + 57, 58, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -491,94 +482,96 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[34] = +static yyconst flex_int32_t yy_meta[59] = { 0, 1, 2, 2, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3 + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3 } ; static yyconst flex_int16_t yy_base[706] = { 0, - 0, 19, 30, 0, 56, 0, 82, 101, 120, 131, - 142, 153, 164, 175, 186, 205, 224, 235, 247, 270, - 293, 320, 338, 0, 357, 383, 12, 13, 14, 22, - 409, 0, 432, 0, 42, 43, 455, 0, 61, 62, - 74, 75, 92, 94, 481, 504, 120, 142, 527, 544, - 561, 580, 164, 178, 180, 181, 600, 617, 912, 913, - 913, 913, 907, 913, 904, 888, 887, 899, 884, 897, - 882, 16, 1, 895, 874, 876, 872, 887, 55, 886, - 885, 95, 874, 883, 874, 871, 2, 880, 913, 913, - 887, 884, 885, 882, 0, 115, 90, 0, 866, 0, - - 126, 210, 0, 865, 881, 878, 879, 876, 0, 860, - 858, 0, 858, 853, 79, 36, 183, 852, 864, 853, - 866, 861, 864, 844, 858, 851, 110, 843, 855, 858, - 183, 853, 843, 841, 191, 854, 57, 845, 839, 837, - 837, 835, 828, 830, 838, 828, 844, 839, 830, 841, - 826, 839, 824, 825, 836, 131, 839, 836, 837, 913, - 834, 828, 828, 814, 815, 808, 813, 825, 800, 817, - 810, 802, 806, 815, 813, 817, 816, 803, 802, 812, - 797, 794, 796, 809, 808, 801, 783, 786, 792, 807, - 913, 804, 805, 913, 802, 0, 148, 803, 0, 215, - - 800, 794, 0, 170, 800, 0, 254, 797, 791, 797, - 913, 794, 795, 913, 792, 0, 786, 770, 0, 784, - 766, 785, 771, 764, 770, 781, 769, 765, 84, 778, - 769, 775, 756, 762, 769, 749, 752, 755, 755, 744, - 766, 742, 753, 144, 758, 752, 762, 742, 741, 734, - 746, 754, 750, 744, 192, 741, 734, 744, 726, 750, - 748, 736, 747, 729, 728, 732, 730, 742, 729, 732, - 743, 913, 740, 913, 726, 913, 731, 735, 715, 727, - 728, 727, 726, 714, 719, 710, 722, 714, 709, 722, - 707, 913, 702, 706, 700, 715, 711, 913, 697, 715, - - 699, 913, 0, 913, 0, 0, 694, 0, 708, 693, - 660, 664, 613, 608, 607, 605, 620, 602, 618, 607, - 615, 618, 613, 604, 592, 913, 593, 589, 599, 602, - 594, 603, 588, 583, 590, 586, 597, 583, 572, 586, - 588, 568, 575, 570, 569, 563, 570, 566, 575, 563, - 571, 557, 565, 560, 556, 563, 546, 558, 559, 549, - 541, 552, 544, 537, 550, 536, 538, 913, 530, 544, - 523, 529, 541, 540, 529, 531, 514, 520, 532, 530, - 529, 527, 527, 518, 522, 0, 509, 522, 913, 913, - 505, 518, 517, 913, 505, 515, 913, 507, 514, 913, - - 496, 913, 509, 496, 498, 498, 504, 493, 495, 913, - 501, 487, 495, 494, 495, 490, 483, 489, 491, 477, - 488, 913, 482, 471, 913, 913, 476, 475, 481, 480, - 483, 913, 913, 478, 913, 462, 477, 473, 476, 471, - 455, 913, 469, 452, 466, 455, 462, 464, 449, 452, - 462, 913, 913, 444, 441, 201, 444, 453, 452, 443, - 147, 447, 431, 428, 426, 913, 425, 224, 441, 913, - 421, 913, 438, 913, 913, 426, 436, 427, 913, 414, - 418, 413, 407, 414, 913, 913, 913, 416, 410, 414, - 913, 418, 913, 399, 395, 913, 394, 407, 913, 391, - - 390, 384, 913, 402, 385, 403, 388, 400, 399, 380, - 378, 913, 913, 396, 377, 378, 373, 371, 371, 371, - 368, 367, 381, 376, 913, 913, 370, 363, 362, 360, - 371, 913, 356, 355, 349, 368, 358, 366, 913, 355, - 363, 347, 345, 913, 349, 913, 913, 343, 913, 346, - 346, 351, 343, 355, 339, 336, 348, 344, 327, 331, - 327, 337, 332, 0, 321, 330, 325, 913, 313, 325, - 326, 329, 320, 323, 322, 321, 913, 321, 913, 310, - 315, 318, 287, 306, 294, 304, 303, 289, 291, 913, - 300, 913, 296, 283, 286, 293, 913, 299, 913, 913, - - 278, 284, 281, 290, 282, 272, 913, 269, 913, 913, - 270, 267, 913, 913, 266, 913, 913, 260, 261, 913, - 265, 263, 913, 913, 913, 275, 913, 254, 257, 913, - 258, 258, 257, 913, 247, 913, 248, 247, 249, 243, - 255, 913, 235, 249, 913, 231, 913, 239, 913, 224, - 223, 222, 913, 216, 208, 913, 202, 206, 198, 197, - 199, 913, 192, 170, 179, 913, 913, 913, 117, 97, - 54, 24, 913, 913, 913, 913, 637, 640, 643, 646, - 649, 652, 655, 658, 661, 664, 667, 670, 673, 676, - 679, 682, 685, 688, 691, 694, 697, 8, 5, 700, - - 703, 706, 709, 712, 715 + 0, 45, 82, 0, 133, 0, 7, 20, 29, 52, + 72, 152, 181, 192, 203, 208, 214, 229, 267, 316, + 365, 418, 462, 0, 507, 558, 80, 120, 235, 240, + 609, 0, 658, 0, 241, 242, 706, 0, 243, 260, + 287, 288, 295, 333, 757, 806, 339, 340, 855, 898, + 941, 986, 341, 342, 385, 386, 391, 394, 373, 1613, + 1613, 1613, 360, 1613, 337, 13, 16, 9, 22, 11, + 40, 95, 105, 60, 43, 48, 116, 135, 193, 138, + 139, 388, 141, 153, 181, 191, 404, 226, 1613, 1613, + 338, 326, 327, 321, 0, 26, 12, 0, 254, 0, + + 78, 292, 0, 278, 309, 306, 293, 290, 0, 288, + 288, 0, 303, 323, 407, 433, 432, 338, 405, 436, + 452, 450, 455, 437, 453, 448, 473, 444, 481, 488, + 483, 488, 485, 491, 493, 509, 509, 502, 503, 506, + 509, 509, 505, 510, 522, 520, 538, 543, 538, 557, + 545, 560, 547, 550, 565, 567, 240, 237, 238, 1613, + 231, 565, 567, 556, 559, 555, 562, 578, 54, 576, + 572, 571, 585, 605, 606, 612, 614, 606, 610, 622, + 609, 609, 616, 631, 633, 630, 58, 623, 639, 220, + 1613, 209, 198, 1613, 194, 0, 165, 188, 0, 444, + + 155, 658, 0, 178, 153, 0, 669, 117, 662, 116, + 1613, 71, 68, 1613, 63, 0, 666, 653, 0, 671, + 655, 678, 668, 664, 676, 689, 679, 679, 704, 703, + 705, 716, 703, 711, 721, 166, 707, 715, 717, 221, + 732, 234, 723, 748, 734, 730, 755, 739, 743, 293, + 751, 761, 766, 762, 772, 765, 760, 772, 420, 782, + 782, 773, 787, 776, 780, 795, 797, 812, 803, 808, + 35, 1613, 19, 1613, 809, 1613, 816, 822, 805, 821, + 824, 825, 826, 816, 823, 818, 835, 834, 834, 858, + 847, 1613, 845, 852, 851, 869, 867, 1613, 855, 876, + + 863, 1613, 0, 1613, 0, 0, 860, 0, 877, 864, + 870, 887, 876, 878, 882, 895, 912, 896, 915, 906, + 917, 922, 920, 913, 907, 1613, 914, 913, 926, 931, + 928, 942, 940, 939, 951, 949, 962, 955, 948, 966, + 970, 955, 965, 963, 964, 966, 975, 973, 991, 990, + 1002, 992, 1002, 999, 998, 1010, 996, 1010, 1014, 1006, + 1002, 1015, 1011, 1010, 1025, 1013, 1024, 1613, 1018, 1035, + 721, 1026, 1042, 1043, 1036, 1040, 1029, 1040, 1054, 1055, + 1056, 1057, 1059, 1055, 1061, 0, 1050, 1066, 1613, 1613, + 1051, 1070, 1071, 1613, 1064, 1076, 1613, 1070, 1079, 1613, + + 1071, 1613, 1086, 1076, 1083, 1087, 1095, 1088, 1092, 1613, + 1100, 1092, 1102, 1103, 1108, 1105, 1100, 1111, 1115, 1103, + 1119, 1613, 1115, 1109, 1613, 1613, 1116, 1120, 1128, 1129, + 1134, 1613, 1613, 1137, 1613, 1123, 1140, 1141, 1150, 1147, + 1135, 1613, 1152, 1137, 1159, 1150, 1159, 1163, 1150, 1155, + 1170, 1613, 1613, 1154, 1155, 1159, 1163, 1178, 1183, 1176, + 1187, 1183, 1169, 1177, 1182, 1613, 1185, 1206, 1203, 1613, + 1189, 1613, 1208, 1613, 1613, 1202, 1215, 1208, 1613, 1198, + 1205, 1205, 1204, 1213, 1613, 1613, 1613, 1218, 1214, 1222, + 1613, 1231, 1613, 1218, 1217, 1613, 1219, 1234, 1613, 1226, + + 1227, 1227, 1613, 1242, 1235, 1255, 1245, 1259, 1260, 1247, + 1247, 1613, 1613, 1267, 1251, 1254, 1251, 1255, 1257, 1260, + 1259, 1260, 1278, 1275, 1613, 1613, 1274, 1269, 1270, 1272, + 1291, 1613, 1279, 1280, 1278, 1302, 1294, 1306, 1613, 1298, + 1308, 1298, 1299, 1613, 1305, 1613, 1613, 1301, 1613, 1306, + 1308, 1318, 1313, 1327, 1313, 1312, 1330, 1331, 1320, 1329, + 1330, 1342, 1345, 0, 1336, 1347, 1345, 1613, 1339, 1353, + 1358, 1363, 1356, 1365, 1366, 1367, 1613, 1370, 1613, 1361, + 1368, 1376, 1356, 1377, 1367, 1379, 1382, 1370, 1377, 1613, + 1388, 1613, 1386, 1375, 1386, 1395, 1613, 1403, 1613, 1613, + + 1386, 1398, 1397, 1410, 1404, 1404, 1613, 1407, 1613, 1613, + 1410, 1409, 1613, 1613, 1410, 1613, 1613, 1406, 1409, 1613, + 1418, 1418, 1613, 1613, 1613, 1433, 1613, 1415, 1420, 1613, + 1425, 1427, 1439, 1613, 1431, 1613, 1434, 1435, 1445, 1441, + 1455, 1613, 1439, 1458, 1613, 1444, 1613, 1458, 1613, 1453, + 1454, 1459, 1613, 1455, 1456, 1613, 1453, 1459, 1465, 1466, + 1472, 1613, 1482, 1472, 1486, 1613, 1613, 1613, 1474, 1491, + 1484, 1484, 1613, 1613, 1613, 1613, 1531, 1534, 1537, 1540, + 1543, 1546, 1549, 1552, 1555, 1558, 1561, 1564, 1567, 1570, + 1573, 1576, 1579, 1582, 1585, 1588, 1591, 18, 5, 1594, + + 1597, 1600, 1603, 1606, 1609 } ; static yyconst flex_int16_t yy_def[706] = @@ -663,220 +656,380 @@ static yyconst flex_int16_t yy_def[706] = 676, 676, 676, 676, 676 } ; -static yyconst flex_int16_t yy_nxt[947] = +static yyconst flex_int16_t yy_nxt[1672] = { 0, - 676, 61, 62, 63, 64, 65, 61, 219, 169, 187, - 216, 66, 170, 188, 676, 67, 60, 60, 60, 68, - 61, 62, 63, 64, 65, 61, 60, 60, 60, 60, - 66, 60, 60, 60, 67, 168, 163, 60, 68, 69, - 70, 60, 71, 224, 675, 72, 60, 60, 73, 60, - 74, 75, 76, 77, 78, 79, 80, 60, 60, 81, - 60, 60, 60, 225, 176, 60, 60, 82, 83, 177, - 84, 85, 250, 674, 86, 87, 60, 60, 60, 60, - 60, 60, 88, 89, 90, 91, 178, 92, 251, 60, - 60, 201, 201, 60, 60, 199, 60, 222, 60, 317, - - 223, 60, 89, 90, 91, 318, 92, 60, 673, 60, - 147, 60, 147, 60, 181, 162, 198, 198, 199, 182, - 60, 89, 90, 93, 60, 94, 61, 205, 205, 206, - 162, 66, 89, 90, 93, 149, 94, 61, 249, 150, - 238, 672, 66, 61, 62, 96, 60, 97, 98, 198, - 198, 199, 270, 99, 61, 62, 96, 149, 97, 98, - 520, 150, 521, 333, 99, 89, 90, 101, 60, 102, - 103, 205, 205, 206, 334, 104, 89, 90, 101, 60, - 102, 103, 60, 60, 60, 60, 104, 89, 90, 105, - 671, 106, 670, 60, 226, 60, 60, 60, 227, 60, - - 60, 345, 274, 669, 228, 60, 89, 90, 105, 242, - 106, 208, 208, 247, 243, 206, 201, 201, 248, 668, - 199, 667, 666, 514, 60, 89, 90, 107, 515, 108, - 61, 527, 665, 664, 663, 66, 89, 90, 107, 528, - 108, 61, 662, 661, 660, 659, 66, 60, 61, 62, - 63, 60, 65, 61, 658, 208, 208, 657, 110, 206, - 656, 655, 654, 653, 652, 651, 650, 649, 648, 111, - 60, 61, 62, 63, 60, 65, 61, 647, 646, 645, - 644, 110, 643, 642, 641, 640, 639, 638, 637, 636, - 635, 634, 111, 60, 61, 62, 63, 60, 65, 61, - - 633, 632, 631, 630, 113, 629, 628, 627, 626, 625, - 624, 623, 622, 621, 620, 619, 618, 617, 616, 114, - 60, 61, 62, 63, 60, 65, 61, 615, 614, 613, - 612, 113, 611, 610, 609, 608, 607, 606, 605, 604, - 603, 602, 601, 600, 599, 598, 114, 115, 116, 597, - 117, 118, 119, 596, 120, 595, 121, 122, 123, 594, - 76, 60, 593, 592, 591, 590, 589, 588, 587, 586, - 585, 584, 124, 583, 582, 581, 60, 580, 579, 578, - 577, 576, 575, 125, 574, 573, 126, 60, 572, 571, - 570, 569, 568, 567, 566, 565, 564, 563, 124, 562, - - 561, 560, 60, 559, 558, 557, 556, 555, 554, 125, - 553, 552, 126, 60, 551, 550, 549, 548, 547, 546, - 127, 545, 128, 544, 60, 543, 129, 130, 60, 542, - 541, 540, 539, 538, 131, 132, 60, 537, 536, 133, - 535, 134, 534, 533, 532, 531, 530, 60, 529, 526, - 525, 60, 524, 135, 136, 523, 522, 137, 519, 518, - 517, 138, 139, 516, 140, 513, 141, 142, 512, 511, - 510, 509, 508, 507, 506, 505, 143, 144, 504, 503, - 145, 502, 501, 500, 146, 60, 499, 498, 497, 496, - 495, 494, 493, 492, 491, 490, 60, 489, 488, 147, - - 60, 487, 486, 485, 484, 483, 482, 148, 60, 481, - 480, 479, 478, 477, 476, 475, 474, 473, 472, 60, - 471, 470, 147, 60, 469, 468, 467, 466, 465, 464, - 148, 60, 463, 462, 461, 460, 459, 458, 457, 151, - 456, 455, 60, 454, 453, 452, 60, 152, 60, 451, - 450, 449, 448, 447, 446, 445, 151, 444, 443, 60, - 442, 441, 440, 60, 152, 60, 439, 438, 437, 436, - 435, 434, 433, 153, 432, 431, 154, 430, 429, 428, - 60, 155, 427, 156, 60, 426, 425, 424, 423, 422, - 421, 420, 153, 419, 418, 154, 417, 416, 415, 60, - - 155, 414, 156, 157, 60, 158, 413, 412, 411, 410, - 409, 408, 407, 406, 405, 60, 404, 403, 402, 60, - 157, 60, 158, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 60, 392, 391, 390, 60, 60, 60, 60, - 95, 95, 95, 100, 100, 100, 109, 109, 109, 112, - 112, 112, 159, 159, 159, 161, 161, 161, 190, 190, - 190, 192, 192, 192, 193, 193, 193, 195, 195, 195, - 196, 389, 196, 197, 197, 197, 200, 200, 200, 203, - 388, 203, 204, 204, 204, 207, 207, 207, 210, 210, - 210, 212, 212, 212, 213, 213, 213, 215, 215, 215, - - 271, 271, 271, 273, 273, 273, 198, 198, 198, 201, - 201, 201, 205, 205, 205, 208, 208, 208, 387, 386, - 385, 384, 383, 382, 381, 380, 379, 378, 377, 376, - 375, 374, 373, 372, 371, 370, 369, 368, 367, 366, - 365, 364, 363, 362, 361, 272, 272, 360, 359, 358, - 357, 356, 355, 354, 353, 352, 351, 350, 349, 348, - 347, 346, 344, 343, 342, 341, 340, 339, 338, 337, - 336, 335, 332, 331, 330, 329, 328, 327, 326, 325, - 324, 323, 322, 321, 320, 319, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 214, 214, 211, - - 211, 305, 304, 304, 303, 302, 302, 194, 194, 191, - 191, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, - 282, 281, 280, 279, 278, 277, 276, 275, 274, 160, - 160, 272, 272, 269, 268, 267, 266, 265, 264, 263, - 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, - 252, 249, 246, 245, 244, 241, 240, 239, 237, 236, - 235, 234, 233, 232, 231, 230, 229, 221, 220, 218, - 217, 214, 214, 211, 211, 209, 202, 194, 194, 191, - 191, 189, 186, 185, 184, 183, 180, 179, 175, 174, - - 173, 172, 171, 167, 166, 165, 164, 163, 162, 160, - 160, 676, 59, 676, 676, 676, 676, 676, 676, 676, + 676, 61, 62, 63, 64, 65, 61, 219, 89, 90, + 91, 66, 92, 201, 201, 67, 164, 199, 166, 68, + 216, 89, 90, 91, 272, 92, 60, 198, 198, 199, + 89, 90, 93, 162, 94, 61, 163, 66, 272, 60, + 66, 67, 164, 165, 166, 68, 61, 62, 63, 64, + 65, 61, 60, 89, 90, 93, 66, 94, 61, 162, + 67, 167, 163, 66, 68, 60, 66, 171, 214, 165, + 172, 214, 173, 61, 62, 96, 211, 97, 98, 205, + 205, 206, 66, 99, 60, 281, 67, 167, 299, 66, + 68, 69, 70, 171, 71, 60, 172, 72, 173, 60, + + 73, 60, 74, 75, 76, 77, 78, 79, 80, 99, + 281, 81, 169, 299, 168, 163, 170, 69, 70, 211, + 71, 60, 304, 72, 60, 60, 73, 60, 74, 75, + 76, 77, 78, 79, 80, 60, 81, 60, 169, 60, + 168, 163, 170, 174, 82, 83, 175, 84, 85, 179, + 180, 86, 87, 61, 62, 96, 304, 97, 98, 88, + 302, 60, 183, 99, 184, 60, 198, 198, 199, 174, + 82, 83, 175, 84, 85, 179, 180, 86, 87, 205, + 205, 206, 89, 90, 101, 88, 102, 103, 183, 99, + 184, 302, 104, 89, 90, 101, 325, 102, 103, 194, + + 185, 194, 176, 104, 89, 90, 105, 177, 106, 89, + 90, 105, 186, 106, 191, 89, 90, 107, 104, 108, + 61, 325, 60, 191, 178, 66, 185, 60, 176, 104, + 89, 90, 107, 177, 108, 61, 160, 189, 186, 60, + 66, 160, 272, 272, 60, 60, 60, 60, 60, 178, + 60, 66, 329, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 60, 189, 60, 331, 66, 60, 61, 62, + 63, 60, 65, 61, 202, 60, 60, 329, 110, 60, + 60, 60, 60, 60, 60, 60, 60, 60, 60, 111, + 331, 60, 60, 208, 208, 214, 214, 206, 209, 60, + + 202, 60, 60, 60, 110, 60, 60, 60, 217, 218, + 60, 211, 211, 147, 60, 111, 60, 61, 62, 63, + 60, 65, 61, 220, 209, 340, 194, 110, 60, 60, + 194, 191, 60, 60, 217, 218, 60, 60, 111, 147, + 60, 191, 160, 60, 60, 60, 60, 221, 60, 220, + 340, 147, 60, 110, 149, 149, 60, 60, 150, 150, + 60, 60, 229, 160, 111, 60, 61, 62, 63, 60, + 65, 61, 676, 221, 60, 676, 113, 147, 60, 676, + 149, 149, 60, 60, 150, 150, 60, 60, 229, 60, + 60, 114, 676, 676, 157, 60, 158, 157, 60, 158, + + 60, 60, 113, 676, 60, 60, 60, 181, 162, 60, + 60, 187, 182, 60, 676, 188, 230, 114, 60, 61, + 62, 63, 60, 65, 61, 222, 60, 60, 223, 113, + 60, 60, 60, 181, 162, 60, 60, 187, 182, 60, + 224, 188, 230, 226, 114, 201, 201, 227, 676, 199, + 676, 222, 349, 228, 223, 113, 676, 231, 676, 232, + 225, 233, 234, 235, 236, 237, 224, 676, 239, 226, + 114, 115, 116, 227, 117, 118, 119, 349, 120, 228, + 121, 122, 123, 231, 76, 232, 225, 233, 234, 235, + 236, 237, 240, 162, 239, 241, 676, 115, 116, 244, + + 117, 118, 119, 238, 120, 245, 121, 122, 123, 242, + 76, 60, 246, 676, 243, 247, 249, 252, 240, 162, + 248, 241, 124, 253, 250, 244, 60, 254, 238, 255, + 256, 245, 257, 125, 258, 242, 126, 259, 246, 243, + 251, 247, 249, 252, 260, 261, 248, 676, 124, 253, + 250, 676, 60, 254, 262, 255, 256, 263, 257, 125, + 258, 126, 60, 259, 264, 251, 265, 266, 267, 268, + 260, 261, 269, 124, 249, 274, 275, 60, 276, 277, + 262, 278, 279, 263, 125, 280, 676, 126, 270, 282, + 264, 283, 265, 266, 267, 268, 676, 284, 269, 124, + + 249, 274, 275, 60, 276, 277, 285, 278, 279, 676, + 125, 280, 126, 60, 270, 282, 286, 283, 287, 288, + 127, 289, 128, 284, 60, 290, 129, 130, 60, 291, + 292, 293, 285, 294, 131, 132, 676, 295, 296, 676, + 297, 676, 286, 298, 287, 288, 127, 289, 128, 300, + 60, 290, 129, 130, 60, 291, 292, 293, 301, 294, + 131, 132, 60, 295, 296, 133, 297, 134, 303, 298, + 208, 208, 305, 60, 206, 300, 306, 60, 307, 135, + 136, 308, 309, 137, 301, 310, 676, 138, 311, 676, + 312, 133, 676, 134, 303, 313, 314, 315, 305, 60, + + 316, 676, 306, 60, 307, 135, 136, 308, 309, 137, + 319, 310, 138, 139, 311, 140, 312, 141, 142, 317, + 320, 313, 314, 315, 321, 318, 316, 143, 144, 322, + 323, 145, 324, 326, 676, 146, 319, 327, 328, 139, + 330, 140, 332, 141, 142, 317, 320, 335, 336, 676, + 321, 318, 446, 143, 144, 322, 323, 145, 324, 326, + 146, 60, 337, 327, 328, 338, 330, 333, 332, 339, + 341, 342, 60, 335, 336, 147, 60, 446, 334, 343, + 344, 345, 274, 148, 676, 346, 347, 348, 337, 350, + 351, 338, 352, 333, 353, 339, 341, 342, 60, 676, + + 354, 147, 60, 334, 355, 343, 344, 345, 274, 148, + 60, 346, 347, 348, 356, 350, 351, 357, 352, 358, + 353, 60, 359, 360, 147, 60, 354, 361, 362, 363, + 355, 364, 148, 676, 365, 366, 367, 368, 369, 370, + 356, 676, 371, 357, 676, 358, 372, 60, 359, 360, + 147, 60, 373, 361, 362, 363, 374, 364, 148, 60, + 365, 366, 367, 368, 369, 370, 375, 151, 371, 376, + 60, 377, 372, 378, 60, 152, 676, 379, 373, 380, + 381, 382, 374, 383, 676, 384, 385, 676, 386, 387, + 388, 676, 375, 151, 389, 376, 60, 377, 390, 378, + + 60, 152, 60, 379, 391, 380, 381, 382, 392, 383, + 151, 384, 385, 60, 386, 387, 388, 60, 152, 676, + 389, 393, 394, 395, 390, 396, 397, 676, 398, 399, + 391, 400, 401, 402, 392, 676, 151, 676, 403, 60, + 404, 405, 406, 60, 152, 60, 407, 393, 394, 395, + 408, 396, 397, 153, 398, 399, 154, 400, 401, 402, + 60, 155, 409, 156, 403, 410, 404, 405, 406, 411, + 412, 413, 407, 414, 415, 676, 408, 416, 417, 153, + 676, 418, 154, 419, 420, 421, 60, 155, 409, 156, + 60, 410, 422, 423, 424, 411, 412, 413, 153, 414, + + 415, 154, 425, 416, 417, 60, 155, 418, 156, 419, + 420, 421, 426, 427, 428, 429, 430, 431, 422, 423, + 424, 432, 433, 434, 153, 435, 436, 154, 425, 437, + 438, 60, 155, 439, 156, 440, 441, 442, 426, 427, + 428, 429, 430, 431, 443, 444, 445, 432, 433, 434, + 447, 435, 436, 448, 449, 437, 438, 450, 451, 439, + 452, 440, 441, 442, 453, 454, 455, 456, 457, 458, + 443, 444, 445, 459, 460, 461, 447, 462, 463, 448, + 449, 464, 465, 450, 451, 452, 466, 467, 468, 469, + 453, 454, 455, 456, 457, 458, 470, 471, 472, 459, + + 460, 461, 473, 462, 463, 474, 475, 464, 465, 476, + 477, 478, 466, 467, 468, 469, 479, 480, 481, 482, + 483, 484, 470, 471, 472, 485, 486, 487, 473, 488, + 489, 474, 475, 490, 491, 476, 477, 478, 492, 493, + 494, 495, 479, 480, 481, 482, 483, 484, 496, 497, + 498, 485, 486, 487, 499, 488, 489, 500, 501, 490, + 491, 502, 503, 504, 492, 493, 494, 495, 505, 506, + 507, 508, 509, 510, 496, 497, 498, 511, 512, 513, + 499, 514, 516, 500, 501, 517, 515, 502, 503, 504, + 518, 519, 522, 523, 505, 506, 507, 508, 509, 510, + + 520, 524, 521, 511, 512, 513, 525, 514, 516, 526, + 529, 517, 515, 527, 530, 531, 518, 519, 522, 523, + 532, 528, 533, 534, 535, 536, 520, 524, 521, 537, + 538, 539, 525, 540, 541, 526, 529, 542, 543, 527, + 530, 531, 544, 545, 546, 547, 532, 528, 533, 534, + 535, 536, 548, 549, 551, 537, 538, 539, 550, 540, + 541, 552, 553, 542, 543, 554, 555, 556, 544, 545, + 546, 547, 557, 558, 559, 560, 561, 562, 548, 549, + 551, 563, 564, 550, 565, 566, 567, 552, 553, 568, + 569, 554, 555, 556, 570, 571, 572, 573, 557, 558, + + 559, 560, 561, 562, 574, 575, 576, 563, 564, 577, + 565, 566, 567, 578, 579, 568, 569, 580, 581, 582, + 570, 571, 572, 573, 583, 584, 585, 586, 587, 588, + 574, 575, 576, 589, 577, 590, 591, 592, 593, 578, + 579, 594, 595, 580, 581, 582, 596, 597, 598, 599, + 583, 584, 585, 586, 587, 588, 600, 601, 602, 589, + 603, 590, 591, 592, 593, 604, 605, 594, 595, 606, + 607, 608, 596, 597, 598, 599, 609, 610, 611, 612, + 613, 614, 600, 601, 602, 615, 603, 616, 617, 618, + 619, 604, 605, 620, 621, 606, 607, 608, 622, 623, + + 624, 625, 609, 610, 611, 612, 613, 614, 626, 627, + 628, 615, 616, 629, 617, 618, 619, 630, 631, 620, + 621, 632, 633, 634, 622, 623, 624, 625, 635, 636, + 637, 638, 639, 640, 626, 627, 628, 641, 642, 629, + 643, 644, 645, 630, 631, 646, 647, 632, 633, 634, + 648, 649, 650, 651, 635, 636, 637, 638, 639, 640, + 652, 653, 654, 641, 642, 655, 643, 644, 645, 656, + 657, 646, 647, 658, 659, 660, 648, 649, 650, 651, + 661, 662, 663, 676, 664, 665, 652, 653, 654, 666, + 667, 655, 668, 669, 670, 656, 657, 671, 672, 658, + + 659, 660, 673, 674, 675, 676, 661, 662, 663, 664, + 676, 665, 676, 676, 676, 666, 667, 676, 668, 669, + 670, 676, 676, 671, 672, 676, 676, 676, 673, 674, + 675, 60, 60, 60, 95, 95, 95, 100, 100, 100, + 109, 109, 109, 112, 112, 112, 159, 159, 159, 161, + 161, 161, 190, 190, 190, 192, 192, 192, 193, 193, + 193, 195, 195, 195, 196, 676, 196, 197, 197, 197, + 200, 200, 200, 203, 676, 203, 204, 204, 204, 207, + 207, 207, 210, 210, 210, 212, 212, 212, 213, 213, + 213, 215, 215, 215, 271, 271, 271, 273, 273, 273, + + 198, 198, 198, 201, 201, 201, 205, 205, 205, 208, + 208, 208, 59, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676 + 676 } ; -static yyconst flex_int16_t yy_chk[947] = +static yyconst flex_int16_t yy_chk[1672] = { 0, - 0, 1, 1, 1, 1, 1, 1, 699, 73, 87, - 698, 1, 73, 87, 0, 1, 27, 28, 29, 1, - 2, 2, 2, 2, 2, 2, 30, 27, 28, 29, - 2, 27, 28, 29, 2, 72, 72, 30, 2, 3, - 3, 30, 3, 116, 672, 3, 35, 36, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 35, 36, 3, - 5, 35, 36, 116, 79, 39, 40, 5, 5, 79, - 5, 5, 137, 671, 5, 5, 39, 40, 41, 42, - 39, 40, 5, 7, 7, 7, 79, 7, 137, 41, - 42, 97, 97, 41, 42, 97, 43, 115, 44, 229, - - 115, 7, 8, 8, 8, 229, 8, 43, 670, 44, - 43, 43, 44, 44, 82, 82, 96, 96, 96, 82, - 8, 9, 9, 9, 47, 9, 9, 101, 101, 101, - 127, 9, 10, 10, 10, 47, 10, 10, 156, 47, - 127, 669, 10, 11, 11, 11, 48, 11, 11, 197, - 197, 197, 156, 11, 12, 12, 12, 48, 12, 12, - 461, 48, 461, 244, 12, 13, 13, 13, 53, 13, - 13, 204, 204, 204, 244, 13, 14, 14, 14, 53, - 14, 14, 54, 53, 55, 56, 14, 15, 15, 15, - 665, 15, 664, 54, 117, 55, 56, 54, 117, 55, - - 56, 255, 255, 663, 117, 15, 16, 16, 16, 131, - 16, 102, 102, 135, 131, 102, 200, 200, 135, 661, - 200, 660, 659, 456, 16, 17, 17, 17, 456, 17, - 17, 468, 658, 657, 655, 17, 18, 18, 18, 468, - 18, 18, 654, 652, 651, 650, 18, 19, 19, 19, - 19, 19, 19, 19, 648, 207, 207, 646, 19, 207, - 644, 643, 641, 640, 639, 638, 637, 635, 633, 19, - 20, 20, 20, 20, 20, 20, 20, 632, 631, 629, - 628, 20, 626, 622, 621, 619, 618, 615, 612, 611, - 608, 606, 20, 21, 21, 21, 21, 21, 21, 21, - - 605, 604, 603, 602, 21, 601, 598, 596, 595, 594, - 593, 591, 589, 588, 587, 586, 585, 584, 583, 21, - 22, 22, 22, 22, 22, 22, 22, 582, 581, 580, - 578, 22, 576, 575, 574, 573, 572, 571, 570, 569, - 567, 566, 565, 563, 562, 561, 22, 23, 23, 560, - 23, 23, 23, 559, 23, 558, 23, 23, 23, 557, - 23, 25, 556, 555, 554, 553, 552, 551, 550, 548, - 545, 543, 25, 542, 541, 540, 25, 538, 537, 536, - 535, 534, 533, 25, 531, 530, 25, 26, 529, 528, - 527, 524, 523, 522, 521, 520, 519, 518, 26, 517, - - 516, 515, 26, 514, 511, 510, 509, 508, 507, 26, - 506, 505, 26, 31, 504, 502, 501, 500, 498, 497, - 31, 495, 31, 494, 31, 492, 31, 31, 31, 490, - 489, 488, 484, 483, 31, 31, 33, 482, 481, 33, - 480, 33, 478, 477, 476, 473, 471, 33, 469, 467, - 465, 33, 464, 33, 33, 463, 462, 33, 460, 459, - 458, 33, 37, 457, 37, 455, 37, 37, 454, 451, - 450, 449, 448, 447, 446, 445, 37, 37, 444, 443, - 37, 441, 440, 439, 37, 45, 438, 437, 436, 434, - 431, 430, 429, 428, 427, 424, 45, 423, 421, 45, - - 45, 420, 419, 418, 417, 416, 415, 45, 46, 414, - 413, 412, 411, 409, 408, 407, 406, 405, 404, 46, - 403, 401, 46, 46, 399, 398, 396, 395, 393, 392, - 46, 49, 391, 388, 387, 385, 384, 383, 382, 49, - 381, 380, 49, 379, 378, 377, 49, 49, 50, 376, - 375, 374, 373, 372, 371, 370, 50, 369, 367, 50, - 366, 365, 364, 50, 50, 51, 363, 362, 361, 360, - 359, 358, 357, 51, 356, 355, 51, 354, 353, 352, - 51, 51, 351, 51, 52, 350, 349, 348, 347, 346, - 345, 344, 52, 343, 342, 52, 341, 340, 339, 52, - - 52, 338, 52, 57, 57, 57, 337, 336, 335, 334, - 333, 332, 331, 330, 329, 57, 328, 327, 325, 57, - 58, 58, 58, 324, 323, 322, 321, 320, 319, 318, - 317, 316, 58, 315, 314, 313, 58, 677, 677, 677, - 678, 678, 678, 679, 679, 679, 680, 680, 680, 681, - 681, 681, 682, 682, 682, 683, 683, 683, 684, 684, - 684, 685, 685, 685, 686, 686, 686, 687, 687, 687, - 688, 312, 688, 689, 689, 689, 690, 690, 690, 691, - 311, 691, 692, 692, 692, 693, 693, 693, 694, 694, - 694, 695, 695, 695, 696, 696, 696, 697, 697, 697, - - 700, 700, 700, 701, 701, 701, 702, 702, 702, 703, - 703, 703, 704, 704, 704, 705, 705, 705, 310, 309, - 307, 301, 300, 299, 297, 296, 295, 294, 293, 291, - 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, - 280, 279, 278, 277, 275, 273, 271, 270, 269, 268, - 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, - 257, 256, 254, 253, 252, 251, 250, 249, 248, 247, - 246, 245, 243, 242, 241, 240, 239, 238, 237, 236, - 235, 234, 233, 232, 231, 230, 228, 227, 226, 225, - 224, 223, 222, 221, 220, 218, 217, 215, 213, 212, - - 210, 209, 208, 205, 202, 201, 198, 195, 193, 192, - 190, 189, 188, 187, 186, 185, 184, 183, 182, 181, - 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, - 170, 169, 168, 167, 166, 165, 164, 163, 162, 161, - 159, 158, 157, 155, 154, 153, 152, 151, 150, 149, - 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, - 138, 136, 134, 133, 132, 130, 129, 128, 126, 125, - 124, 123, 122, 121, 120, 119, 118, 114, 113, 111, - 110, 108, 107, 106, 105, 104, 99, 94, 93, 92, - 91, 88, 86, 85, 84, 83, 81, 80, 78, 77, - - 76, 75, 74, 71, 70, 69, 68, 67, 66, 65, - 63, 59, 676, 676, 676, 676, 676, 676, 676, 676, + 0, 1, 1, 1, 1, 1, 1, 699, 7, 7, + 7, 1, 7, 97, 97, 1, 68, 97, 70, 1, + 698, 8, 8, 8, 273, 8, 7, 96, 96, 96, + 9, 9, 9, 66, 9, 9, 67, 1, 271, 8, + 9, 1, 68, 69, 70, 1, 2, 2, 2, 2, + 2, 2, 7, 10, 10, 10, 2, 10, 10, 66, + 2, 71, 67, 10, 2, 8, 9, 74, 215, 69, + 75, 213, 76, 11, 11, 11, 212, 11, 11, 101, + 101, 101, 2, 11, 27, 169, 2, 71, 187, 10, + 2, 3, 3, 74, 3, 27, 75, 3, 76, 27, + + 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, + 169, 3, 73, 187, 72, 72, 73, 3, 3, 210, + 3, 27, 208, 3, 28, 27, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 28, 3, 5, 73, 28, + 72, 72, 73, 77, 5, 5, 78, 5, 5, 80, + 81, 5, 5, 12, 12, 12, 205, 12, 12, 5, + 201, 28, 83, 12, 84, 28, 197, 197, 197, 77, + 5, 5, 78, 5, 5, 80, 81, 5, 5, 204, + 204, 204, 13, 13, 13, 5, 13, 13, 83, 12, + 84, 198, 13, 14, 14, 14, 236, 14, 14, 195, + + 85, 193, 79, 14, 15, 15, 15, 79, 15, 16, + 16, 16, 86, 16, 192, 17, 17, 17, 13, 17, + 17, 236, 15, 190, 79, 17, 85, 16, 79, 14, + 18, 18, 18, 79, 18, 18, 161, 88, 86, 29, + 18, 159, 158, 157, 30, 35, 36, 39, 15, 79, + 29, 17, 240, 16, 29, 30, 35, 36, 39, 30, + 35, 36, 39, 88, 40, 242, 18, 19, 19, 19, + 19, 19, 19, 19, 99, 40, 29, 240, 19, 40, + 29, 30, 35, 36, 39, 30, 35, 36, 39, 19, + 242, 41, 42, 102, 102, 108, 107, 102, 104, 43, + + 99, 40, 41, 42, 19, 40, 41, 42, 110, 111, + 43, 106, 105, 43, 43, 19, 20, 20, 20, 20, + 20, 20, 20, 113, 104, 250, 94, 20, 41, 42, + 93, 92, 41, 42, 110, 111, 43, 44, 20, 43, + 43, 91, 65, 47, 48, 53, 54, 114, 44, 113, + 250, 44, 44, 20, 47, 48, 53, 54, 47, 48, + 53, 54, 118, 63, 20, 21, 21, 21, 21, 21, + 21, 21, 59, 114, 44, 0, 21, 44, 44, 0, + 47, 48, 53, 54, 47, 48, 53, 54, 118, 55, + 56, 21, 0, 0, 57, 57, 57, 58, 58, 58, + + 55, 56, 21, 0, 55, 56, 57, 82, 82, 58, + 57, 87, 82, 58, 0, 87, 119, 21, 22, 22, + 22, 22, 22, 22, 22, 115, 55, 56, 115, 22, + 55, 56, 57, 82, 82, 58, 57, 87, 82, 58, + 116, 87, 119, 117, 22, 200, 200, 117, 0, 200, + 0, 115, 259, 117, 115, 22, 0, 120, 0, 121, + 116, 122, 123, 124, 125, 126, 116, 0, 128, 117, + 22, 23, 23, 117, 23, 23, 23, 259, 23, 117, + 23, 23, 23, 120, 23, 121, 116, 122, 123, 124, + 125, 126, 129, 127, 128, 130, 0, 23, 23, 132, + + 23, 23, 23, 127, 23, 133, 23, 23, 23, 131, + 23, 25, 134, 0, 131, 135, 136, 138, 129, 127, + 135, 130, 25, 139, 137, 132, 25, 140, 127, 141, + 142, 133, 143, 25, 144, 131, 25, 145, 134, 131, + 137, 135, 136, 138, 146, 147, 135, 0, 25, 139, + 137, 0, 25, 140, 148, 141, 142, 149, 143, 25, + 144, 25, 26, 145, 150, 137, 151, 152, 153, 154, + 146, 147, 155, 26, 156, 162, 163, 26, 164, 165, + 148, 166, 167, 149, 26, 168, 0, 26, 156, 170, + 150, 171, 151, 152, 153, 154, 0, 172, 155, 26, + + 156, 162, 163, 26, 164, 165, 173, 166, 167, 0, + 26, 168, 26, 31, 156, 170, 174, 171, 175, 176, + 31, 177, 31, 172, 31, 178, 31, 31, 31, 179, + 180, 181, 173, 182, 31, 31, 0, 183, 184, 0, + 185, 0, 174, 186, 175, 176, 31, 177, 31, 188, + 31, 178, 31, 31, 31, 179, 180, 181, 189, 182, + 31, 31, 33, 183, 184, 33, 185, 33, 202, 186, + 207, 207, 209, 33, 207, 188, 217, 33, 218, 33, + 33, 220, 221, 33, 189, 222, 0, 33, 223, 0, + 224, 33, 0, 33, 202, 225, 226, 227, 209, 33, + + 228, 0, 217, 33, 218, 33, 33, 220, 221, 33, + 230, 222, 33, 37, 223, 37, 224, 37, 37, 229, + 231, 225, 226, 227, 232, 229, 228, 37, 37, 233, + 234, 37, 235, 237, 0, 37, 230, 238, 239, 37, + 241, 37, 243, 37, 37, 229, 231, 245, 246, 0, + 232, 229, 371, 37, 37, 233, 234, 37, 235, 237, + 37, 45, 247, 238, 239, 248, 241, 244, 243, 249, + 251, 252, 45, 245, 246, 45, 45, 371, 244, 253, + 254, 255, 255, 45, 0, 256, 257, 258, 247, 260, + 261, 248, 262, 244, 263, 249, 251, 252, 45, 0, + + 264, 45, 45, 244, 265, 253, 254, 255, 255, 45, + 46, 256, 257, 258, 266, 260, 261, 267, 262, 268, + 263, 46, 269, 270, 46, 46, 264, 275, 277, 278, + 265, 279, 46, 0, 280, 281, 282, 283, 284, 285, + 266, 0, 286, 267, 0, 268, 287, 46, 269, 270, + 46, 46, 288, 275, 277, 278, 289, 279, 46, 49, + 280, 281, 282, 283, 284, 285, 290, 49, 286, 291, + 49, 293, 287, 294, 49, 49, 0, 295, 288, 296, + 297, 299, 289, 300, 0, 301, 307, 0, 309, 310, + 311, 0, 290, 49, 312, 291, 49, 293, 313, 294, + + 49, 49, 50, 295, 314, 296, 297, 299, 315, 300, + 50, 301, 307, 50, 309, 310, 311, 50, 50, 0, + 312, 316, 317, 318, 313, 319, 320, 0, 321, 322, + 314, 323, 324, 325, 315, 0, 50, 0, 327, 50, + 328, 329, 330, 50, 50, 51, 331, 316, 317, 318, + 332, 319, 320, 51, 321, 322, 51, 323, 324, 325, + 51, 51, 333, 51, 327, 334, 328, 329, 330, 335, + 336, 337, 331, 338, 339, 0, 332, 340, 341, 51, + 0, 342, 51, 343, 344, 345, 51, 51, 333, 51, + 52, 334, 346, 347, 348, 335, 336, 337, 52, 338, + + 339, 52, 349, 340, 341, 52, 52, 342, 52, 343, + 344, 345, 350, 351, 352, 353, 354, 355, 346, 347, + 348, 356, 357, 358, 52, 359, 360, 52, 349, 361, + 362, 52, 52, 363, 52, 364, 365, 366, 350, 351, + 352, 353, 354, 355, 367, 369, 370, 356, 357, 358, + 372, 359, 360, 373, 374, 361, 362, 375, 376, 363, + 377, 364, 365, 366, 378, 379, 380, 381, 382, 383, + 367, 369, 370, 384, 385, 387, 372, 388, 391, 373, + 374, 392, 393, 375, 376, 377, 395, 396, 398, 399, + 378, 379, 380, 381, 382, 383, 401, 403, 404, 384, + + 385, 387, 405, 388, 391, 406, 407, 392, 393, 408, + 409, 411, 395, 396, 398, 399, 412, 413, 414, 415, + 416, 417, 401, 403, 404, 418, 419, 420, 405, 421, + 423, 406, 407, 424, 427, 408, 409, 411, 428, 429, + 430, 431, 412, 413, 414, 415, 416, 417, 434, 436, + 437, 418, 419, 420, 438, 421, 423, 439, 440, 424, + 427, 441, 443, 444, 428, 429, 430, 431, 445, 446, + 447, 448, 449, 450, 434, 436, 437, 451, 454, 455, + 438, 456, 457, 439, 440, 458, 456, 441, 443, 444, + 459, 460, 462, 463, 445, 446, 447, 448, 449, 450, + + 461, 464, 461, 451, 454, 455, 465, 456, 457, 467, + 469, 458, 456, 468, 471, 473, 459, 460, 462, 463, + 476, 468, 477, 478, 480, 481, 461, 464, 461, 482, + 483, 484, 465, 488, 489, 467, 469, 490, 492, 468, + 471, 473, 494, 495, 497, 498, 476, 468, 477, 478, + 480, 481, 500, 501, 504, 482, 483, 484, 502, 488, + 489, 505, 506, 490, 492, 507, 508, 509, 494, 495, + 497, 498, 510, 511, 514, 515, 516, 517, 500, 501, + 504, 518, 519, 502, 520, 521, 522, 505, 506, 523, + 524, 507, 508, 509, 527, 528, 529, 530, 510, 511, + + 514, 515, 516, 517, 531, 533, 534, 518, 519, 535, + 520, 521, 522, 536, 537, 523, 524, 538, 540, 541, + 527, 528, 529, 530, 542, 543, 545, 548, 550, 551, + 531, 533, 534, 552, 535, 553, 554, 555, 556, 536, + 537, 557, 558, 538, 540, 541, 559, 560, 561, 562, + 542, 543, 545, 548, 550, 551, 563, 565, 566, 552, + 567, 553, 554, 555, 556, 569, 570, 557, 558, 571, + 572, 573, 559, 560, 561, 562, 574, 575, 576, 578, + 580, 581, 563, 565, 566, 582, 567, 583, 584, 585, + 586, 569, 570, 587, 588, 571, 572, 573, 589, 591, + + 593, 594, 574, 575, 576, 578, 580, 581, 595, 596, + 598, 582, 583, 601, 584, 585, 586, 602, 603, 587, + 588, 604, 605, 606, 589, 591, 593, 594, 608, 611, + 612, 615, 618, 619, 595, 596, 598, 621, 622, 601, + 626, 628, 629, 602, 603, 631, 632, 604, 605, 606, + 633, 635, 637, 638, 608, 611, 612, 615, 618, 619, + 639, 640, 641, 621, 622, 643, 626, 628, 629, 644, + 646, 631, 632, 648, 650, 651, 633, 635, 637, 638, + 652, 654, 655, 0, 657, 658, 639, 640, 641, 659, + 660, 643, 661, 663, 664, 644, 646, 665, 669, 648, + + 650, 651, 670, 671, 672, 0, 652, 654, 655, 657, + 0, 658, 0, 0, 0, 659, 660, 0, 661, 663, + 664, 0, 0, 665, 669, 0, 0, 0, 670, 671, + 672, 677, 677, 677, 678, 678, 678, 679, 679, 679, + 680, 680, 680, 681, 681, 681, 682, 682, 682, 683, + 683, 683, 684, 684, 684, 685, 685, 685, 686, 686, + 686, 687, 687, 687, 688, 0, 688, 689, 689, 689, + 690, 690, 690, 691, 0, 691, 692, 692, 692, 693, + 693, 693, 694, 694, 694, 695, 695, 695, 696, 696, + 696, 697, 697, 697, 700, 700, 700, 701, 701, 701, + + 702, 702, 702, 703, 703, 703, 704, 704, 704, 705, + 705, 705, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676 + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676 } ; static yy_state_type yy_last_accepting_state; @@ -893,8 +1046,8 @@ int yy_flex_debug = 0; #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "mapfile.l" -#line 2 "mapfile.l" +#line 1 "src/mapfile/mapfile.l" +#line 2 "src/mapfile/mapfile.l" #include @@ -1434,14 +1587,15 @@ static void end_layer() if (!map_l->storage->schema->use) buffer_add_str(map_l->storage->schema, "public"); if (!map_is_dump) map_l->retrievable=map_l->writable = false; - map_l->name_prefix = buffer_init(); + + map_l->name_prefix = buffer_init(); buffer_copy(map_l->name_prefix, map_l->name); if (map_l->ns_prefix->use) { buffer_add_head(map_l->name_prefix, ':'); buffer_add_head_str(map_l->name_prefix, map_l->ns_prefix->buf); } - map_l->name_no_uri = buffer_init(); + map_l->name_no_uri = buffer_init(); buffer_copy(map_l->name_no_uri, map_l->name); if (map_l->ns_uri->use) { buffer_add_head(map_l->name, ':'); @@ -1483,7 +1637,7 @@ static void end_layer() -#line 1486 "src/mapfile/mapfile.c" +#line 1639 "src/mapfile/mapfile.c" #define INITIAL 0 #define MAP 1 @@ -1520,7 +1674,7 @@ static void end_layer() * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ - #ifndef _WIN32 +#ifndef _WIN32 #include #endif #endif @@ -1552,7 +1706,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -int yyget_leng (void ); +yy_size_t yyget_leng (void ); char *yyget_text (void ); @@ -1602,12 +1756,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1615,7 +1764,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1626,7 +1775,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + yy_size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1708,10 +1857,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 599 "mapfile.l" +#line 598 "src/mapfile/mapfile.l" -#line 1712 "src/mapfile/mapfile.c" +#line 1860 "src/mapfile/mapfile.c" if ( !(yy_init) ) { @@ -1792,23 +1941,23 @@ YY_DECL case 1: YY_RULE_SETUP -#line 601 "mapfile.l" +#line 600 "src/mapfile/mapfile.l" { char c ; for (c=input() ; c && c != '\n' ; c=input()); } YY_BREAK case 2: YY_RULE_SETUP -#line 602 "mapfile.l" +#line 601 "src/mapfile/mapfile.l" { yy_push_state(INCLUDE); OWS_MAP_DBG } YY_BREAK case 3: YY_RULE_SETUP -#line 605 "mapfile.l" +#line 604 "src/mapfile/mapfile.l" { /*LEGEND rule must appears before END... */ yy_push_state(LEGEND); OWS_MAP_DBG } YY_BREAK case 4: YY_RULE_SETUP -#line 608 "mapfile.l" +#line 607 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE if (yy_top_state() == INITIAL && YY_START != MAP) { @@ -1822,483 +1971,483 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 619 "mapfile.l" +#line 618 "src/mapfile/mapfile.l" { yy_push_state(MAP); OWS_MAP_DBG } YY_BREAK case 6: YY_RULE_SETUP -#line 620 "mapfile.l" +#line 619 "src/mapfile/mapfile.l" { yy_push_state(WEB); OWS_MAP_DBG } YY_BREAK case 7: YY_RULE_SETUP -#line 621 "mapfile.l" +#line 620 "src/mapfile/mapfile.l" { yy_push_state(QUERYMAP); OWS_MAP_DBG } YY_BREAK case 8: YY_RULE_SETUP -#line 622 "mapfile.l" +#line 621 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE /* must be before SYMBOL */ } YY_BREAK case 9: YY_RULE_SETUP -#line 623 "mapfile.l" +#line 622 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 10: YY_RULE_SETUP -#line 624 "mapfile.l" +#line 623 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 11: YY_RULE_SETUP -#line 625 "mapfile.l" +#line 624 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 12: YY_RULE_SETUP -#line 626 "mapfile.l" +#line 625 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 13: YY_RULE_SETUP -#line 627 "mapfile.l" +#line 626 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 14: YY_RULE_SETUP -#line 628 "mapfile.l" +#line 627 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 15: YY_RULE_SETUP -#line 629 "mapfile.l" +#line 628 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 16: YY_RULE_SETUP -#line 630 "mapfile.l" +#line 629 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 17: YY_RULE_SETUP -#line 631 "mapfile.l" +#line 630 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 18: YY_RULE_SETUP -#line 632 "mapfile.l" +#line 631 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 19: YY_RULE_SETUP -#line 633 "mapfile.l" +#line 632 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 20: YY_RULE_SETUP -#line 634 "mapfile.l" +#line 633 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 21: YY_RULE_SETUP -#line 635 "mapfile.l" +#line 634 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 22: YY_RULE_SETUP -#line 636 "mapfile.l" +#line 635 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 23: YY_RULE_SETUP -#line 637 "mapfile.l" +#line 636 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 24: YY_RULE_SETUP -#line 638 "mapfile.l" +#line 637 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 25: YY_RULE_SETUP -#line 639 "mapfile.l" +#line 638 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 26: YY_RULE_SETUP -#line 640 "mapfile.l" +#line 639 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 27: YY_RULE_SETUP -#line 641 "mapfile.l" +#line 640 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 28: YY_RULE_SETUP -#line 642 "mapfile.l" +#line 641 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 29: YY_RULE_SETUP -#line 643 "mapfile.l" +#line 642 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 30: YY_RULE_SETUP -#line 644 "mapfile.l" +#line 643 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 31: YY_RULE_SETUP -#line 645 "mapfile.l" +#line 644 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 32: YY_RULE_SETUP -#line 646 "mapfile.l" +#line 645 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 33: YY_RULE_SETUP -#line 647 "mapfile.l" +#line 646 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 34: YY_RULE_SETUP -#line 648 "mapfile.l" +#line 647 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 35: YY_RULE_SETUP -#line 649 "mapfile.l" +#line 648 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 36: YY_RULE_SETUP -#line 650 "mapfile.l" +#line 649 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 37: YY_RULE_SETUP -#line 651 "mapfile.l" +#line 650 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 38: YY_RULE_SETUP -#line 652 "mapfile.l" +#line 651 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 39: YY_RULE_SETUP -#line 653 "mapfile.l" +#line 652 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 40: YY_RULE_SETUP -#line 654 "mapfile.l" +#line 653 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 41: YY_RULE_SETUP -#line 655 "mapfile.l" +#line 654 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 42: YY_RULE_SETUP -#line 656 "mapfile.l" +#line 655 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 43: YY_RULE_SETUP -#line 657 "mapfile.l" +#line 656 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 44: YY_RULE_SETUP -#line 658 "mapfile.l" +#line 657 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 45: YY_RULE_SETUP -#line 659 "mapfile.l" +#line 658 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 46: YY_RULE_SETUP -#line 660 "mapfile.l" +#line 659 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 47: YY_RULE_SETUP -#line 661 "mapfile.l" +#line 660 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 48: YY_RULE_SETUP -#line 662 "mapfile.l" +#line 661 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 49: YY_RULE_SETUP -#line 663 "mapfile.l" +#line 662 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 50: YY_RULE_SETUP -#line 664 "mapfile.l" +#line 663 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 51: YY_RULE_SETUP -#line 665 "mapfile.l" +#line 664 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 52: YY_RULE_SETUP -#line 666 "mapfile.l" +#line 665 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 53: YY_RULE_SETUP -#line 667 "mapfile.l" +#line 666 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 54: YY_RULE_SETUP -#line 668 "mapfile.l" +#line 667 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 55: YY_RULE_SETUP -#line 669 "mapfile.l" +#line 668 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 56: YY_RULE_SETUP -#line 670 "mapfile.l" +#line 669 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 57: YY_RULE_SETUP -#line 671 "mapfile.l" +#line 670 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 58: YY_RULE_SETUP -#line 672 "mapfile.l" +#line 671 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 59: YY_RULE_SETUP -#line 673 "mapfile.l" +#line 672 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 60: YY_RULE_SETUP -#line 674 "mapfile.l" +#line 673 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 61: YY_RULE_SETUP -#line 675 "mapfile.l" +#line 674 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 62: YY_RULE_SETUP -#line 676 "mapfile.l" +#line 675 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 63: YY_RULE_SETUP -#line 677 "mapfile.l" +#line 676 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 64: YY_RULE_SETUP -#line 678 "mapfile.l" +#line 677 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 65: YY_RULE_SETUP -#line 679 "mapfile.l" +#line 678 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 66: YY_RULE_SETUP -#line 680 "mapfile.l" +#line 679 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 67: YY_RULE_SETUP -#line 681 "mapfile.l" +#line 680 "src/mapfile/mapfile.l" { OWS_MAP_EATLINE } YY_BREAK case 68: YY_RULE_SETUP -#line 683 "mapfile.l" +#line 682 "src/mapfile/mapfile.l" { yy_push_state(SYMBOL); OWS_MAP_DBG } YY_BREAK case 69: YY_RULE_SETUP -#line 684 "mapfile.l" +#line 683 "src/mapfile/mapfile.l" { yy_push_state(SCALEBAR); OWS_MAP_DBG } YY_BREAK case 70: YY_RULE_SETUP -#line 685 "mapfile.l" +#line 684 "src/mapfile/mapfile.l" { yy_push_state(REFERENCE); OWS_MAP_DBG } YY_BREAK case 71: YY_RULE_SETUP -#line 686 "mapfile.l" +#line 685 "src/mapfile/mapfile.l" { yy_push_state(OUTPUTFORMAT); OWS_MAP_DBG } YY_BREAK case 72: YY_RULE_SETUP -#line 687 "mapfile.l" +#line 686 "src/mapfile/mapfile.l" { yy_push_state(METADATA); OWS_MAP_DBG } YY_BREAK case 73: YY_RULE_SETUP -#line 688 "mapfile.l" +#line 687 "src/mapfile/mapfile.l" { yy_push_state(GRID); OWS_MAP_DBG } YY_BREAK case 74: YY_RULE_SETUP -#line 689 "mapfile.l" +#line 688 "src/mapfile/mapfile.l" { yy_push_state(JOIN); OWS_MAP_DBG } YY_BREAK case 75: YY_RULE_SETUP -#line 690 "mapfile.l" +#line 689 "src/mapfile/mapfile.l" { yy_push_state(LAYER_METADATA); OWS_MAP_DBG } YY_BREAK case 76: YY_RULE_SETUP -#line 691 "mapfile.l" +#line 690 "src/mapfile/mapfile.l" { yy_push_state(CLASS); OWS_MAP_DBG } YY_BREAK case 77: YY_RULE_SETUP -#line 692 "mapfile.l" +#line 691 "src/mapfile/mapfile.l" { yy_push_state(STYLE); OWS_MAP_DBG } YY_BREAK case 78: YY_RULE_SETUP -#line 693 "mapfile.l" +#line 692 "src/mapfile/mapfile.l" { yy_push_state(LABEL); OWS_MAP_DBG } YY_BREAK case 79: YY_RULE_SETUP -#line 694 "mapfile.l" +#line 693 "src/mapfile/mapfile.l" { yy_push_state(PROJECTION); OWS_MAP_DBG } YY_BREAK case 80: YY_RULE_SETUP -#line 695 "mapfile.l" +#line 694 "src/mapfile/mapfile.l" { yy_push_state(PATTERN); OWS_MAP_DBG } YY_BREAK case 81: YY_RULE_SETUP -#line 696 "mapfile.l" +#line 695 "src/mapfile/mapfile.l" { yy_push_state(POINTS); OWS_MAP_DBG } YY_BREAK case 82: YY_RULE_SETUP -#line 697 "mapfile.l" +#line 696 "src/mapfile/mapfile.l" { yy_push_state(LABEL); OWS_MAP_DBG } YY_BREAK case 83: YY_RULE_SETUP -#line 698 "mapfile.l" +#line 697 "src/mapfile/mapfile.l" { yy_push_state(LAYER); map_l = ows_layer_init(); OWS_MAP_DBG } YY_BREAK case 84: YY_RULE_SETUP -#line 699 "mapfile.l" +#line 698 "src/mapfile/mapfile.l" { yy_push_state(FEATURE); OWS_MAP_DBG } YY_BREAK case 85: YY_RULE_SETUP -#line 700 "mapfile.l" +#line 699 "src/mapfile/mapfile.l" { BEGIN PROPERTIES; map_prop_state = MAP_NAME; } YY_BREAK case 86: YY_RULE_SETUP -#line 701 "mapfile.l" +#line 700 "src/mapfile/mapfile.l" { BEGIN LAYER_PROPERTIES; map_layer_prop_state = MAP_LAYER_NAME; } YY_BREAK case 87: YY_RULE_SETUP -#line 702 "mapfile.l" +#line 701 "src/mapfile/mapfile.l" { BEGIN LAYER_PROPERTIES; map_layer_prop_state = MAP_LAYER_CONNECTION; } YY_BREAK case 88: YY_RULE_SETUP -#line 703 "mapfile.l" +#line 702 "src/mapfile/mapfile.l" { BEGIN LAYER_CONNECTIONTYPE; } YY_BREAK case 89: YY_RULE_SETUP -#line 704 "mapfile.l" +#line 703 "src/mapfile/mapfile.l" { BEGIN LAYER; map_is_postgis=true; } YY_BREAK case 90: YY_RULE_SETUP -#line 705 "mapfile.l" +#line 704 "src/mapfile/mapfile.l" { BEGIN LAYER; map_is_postgis=false; } YY_BREAK case 91: YY_RULE_SETUP -#line 706 "mapfile.l" +#line 705 "src/mapfile/mapfile.l" { BEGIN LAYER_DUMP; } YY_BREAK case 92: YY_RULE_SETUP -#line 707 "mapfile.l" +#line 706 "src/mapfile/mapfile.l" { BEGIN LAYER; map_is_dump=true; } YY_BREAK case 93: YY_RULE_SETUP -#line 708 "mapfile.l" +#line 707 "src/mapfile/mapfile.l" { BEGIN LAYER; map_is_dump=false; } YY_BREAK case 94: /* rule 94 can match eol */ YY_RULE_SETUP -#line 710 "mapfile.l" +#line 709 "src/mapfile/mapfile.l" {} YY_BREAK case 95: /* rule 95 can match eol */ YY_RULE_SETUP -#line 712 "mapfile.l" +#line 711 "src/mapfile/mapfile.l" {metadata_key(yytext, true); BEGIN METADATA_VALUE;} YY_BREAK case 96: /* rule 96 can match eol */ YY_RULE_SETUP -#line 713 "mapfile.l" +#line 712 "src/mapfile/mapfile.l" {metadata_value(yytext, true); BEGIN METADATA;} YY_BREAK case 97: /* rule 97 can match eol */ YY_RULE_SETUP -#line 714 "mapfile.l" +#line 713 "src/mapfile/mapfile.l" {metadata_layer_key(yytext, true); BEGIN LAYER_METADATA_VALUE;} YY_BREAK case 98: /* rule 98 can match eol */ YY_RULE_SETUP -#line 715 "mapfile.l" +#line 714 "src/mapfile/mapfile.l" {metadata_layer_value(yytext, true); BEGIN LAYER_METADATA;} YY_BREAK case 99: /* rule 99 can match eol */ YY_RULE_SETUP -#line 716 "mapfile.l" +#line 715 "src/mapfile/mapfile.l" { char *p, *q; @@ -2332,40 +2481,40 @@ YY_RULE_SETUP case 100: /* rule 100 can match eol */ YY_RULE_SETUP -#line 747 "mapfile.l" +#line 746 "src/mapfile/mapfile.l" {properties(yytext, true); BEGIN MAP;} YY_BREAK case 101: YY_RULE_SETUP -#line 748 "mapfile.l" +#line 747 "src/mapfile/mapfile.l" {properties(yytext, false); BEGIN MAP;} YY_BREAK case 102: /* rule 102 can match eol */ YY_RULE_SETUP -#line 749 "mapfile.l" +#line 748 "src/mapfile/mapfile.l" {layer_properties(yytext, true); BEGIN LAYER;} YY_BREAK case 103: YY_RULE_SETUP -#line 750 "mapfile.l" +#line 749 "src/mapfile/mapfile.l" {layer_properties(yytext, false); BEGIN LAYER;} YY_BREAK case 104: /* rule 104 can match eol */ YY_RULE_SETUP -#line 751 "mapfile.l" +#line 750 "src/mapfile/mapfile.l" {} YY_BREAK case 105: YY_RULE_SETUP -#line 752 "mapfile.l" +#line 751 "src/mapfile/mapfile.l" {} YY_BREAK case 106: /* rule 106 can match eol */ YY_RULE_SETUP -#line 753 "mapfile.l" +#line 752 "src/mapfile/mapfile.l" {} YY_BREAK case YY_STATE_EOF(INITIAL): @@ -2397,7 +2546,7 @@ case YY_STATE_EOF(SYMBOL): case YY_STATE_EOF(PATTERN): case YY_STATE_EOF(POINTS): case YY_STATE_EOF(INCLUDE): -#line 755 "mapfile.l" +#line 754 "src/mapfile/mapfile.l" { /* End of main file */ if (map_include_stack_ptr == 0 && YY_START == 0) yyterminate(); @@ -2415,10 +2564,10 @@ case YY_STATE_EOF(INCLUDE): YY_BREAK case 107: YY_RULE_SETUP -#line 770 "mapfile.l" +#line 769 "src/mapfile/mapfile.l" ECHO; YY_BREAK -#line 2419 "src/mapfile/mapfile.c" +#line 2567 "src/mapfile/mapfile.c" case YY_END_OF_BUFFER: { @@ -2603,7 +2752,7 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) @@ -2617,7 +2766,7 @@ static int yy_get_next_buffer (void) if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -2648,7 +2797,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -2770,7 +2919,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2794,7 +2943,7 @@ static int yy_get_next_buffer (void) case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) - return EOF; + return 0; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; @@ -3042,7 +3191,7 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -3134,17 +3283,16 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; - yy_size_t n; - int i; + yy_size_t n, i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -3263,7 +3411,7 @@ FILE *yyget_out (void) /** Get the length of the current token. * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } @@ -3419,7 +3567,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 770 "mapfile.l" +#line 769 "src/mapfile/mapfile.l" From 51efe9182256564f52b5d8860f442205a9aed43a Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sat, 12 Jun 2021 15:28:10 -0300 Subject: [PATCH 32/61] handle PostGIS 3.1 --- demo/install.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/install.sh.in b/demo/install.sh.in index 89de7d51..a2bd50b1 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -11,7 +11,9 @@ PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then +if [ -d /usr/local/pgsql/share/contrib/postgis-3.1 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 From c31674208ea186ed965ecede88660d4a3515fd2e Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sat, 12 Jun 2021 15:33:13 -0300 Subject: [PATCH 33/61] fix indentation --- src/mapfile/mapfile.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mapfile/mapfile.l b/src/mapfile/mapfile.l index ecb29461..82a26463 100644 --- a/src/mapfile/mapfile.l +++ b/src/mapfile/mapfile.l @@ -538,14 +538,14 @@ static void end_layer() if (!map_l->storage->schema->use) buffer_add_str(map_l->storage->schema, "public"); if (!map_is_dump) map_l->retrievable=map_l->writable = false; - map_l->name_prefix = buffer_init(); + map_l->name_prefix = buffer_init(); buffer_copy(map_l->name_prefix, map_l->name); if (map_l->ns_prefix->use) { buffer_add_head(map_l->name_prefix, ':'); buffer_add_head_str(map_l->name_prefix, map_l->ns_prefix->buf); } - map_l->name_no_uri = buffer_init(); + map_l->name_no_uri = buffer_init(); buffer_copy(map_l->name_no_uri, map_l->name); if (map_l->ns_uri->use) { buffer_add_head(map_l->name, ':'); From 5c6458a468f913f8a8a82b3a26a9c7280d873ee2 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sat, 12 Jun 2021 16:48:19 -0300 Subject: [PATCH 34/61] debian library order patch --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 4dd219d4..e5c77695 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,7 +25,7 @@ GIT_FLAGS=@GIT_FLAGS@ SRC=src/fe/fe_comparison_ops.c src/fe/fe_error.c src/fe/fe_filter.c src/fe/fe_filter_capabilities.c src/fe/fe_function.c src/fe/fe_logical_ops.c src/fe/fe_spatial_ops.c src/mapfile/mapfile.c src/ows/ows_bbox.c src/ows/ows.c src/ows/ows_config.c src/ows/ows_error.c src/ows/ows_geobbox.c src/ows/ows_get_capabilities.c src/ows/ows_layer.c src/ows/ows_metadata.c src/ows/ows_psql.c src/ows/ows_request.c src/ows/ows_srs.c src/ows/ows_storage.c src/ows/ows_version.c src/struct/alist.c src/struct/array.c src/struct/buffer.c src/struct/cgi_request.c src/struct/list.c src/struct/mlist.c src/struct/regexp.c src/wfs/wfs_describe.c src/wfs/wfs_error.c src/wfs/wfs_get_capabilities.c src/wfs/wfs_get_feature.c src/wfs/wfs_request.c src/wfs/wfs_transaction.c src/ows/ows_libxml.c all: - $(CC) -o tinyows $(SRC) $(XMLFLAGS) $(CFLAGS) $(PGFLAGS) $(FCGIFLAGS) $(GIT_FLAGS) -lfl + $(CC) $(CFLAGS) $(POSTGIS_INC) $(XML2_INC) $(FCGI_INC) $(SVN_FLAGS) $(SRC) -o tinyows -lfl $(POSTGIS_LIB) $(XML2_LIB) $(FCGI_LIB) @rm -rf tinyows.dSYM flex: From 37aec1fabc569c3a239457dbaab373e91be6271c Mon Sep 17 00:00:00 2001 From: jmckenna Date: Sat, 12 Jun 2021 17:35:15 -0300 Subject: [PATCH 35/61] fix indentation, again --- src/mapfile/mapfile.l | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mapfile/mapfile.l b/src/mapfile/mapfile.l index 82a26463..6b73b4e4 100644 --- a/src/mapfile/mapfile.l +++ b/src/mapfile/mapfile.l @@ -538,6 +538,7 @@ static void end_layer() if (!map_l->storage->schema->use) buffer_add_str(map_l->storage->schema, "public"); if (!map_is_dump) map_l->retrievable=map_l->writable = false; + map_l->name_prefix = buffer_init(); buffer_copy(map_l->name_prefix, map_l->name); if (map_l->ns_prefix->use) { From a1952ae873386917698433b0c8e722c76bf807f7 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Sat, 4 Jun 2022 15:32:58 +0200 Subject: [PATCH 36/61] Use stdbool.h instead of custom definitions. Fixes: #98 --- src/fe/fe_logical_ops.c | 5 +++-- src/ows_struct.h | 8 +------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/fe/fe_logical_ops.c b/src/fe/fe_logical_ops.c index 67c7a46b..f88cc013 100644 --- a/src/fe/fe_logical_ops.c +++ b/src/fe/fe_logical_ops.c @@ -21,6 +21,7 @@ */ +#include #include #include #include @@ -101,7 +102,7 @@ static buffer *fe_unary_logical_op(ows * o, buffer * typename, filter_encoding * assert(n); buffer_add_str(fe->sql, "not("); - fe->in_not++; + fe->in_not = true; n = n->children; while (n->type != XML_ELEMENT_NODE) n = n->next; @@ -112,7 +113,7 @@ static buffer *fe_unary_logical_op(ows * o, buffer * typename, filter_encoding * else if (fe_is_comparison_op((char *) n->name)) fe->sql = fe_comparison_op(o, typename, fe, n); buffer_add_str(fe->sql, ")"); - fe->in_not--; + fe->in_not = false; return fe->sql; } diff --git a/src/ows_struct.h b/src/ows_struct.h index 0805a5b2..165e9ccf 100644 --- a/src/ows_struct.h +++ b/src/ows_struct.h @@ -24,18 +24,12 @@ #ifndef OWS_STRUCT_H #define OWS_STRUCT_H +#include #include /* FILE prototype */ /* ========= Structures ========= */ -enum Bool { - false, - true -}; - -typedef enum Bool bool; - #define BUFFER_SIZE_INIT 256 typedef struct Buffer { From cb6bdec17fc0fff8c99810d0ef7ca7c4c2c516a2 Mon Sep 17 00:00:00 2001 From: Gabriel Gressier <75422446+GabGr25@users.noreply.github.com> Date: Wed, 16 Nov 2022 10:48:22 +0100 Subject: [PATCH 37/61] Update wfs_get_feature.c --- src/wfs/wfs_get_feature.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/wfs/wfs_get_feature.c b/src/wfs/wfs_get_feature.c index 71eb19bb..261d4184 100644 --- a/src/wfs/wfs_get_feature.c +++ b/src/wfs/wfs_get_feature.c @@ -545,13 +545,9 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer } /* Columns are written in quotation marks */ else { - if (wr->format == WFS_GEOJSON) - buffer_add_str(select, "to_json("); buffer_add_str(select, "\""); buffer_copy(select, an->key); buffer_add_str(select, "\""); - if (wr->format == WFS_GEOJSON) - buffer_add_str(select, ")"); } if (an->next) buffer_add_str(select, ","); @@ -857,10 +853,11 @@ static void wfs_geojson_display_results(ows * o, wfs_request * wr, mlist * reque else buffer_add_str(prop, ", \""); buffer_copy(prop, an->key); - buffer_add_str(prop, "\": "); + buffer_add_str(prop, "\": \""); value_enc = buffer_encode_json_str(PQgetvalue(res, i, j)); buffer_copy(prop, value_enc); buffer_free(value_enc); + buffer_add(prop, '"'); } } From 9749a6f4d5740e9102c2e30de0328a4e5d2a4f99 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sun, 30 Jul 2023 18:13:11 -0300 Subject: [PATCH 38/61] handle PostGIS 3.3 in demo --- demo/install.sh.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/install.sh.in b/demo/install.sh.in index a2bd50b1..535ffa18 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -11,7 +11,11 @@ PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d /usr/local/pgsql/share/contrib/postgis-3.1 ]; then +if [ -d /usr/local/pgsql/share/contrib/postgis-3.3 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.3 +elif [ -d /usr/local/pgsql/share/contrib/postgis-3.2 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.2 +elif [ -d /usr/local/pgsql/share/contrib/postgis-3.1 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 From 8617c7d023216c235736d3113f91e73bf6e4e91d Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sun, 30 Jul 2023 18:15:57 -0300 Subject: [PATCH 39/61] handle PostGIS 3.3 in demo --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index bf7850a4..06505312 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,7 +9,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Build run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/linux.sh From 99d7d807e6f3a586a2f6449bbb9bea118fd280ef Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 16 May 2024 14:46:30 -0300 Subject: [PATCH 40/61] handle PostGIS 3.4 in demo --- .github/dependabot.yml | 8 ++++++++ demo/install.sh.in | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..c11a11f0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/demo/install.sh.in b/demo/install.sh.in index 535ffa18..54411a85 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -11,8 +11,10 @@ PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d /usr/local/pgsql/share/contrib/postgis-3.3 ]; then - PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.3 +if [ -d /usr/local/pgsql/share/contrib/postgis-3.4 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.4 +elif [ -d /usr/local/pgsql/share/contrib/postgis-3.3 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.3 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.2 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.2 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.1 ]; then From 3fe61ebb917796ac76272f890f5a146e8fd0d246 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 11:40:45 +0000 Subject: [PATCH 41/61] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 06505312..5ee53972 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,7 +9,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/linux.sh From 031d046a77f9bf09ac40d97c59304d48580d9648 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 17 May 2024 09:00:11 -0300 Subject: [PATCH 42/61] update for 1.2.1 release --- LICENSE | 2 +- NEWS => NEWS.md | 3 +++ VERSION | 2 +- doc/Doxyfile | 2 +- src/ows_define.h.in | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) rename NEWS => NEWS.md (97%) diff --git a/LICENSE b/LICENSE index d32f01f0..fffa6015 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) <2007-2021> +Copyright (c) <2007-2024> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/NEWS b/NEWS.md similarity index 97% rename from NEWS rename to NEWS.md index 438fb1a8..963270d9 100644 --- a/NEWS +++ b/NEWS.md @@ -1,3 +1,6 @@ +1.2.1 (2024-05-17) *in memory of Olivier Courtin* + - Handle check when using TINYOWS_MAPFILE + 1.2.0 (2021-06-11) *in memory of Olivier Courtin* - Fix custom types conversion (Vincent Mora) - Add support for geometry-less tables (Even Rouault) diff --git a/VERSION b/VERSION index 26aaba0e..6085e946 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.0 +1.2.1 diff --git a/doc/Doxyfile b/doc/Doxyfile index 5cebf81c..04c607ac 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -23,7 +23,7 @@ PROJECT_NAME = tinyows # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.2.0 +PROJECT_NUMBER = 1.2.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/src/ows_define.h.in b/src/ows_define.h.in index d3ff65dd..30da8bac 100644 --- a/src/ows_define.h.in +++ b/src/ows_define.h.in @@ -28,7 +28,7 @@ #define OWS_DEBUG #endif -#define TINYOWS_VERSION "1.2.0" +#define TINYOWS_VERSION "1.2.1" #define TINYOWS_FCGI @USE_FCGI@ #define OWS_CONFIG_FILE_PATH "/etc/tinyows.xml" From d68d4da5bb52d3807dbb2f75faf8c1c443da3431 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 17 May 2024 09:02:31 -0300 Subject: [PATCH 43/61] update for 1.2.1 release --- LICENSE => LICENSE.md | 0 VERSION => VERSION.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename LICENSE => LICENSE.md (100%) rename VERSION => VERSION.md (100%) diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/VERSION b/VERSION.md similarity index 100% rename from VERSION rename to VERSION.md From 85f0ec2eb76883ce84fbc7d2d78af25ea9e5efad Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 17 May 2024 09:14:53 -0300 Subject: [PATCH 44/61] update for 1.2.1 release --- NEWS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 963270d9..397d4c5c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ 1.2.1 (2024-05-17) *in memory of Olivier Courtin* - - Handle check when using TINYOWS_MAPFILE + - Fix JSON encoding ([#100](https://github.com/MapServer/tinyows/pull/100)) (Kévin Dubuc) + - Use stdbool.h instead of custom definitions ([#99](https://github.com/MapServer/tinyows/pull/99)) (Bas Couwenberg) + - Handle check when using TINYOWS_MAPFILE ([#97](https://github.com/MapServer/tinyows/pull/97)) (Jeff McKenna) 1.2.0 (2021-06-11) *in memory of Olivier Courtin* - Fix custom types conversion (Vincent Mora) From 367ab3778eb855f223abffe978560180501b2c21 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Tue, 11 Jun 2024 12:56:22 +0200 Subject: [PATCH 45/61] Include stdlib.h for atoi. --- src/ows/ows_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ows/ows_config.c b/src/ows/ows_config.c index 9bdf6053..ba4ea975 100644 --- a/src/ows/ows_config.c +++ b/src/ows/ows_config.c @@ -22,6 +22,7 @@ #include +#include #include #include #include From a3487a50a74055481eac9ec5f0e5379a0e3ab24d Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Wed, 31 Jul 2024 10:11:46 -0300 Subject: [PATCH 46/61] handle upcoming PostGIS 3.5 in demo --- demo/install.sh.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demo/install.sh.in b/demo/install.sh.in index 54411a85..d5032f6f 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -11,8 +11,10 @@ PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d /usr/local/pgsql/share/contrib/postgis-3.4 ]; then - PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.4 +if [ -d /usr/local/pgsql/share/contrib/postgis-3.5 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.5 +elif [ -d /usr/local/pgsql/share/contrib/postgis-3.4 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.4 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.3 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.3 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.2 ]; then From fe2e525c1ad3a63251cdb680851fb68767f85d3f Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Wed, 31 Jul 2024 11:12:42 -0300 Subject: [PATCH 47/61] update for 1.2.2 release --- NEWS.md | 3 +++ README.md | 2 +- VERSION.md | 2 +- doc/Doxyfile | 2 +- src/ows_define.h.in | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 397d4c5c..295f02b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +1.2.2 (2024-07-31) *in memory of Olivier Courtin* + - Include stdlib.h for atoi ([#105](https://github.com/MapServer/tinyows/pull/105)) (Bas Couwenberg) + 1.2.1 (2024-05-17) *in memory of Olivier Courtin* - Fix JSON encoding ([#100](https://github.com/MapServer/tinyows/pull/100)) (Kévin Dubuc) - Use stdbool.h instead of custom definitions ([#99](https://github.com/MapServer/tinyows/pull/99)) (Bas Couwenberg) diff --git a/README.md b/README.md index 41e2c887..375b4b32 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ All code must meet the following rules : Code dynamically linked with the following other librairies: - PostgreSQL -- libxml 2.9.x +- libxml2 - flex ## Credits diff --git a/VERSION.md b/VERSION.md index 6085e946..23aa8390 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -1.2.1 +1.2.2 diff --git a/doc/Doxyfile b/doc/Doxyfile index 04c607ac..8b668102 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -23,7 +23,7 @@ PROJECT_NAME = tinyows # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.2.1 +PROJECT_NUMBER = 1.2.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/src/ows_define.h.in b/src/ows_define.h.in index 30da8bac..7566f61b 100644 --- a/src/ows_define.h.in +++ b/src/ows_define.h.in @@ -28,7 +28,7 @@ #define OWS_DEBUG #endif -#define TINYOWS_VERSION "1.2.1" +#define TINYOWS_VERSION "1.2.2" #define TINYOWS_FCGI @USE_FCGI@ #define OWS_CONFIG_FILE_PATH "/etc/tinyows.xml" From c48e0e22cce5b9d2e3357a5894c7695aafefd6b3 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Mon, 10 Mar 2025 11:18:27 -0300 Subject: [PATCH 48/61] update license year --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index fffa6015..6d34f487 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) <2007-2024> +Copyright (c) <2007-2025> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 27ecde71c686320b1bcc79fa65ad83d7676e3f4d Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 13 Mar 2025 17:03:32 -0300 Subject: [PATCH 49/61] ci: upgrade to Ubuntu 24.04 --- .github/workflows/linux.sh | 8 ++++---- .github/workflows/linux.yml | 2 +- demo/install.sh.in | 28 +++++++++++++++++++--------- test/wfs_100/install_wfs_100.sh.in | 30 ++++++++++++++++++++---------- test/wfs_110/install_wfs_110.sh.in | 12 +++++++++++- 5 files changed, 55 insertions(+), 25 deletions(-) diff --git a/.github/workflows/linux.sh b/.github/workflows/linux.sh index 90e2887b..642f38dc 100755 --- a/.github/workflows/linux.sh +++ b/.github/workflows/linux.sh @@ -7,7 +7,7 @@ apt-get update DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ gcc libxml2-dev libpq-dev libfcgi-dev \ autoconf make flex libfl-dev \ - postgresql-12 postgresql-client postgis postgresql-12-postgis-3 postgresql-12-postgis-3-scripts \ + postgresql-16 postgresql-client postgis postgresql-16-postgis-3 postgresql-16-postgis-3-scripts \ wget ca-certificates patch valgrind cd "${WORK_DIR}" @@ -16,9 +16,9 @@ CFLAGS="-Werror" ./configure make make install -cp /etc/postgresql/12/main/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf.bak -echo "local all postgres trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf -echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf +cp /etc/postgresql/16/main/pg_hba.conf /etc/postgresql/16/main/pg_hba.conf.bak +echo "local all postgres trust" | cat - /etc/postgresql/16/main/pg_hba.conf.bak > /etc/postgresql/16/main/pg_hba.conf +echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/16/main/pg_hba.conf.bak > /etc/postgresql/16/main/pg_hba.conf /etc/init.d/postgresql start rm -f /etc/tinyows.xml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 5ee53972..83125717 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -12,4 +12,4 @@ jobs: uses: actions/checkout@v4 - name: Build - run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/linux.sh + run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:24.04 $PWD/.github/workflows/linux.sh diff --git a/demo/install.sh.in b/demo/install.sh.in index d5032f6f..cd34c949 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -21,24 +21,34 @@ elif [ -d /usr/local/pgsql/share/contrib/postgis-3.2 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.2 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.1 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.1 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-1.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 else - echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 + echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 fi echo "Create Spatial Database: $DB" diff --git a/test/wfs_100/install_wfs_100.sh.in b/test/wfs_100/install_wfs_100.sh.in index 840b7423..eecd64cb 100755 --- a/test/wfs_100/install_wfs_100.sh.in +++ b/test/wfs_100/install_wfs_100.sh.in @@ -10,24 +10,34 @@ PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 PGUSER=postgres DB=tinyows_test -if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 +if [ -d @POSTGIS_SHARE@/contrib/postgis-3.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.1 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-1.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 else - echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 + echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 fi echo "Create Spatial Database: $DB" diff --git a/test/wfs_110/install_wfs_110.sh.in b/test/wfs_110/install_wfs_110.sh.in index aaddd413..63e8b71e 100755 --- a/test/wfs_110/install_wfs_110.sh.in +++ b/test/wfs_110/install_wfs_110.sh.in @@ -10,7 +10,17 @@ PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 PGUSER=postgres DB=tinyows_test -if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then +if [ -d @POSTGIS_SHARE@/contrib/postgis-3.5 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.5 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.4 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.4 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.3 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.3 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.2 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.2 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.1 ]; then + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.1 +elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 From 52c8c93008d7bf870f7ecf19ca33f4440d9f9cb6 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 13 Mar 2025 17:14:08 -0300 Subject: [PATCH 50/61] ci: upgrade to Ubuntu 24.04 --- test/wfs_110/install_wfs_110.sh.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/wfs_110/install_wfs_110.sh.in b/test/wfs_110/install_wfs_110.sh.in index 63e8b71e..2a7bcbcc 100755 --- a/test/wfs_110/install_wfs_110.sh.in +++ b/test/wfs_110/install_wfs_110.sh.in @@ -21,23 +21,23 @@ elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.2 ]; then elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.1 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1 elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0 elif [ -d @POSTGIS_SHARE@/contrib/postgis-1.5 ]; then - PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 + PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5 else - echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 + echo "Unable to find PostGIS dir in @POSTGIS_SHARE@/contrib/" && exit 1 fi echo "Create Spatial Database: $DB" From 72f08f6be98ec18a683d7deef8613b78c8232450 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 13 Mar 2025 17:15:01 -0300 Subject: [PATCH 51/61] add linefeed check action --- .github/workflows/check-crlf.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/check-crlf.yml diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml new file mode 100644 index 00000000..96c8e49a --- /dev/null +++ b/.github/workflows/check-crlf.yml @@ -0,0 +1,20 @@ +# check for Windows CRLF in files +# homepage: https://github.com/marketplace/actions/check-crlf + +name: Check CRLF + +on: [push, pull_request] + +jobs: + Check-CRLF: + name: verify that only LF linefeeds are used + runs-on: ubuntu-latest + + steps: + - name: Checkout repository contents + uses: actions/checkout@v4 + + - name: Use action to check for CRLF endings + uses: erclu/check-crlf@v1.2.0 + with: # ignore directories containing *.csv & data + exclude: /demo/ \ No newline at end of file From 5d46702a475e9763096cd4800ae36f084f6ba507 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 13 Mar 2025 17:17:58 -0300 Subject: [PATCH 52/61] add linefeed check action --- .github/workflows/check-crlf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml index 96c8e49a..4ab83e39 100644 --- a/.github/workflows/check-crlf.yml +++ b/.github/workflows/check-crlf.yml @@ -17,4 +17,4 @@ jobs: - name: Use action to check for CRLF endings uses: erclu/check-crlf@v1.2.0 with: # ignore directories containing *.csv & data - exclude: /demo/ \ No newline at end of file + exclude: /demo/ /ms4w/ /test/ Makefile.vc \ No newline at end of file From b779f84994f7365c5fb9036385d82b11973347c6 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 14 Mar 2025 09:28:01 -0300 Subject: [PATCH 53/61] ci: upgrade to Ubuntu 24.04 --- demo/tests/expected/wfs10_describe.txt | 2 +- demo/tests/expected/wfs11_describe.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/tests/expected/wfs10_describe.txt b/demo/tests/expected/wfs10_describe.txt index 2520c207..5f4b3404 100644 --- a/demo/tests/expected/wfs10_describe.txt +++ b/demo/tests/expected/wfs10_describe.txt @@ -21,7 +21,7 @@ Content-Type: text/xml; subtype=gml/2.1.2; - + diff --git a/demo/tests/expected/wfs11_describe.txt b/demo/tests/expected/wfs11_describe.txt index 558730cd..fb213caa 100644 --- a/demo/tests/expected/wfs11_describe.txt +++ b/demo/tests/expected/wfs11_describe.txt @@ -21,7 +21,7 @@ Content-Type: text/xml; subtype=gml/3.1.1; - + From 5fc4848a0ddf55842254d5ce3f4e1b934baf7a48 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 23 May 2025 11:15:19 -0300 Subject: [PATCH 54/61] add badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 375b4b32..8b13bb99 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # TinyOWS +[![Build TinyOWS on Linux Status](https://github.com/MapServer/tinyows/actions/workflows/linux.yml/badge.svg)](https://github.com/MapServer/tinyows/actions?query=workflow%3A%22Linux%20Build%22%20branch%3Amain) +[![Release](https://img.shields.io/github/v/release/MapServer/tinyows)](https://github.com/MapServer/tinyows/releases) + TinyOWS is a simple WFS-T server based on PostGIS spatial database. ## Documentation Home From 8cf43fb0eb2749282a0b9b9d6c4ca38609d65994 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 06:33:57 +0000 Subject: [PATCH 55/61] Bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-crlf.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml index 4ab83e39..b80cd65c 100644 --- a/.github/workflows/check-crlf.yml +++ b/.github/workflows/check-crlf.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository contents - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Use action to check for CRLF endings uses: erclu/check-crlf@v1.2.0 diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 83125717..dba6df86 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,7 +9,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Build run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:24.04 $PWD/.github/workflows/linux.sh From 3e8a3fe21db49b47f2d3c8a56974bc22ec059dc7 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Mon, 18 Aug 2025 07:33:00 -0300 Subject: [PATCH 56/61] bump Check CRLF action --- .github/workflows/check-crlf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml index b80cd65c..ef4976f5 100644 --- a/.github/workflows/check-crlf.yml +++ b/.github/workflows/check-crlf.yml @@ -15,6 +15,6 @@ jobs: uses: actions/checkout@v5 - name: Use action to check for CRLF endings - uses: erclu/check-crlf@v1.2.0 + uses: erclu/check-crlf@master with: # ignore directories containing *.csv & data exclude: /demo/ /ms4w/ /test/ Makefile.vc \ No newline at end of file From 51c62e5be1951c278fa01f334bf2563d29fa110e Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Tue, 30 Sep 2025 09:17:03 -0300 Subject: [PATCH 57/61] add IRC workflow --- .github/workflows/irc_notify.yml | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/irc_notify.yml diff --git a/.github/workflows/irc_notify.yml b/.github/workflows/irc_notify.yml new file mode 100644 index 00000000..be8ab28b --- /dev/null +++ b/.github/workflows/irc_notify.yml @@ -0,0 +1,46 @@ +# send build notifications to the #mapserver-docs IRC channel +# homepage: https://github.com/marketplace/actions/notify-irc + +name: "IRC Push Notification" +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + irc_notify: + runs-on: ubuntu-latest + #if: github.repository == 'MapServer/tinyows' + steps: + - name: irc push + uses: rectalogic/notify-irc@v2 + if: github.event_name == 'push' + with: + channel: "#tinyows" + server: "irc.libera.chat" + nickname: tinyows-github-notifier + message: | + ${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }} + ${{ join(github.event.commits.*.message) }} + - name: irc pull request + uses: rectalogic/notify-irc@v2 + if: github.event_name == 'pull_request' + with: + channel: "#tinyows" + server: "irc.libera.chat" + nickname: tinyows-github-notifier + message: | + ${{ github.actor }} opened PR ${{ github.event.pull_request.html_url }} + ${{ github.event.pull_request.title }} + - name: irc tag created + uses: rectalogic/notify-irc@v2 + if: github.event_name == 'create' && github.event.ref_type == 'tag' + with: + channel: "#tinyows" + server: "irc.libera.chat" + nickname: tinyows-github-notifier + message: | + ${{ github.actor }} tagged ${{ github.repository }} ${{ github.event.ref }} From 8df8a3d89641323d5af97f96372ca3efaff397df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 04:11:18 +0000 Subject: [PATCH 58/61] Bump actions/checkout from 5 to 6 Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-crlf.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml index ef4976f5..42f358a2 100644 --- a/.github/workflows/check-crlf.yml +++ b/.github/workflows/check-crlf.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository contents - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Use action to check for CRLF endings uses: erclu/check-crlf@master diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index dba6df86..7a106ed9 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,7 +9,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Build run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:24.04 $PWD/.github/workflows/linux.sh From 4a2cfb42ba621adca4f95618f4883399fa70c0b9 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sat, 13 Dec 2025 15:10:08 -0400 Subject: [PATCH 59/61] handle PostGIS 3.6 in demo --- demo/install.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/install.sh.in b/demo/install.sh.in index cd34c949..43a2d354 100755 --- a/demo/install.sh.in +++ b/demo/install.sh.in @@ -11,7 +11,9 @@ PGUSER=postgres SHP2PGSQL=@SHP2PGSQL@ DB=tinyows_demo -if [ -d /usr/local/pgsql/share/contrib/postgis-3.5 ]; then +if [ -d /usr/local/pgsql/share/contrib/postgis-3.6 ]; then + PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.6 +elif [ -d /usr/local/pgsql/share/contrib/postgis-3.5 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.5 elif [ -d /usr/local/pgsql/share/contrib/postgis-3.4 ]; then PGSHARE=/usr/local/pgsql/share/contrib/postgis-3.4 From bf8523aff6aec4cd768fa03c3828c8d97e7681ea Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Tue, 6 Jan 2026 15:33:58 -0400 Subject: [PATCH 60/61] update license year --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 6d34f487..7fb92b43 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) <2007-2025> +Copyright (c) <2007-2026> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From a866276fc8ac23b8c6932bbea749e341eb7d9826 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 04:52:52 +0000 Subject: [PATCH 61/61] Bump actions/checkout from 6 to 7 Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-crlf.yml | 2 +- .github/workflows/linux.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-crlf.yml b/.github/workflows/check-crlf.yml index 42f358a2..965f7cbe 100644 --- a/.github/workflows/check-crlf.yml +++ b/.github/workflows/check-crlf.yml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository contents - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Use action to check for CRLF endings uses: erclu/check-crlf@master diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7a106ed9..e0784970 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -9,7 +9,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Build run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:24.04 $PWD/.github/workflows/linux.sh