[SCM] PostGIS branch stable-3.1 updated. 3.1.11-27-g835779081
git at osgeo.org
git at osgeo.org
Wed Jun 4 11:14:31 PDT 2025
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.1 has been updated
via 835779081be4d9228a427d3c3e4aad90cf14e12b (commit)
from 7f7eed125ec1f953d1dc14e09eaedb170881e01f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 835779081be4d9228a427d3c3e4aad90cf14e12b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Wed Jun 4 11:13:30 2025 -0700
Allow use of PCRE2 in address standardizer for packaging on
systems with more modern libraries and compilers.
diff --git a/NEWS b/NEWS
index 39f3e3dfa..c07347e89 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ YYYY/MM/DD
- #5876, Fix ST_AddPoint with empty point argument (Paul Ramsey)
- #5818, GT-244 Fix CG_IsSolid function (Loïc Bartoletti)
- #5885, Fix documentation about grid-based overlay operations (Sandro Santilli)
+ - PCRE2 support for more modern systems (Paul Ramsey)
PostGIS 3.1.12
diff --git a/configure.ac b/configure.ac
index d6151e51f..12bd64900 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1178,7 +1178,9 @@ AC_ARG_WITH([address-standardizer],
[Disable the address_standardizer extension])],
[], [])
-HAVE_PCRE=no
+HAVE_PCRE1=no
+HAVE_PCRE2=no
+PCRE_SUPPORT="not found"
ADDRESS_STANDARDIZER=""
if test "x$with_address_standardizer" != "xno"; then
@@ -1197,42 +1199,74 @@ if test "x$with_address_standardizer" != "xno"; then
AC_MSG_ERROR([you must specify a parameter to --with-pcredir, e.g. --with-pcredir=/path/to])
else
if test -d "$PCREDIR"; then
- AC_MSG_RESULT([Using user-specified PCRE directory: $PCREDIR])
+ AC_MSG_CHECKING([for PCRE in $PCREDIR...])
- AC_CHECK_FILE("$PCREDIR/include/pcre.h",
+ AC_CHECK_FILE("$PCREDIR/include/pcre2.h",
+ [
+ PCRE_CPPFLAGS="-I$PCREDIR/include"
+ PCRE_LDFLAGS="-L$PCREDIR/lib -lpcre2-8"
+ HAVE_PCRE2=yes
+ ADDRESS_STANDARDIZER="address_standardizer"
+ AC_MSG_RESULT([found pcre2.h])
+ ],
+ [
+ AC_CHECK_FILE("$PCREDIR/include/pcre.h",
[
- PCRE_CPPFLAGS="-I$PCREDIR/include"
- PCRE_LDFLAGS="-L$PCREDIR/lib -lpcre"
- HAVE_PCRE=yes
- ADDRESS_STANDARDIZER="address_standardizer"
+ PCRE_CPPFLAGS="-I$PCREDIR/include"
+ PCRE_LDFLAGS="-L$PCREDIR/lib -lpcre"
+ HAVE_PCRE1=yes
+ ADDRESS_STANDARDIZER="address_standardizer"
+ AC_MSG_RESULT([found pcre.h])
],
- [AC_MSG_ERROR([Could not find header: pcre.h])])
+ [
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR(["Could not find PCRE header in $PCREDIR/include"])
+ ])
+ ])
else
AC_MSG_ERROR([the --with-pcredir directory "$PCREDIR" cannot be found])
fi
fi
elif test ! -z "$PKG_CONFIG"; then
- PKG_CHECK_MODULES([PCRE], [libpcre], [
+ PKG_CHECK_MODULES([PCRE2], [libpcre2-8], [
+ PCRE_CPPFLAGS="$PCRE2_CFLAGS"
+ PCRE_LDFLAGS="$PCRE2_LIBS"
+ ADDRESS_STANDARDIZER="address_standardizer"
+ HAVE_PCRE2=yes
+ ],[
+ PKG_CHECK_MODULES([PCRE], [libpcre], [
PCRE_CPPFLAGS="$PCRE_CFLAGS"
PCRE_LDFLAGS="$PCRE_LIBS"
ADDRESS_STANDARDIZER="address_standardizer"
- HAVE_PCRE=yes
- ],
- [
+ HAVE_PCRE1=yes
+ ],[
ADDRESS_STANDARDIZER=""
- HAVE_PCRE=no
])
+ ])
+ fi
+
+ if test "x$HAVE_PCRE2" = "xyes"; then
+ PCRE_SUPPORT="Version 2"
+ PCRE_VERSION=2
+ elif test "x$HAVE_PCRE1" = "xyes"; then
+ PCRE_SUPPORT="Version 1"
+ PCRE_VERSION=1
+ else
+ ADDRESS_STANDARDIZER=""
+ PCRE_SUPPORT="not found"
+ PCRE_VERSION=0
+ AC_MSG_RESULT([ADDRESS_STANDARDIZER support: disabled])
fi
AC_SUBST([PCRE_CPPFLAGS])
AC_SUBST([PCRE_LDFLAGS])
+ AC_SUBST([PCRE_VERSION])
else
ADDRESS_STANDARDIZER=""
AC_MSG_RESULT([ADDRESS_STANDARDIZER support: disabled])
fi
-AC_SUBST([HAVE_PCRE])
AC_SUBST([ADDRESS_STANDARDIZER])
CPPFLAGS="$PGSQL_CPPFLAGS $GEOS_CPPFLAGS $PROJ_CPPFLAGS $PROTOBUF_CPPFLAGS $XML2_CPPFLAGS $SFCGAL_CPPFLAGS $JSON_CPPFLAGS $PCRE_CPPFLAGS $CPPFLAGS"
@@ -1655,7 +1689,7 @@ if test "x$HAVE_PROTOBUF" = "xyes"; then
AC_MSG_RESULT([ protobuf-c version: ${PROTOC_VERSION}])
fi
-AC_MSG_RESULT([ PCRE support: ${HAVE_PCRE}])
+AC_MSG_RESULT([ PCRE support: ${PCRE_SUPPORT}])
AC_MSG_RESULT([ Perl: ${PERL}])
AC_MSG_RESULT([ Wagyu: ${HAVE_WAGYU}])
diff --git a/extensions/address_standardizer/Makefile.in b/extensions/address_standardizer/Makefile.in
index 3c64b47df..62ab3f60c 100644
--- a/extensions/address_standardizer/Makefile.in
+++ b/extensions/address_standardizer/Makefile.in
@@ -55,7 +55,8 @@ EXTRA_CLEAN = sql/
DOCS = README.address_standardizer
-PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
+PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ -DPCRE_VERSION=@PCRE_VERSION@
+
SHLIB_LINK = @SHLIB_LINK@ @PCRE_LDFLAGS@
EXTRA_CLEAN = usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
diff --git a/extensions/address_standardizer/parseaddress-api.c b/extensions/address_standardizer/parseaddress-api.c
index d5008c3f7..b426d39e5 100644
--- a/extensions/address_standardizer/parseaddress-api.c
+++ b/extensions/address_standardizer/parseaddress-api.c
@@ -20,7 +20,16 @@
#include <string.h>
#include <ctype.h>
#include <stdio.h>
-#include <pcre.h>
+
+#if PCRE_VERSION <= 1
+# include <pcre.h>
+# define PARSE_CASELESS PCRE_CASELESS
+#else
+# define PCRE2_CODE_UNIT_WIDTH 8
+# include <pcre2.h>
+# define PARSE_CASELESS PCRE2_CASELESS
+#endif
+
#include "parseaddress-api.h"
#undef DEBUG
@@ -28,7 +37,7 @@
#ifdef DEBUG
#define DBG(format, arg...) \
- elog(NOTICE, format , ## arg)
+ elog(NOTICE, format , ## arg)
#else
#define DBG(format, arg...) do { ; } while (0)
#endif
@@ -39,72 +48,113 @@ char *clean_leading_punct(char *s);
const char *get_state_regex(char *st)
{
- int i;
- int cmp;
+ int i;
+ int cmp;
#include "parseaddress-stcities.h"
- if (!st || strlen(st) != 2) return NULL;
+ if (!st || strlen(st) != 2) return NULL;
- for (i=0; i<NUM_STATES; i++) {
- cmp = strcmp(states[i], st);
- if (cmp == 0)
- return stcities[i];
- else if (cmp > 0)
- return NULL;
- }
- return NULL;
+ for (i=0; i<NUM_STATES; i++) {
+ cmp = strcmp(states[i], st);
+ if (cmp == 0)
+ return stcities[i];
+ else if (cmp > 0)
+ return NULL;
+ }
+ return NULL;
}
int clean_trailing_punct(char *s)
{
- size_t i;
- int ret = 0;
+ size_t i;
+ int ret = 0;
- i=strlen(s)-1;
- while (ispunct(s[i]) || isspace(s[i])) {
- if (s[i] == ',') ret = 1;
- s[i--] = '\0';
- }
- return ret;
+ i=strlen(s)-1;
+ while (ispunct(s[i]) || isspace(s[i])) {
+ if (s[i] == ',') ret = 1;
+ s[i--] = '\0';
+ }
+ return ret;
}
char *clean_leading_punct(char *s)
{
- size_t i;
+ size_t i;
- for (i=0; i<strlen(s); i++)
- if (!(ispunct(s[i]) || isspace(s[i])))
- break;
+ for (i=0; i<strlen(s); i++)
+ if (!(ispunct(s[i]) || isspace(s[i])))
+ break;
- return s + i;
+ return s + i;
}
void strtoupper(char *s)
{
- size_t i;
+ size_t i;
- for (i=0; i<strlen(s); i++)
- s[i] = toupper(s[i]);
+ for (i=0; i<strlen(s); i++)
+ s[i] = toupper(s[i]);
}
+#if PCRE_VERSION <= 1
int match(char *pattern, char *s, int *ovect, int options)
{
- const char *error;
- int erroffset;
- pcre *re;
- int rc;
+ const char *error;
+ int erroffset;
+ pcre *re;
+ int rc;
- re = pcre_compile(pattern, options, &error, &erroffset, NULL);
- if (!re) return -99;
+ re = pcre_compile(pattern, options, &error, &erroffset, NULL);
+ if (!re) return -99;
- rc = pcre_exec(re, NULL, s, strlen(s), 0, 0, ovect, OVECCOUNT);
- free(re);
+ rc = pcre_exec(re, NULL, s, strlen(s), 0, 0, ovect, OVECCOUNT);
+ free(re);
- if (rc < 0) return rc;
- else if (rc == 0) rc = OVECCOUNT/3;
+ if (rc < 0) return rc;
+ else if (rc == 0) rc = OVECPAIRS; // more matches than ovect can hold
- return rc;
+ return rc;
}
+#else
+int match(char *pattern, char *s, int *ovect, int options)
+{
+ int errorcode;
+ PCRE2_SIZE erroffset;
+ pcre2_code *re;
+ int rc;
+ pcre2_match_data *match_data;
+ PCRE2_SIZE *ovect2;
+ int i;
+ re = pcre2_compile((PCRE2_SPTR8)pattern, PCRE2_ZERO_TERMINATED, options, &errorcode, &erroffset, NULL);
+ if (!re) return -99;
+
+ match_data = pcre2_match_data_create(OVECPAIRS, NULL);
+
+ rc = pcre2_match(re, (PCRE2_SPTR8)s, strlen(s), 0, 0, match_data, NULL);
+
+ if (rc < 0) { // no match or error
+ pcre2_code_free(re);
+ pcre2_match_data_free(match_data);
+ return rc;
+ }
+
+ if (rc == 0) { // more matches than ovect can hold
+ rc = OVECPAIRS;
+ }
+
+ // copy the results out so we can free everything
+ // before returning
+ ovect2 = pcre2_get_ovector_pointer(match_data);
+ for (i = 0; i < rc; i++) {
+ ovect[2*i] = ovect2[2*i];
+ ovect[2*i + 1] = ovect2[2*i + 1];
+ }
+
+ pcre2_code_free(re);
+ pcre2_match_data_free(match_data);
+ return rc;
+}
+#endif
#define RET_ERROR(a,e) if (!a) {*reterr = e; return NULL;}
@@ -113,412 +163,414 @@ ADDRESS *parseaddress(HHash *stH, char *s, int *reterr)
#include "parseaddress-regex.h"
- int ovect[OVECCOUNT];
- char c;
- char *stregx;
- char *caregx;
- char *state = NULL;
- char *regx;
- int mi;
- size_t ui, uj;
- int rc;
- int comma = 0;
- ADDRESS *ret;
+ int ovect[OVECCOUNT];
+ char c;
+ char *stregx;
+ char *caregx;
+ char *state = NULL;
+ char *regx;
+ int mi;
+ size_t ui, uj;
+ int rc;
+ int comma = 0;
+ ADDRESS *ret;
#ifdef USE_HSEARCH
- ENTRY e, *ep;
- int err;
+ ENTRY e, *ep;
+ int err;
#else
- char *key;
- char *val;
+ char *key;
+ char *val;
#endif
- ret = (ADDRESS *) palloc0(sizeof(ADDRESS));
+ (void)mi;
+ (void)comma;
+ ret = (ADDRESS *) palloc0(sizeof(ADDRESS));
- /* check if we were passed a lat lon */
- rc = match("^\\s*([-+]?\\d+(\\.\\d*)?)[\\,\\s]+([-+]?\\d+(\\.\\d*)?)\\s*$", s, ovect, 0);
- if (rc >= 3) {
- *(s+ovect[3]) = '\0';
- ret->lat = strtod(s+ovect[2], NULL);
- ret->lon = strtod(s+ovect[6], NULL);
- return ret;
- }
+ /* check if we were passed a lat lon */
+ rc = match("^\\s*([-+]?\\d+(\\.\\d*)?)[\\,\\s]+([-+]?\\d+(\\.\\d*)?)\\s*$", s, ovect, 0);
+ if (rc >= 3) {
+ *(s+ovect[3]) = '\0';
+ ret->lat = strtod(s+ovect[2], NULL);
+ ret->lon = strtod(s+ovect[6], NULL);
+ return ret;
+ }
- /* clean the string of multiple white spaces and . */
+ /* clean the string of multiple white spaces and . */
- for (ui=0, uj=0; ui<strlen(s); ui++) {
- c = s[ui];
- if (c == '.') c = s[ui] = ' ';
- if (uj == 0 && isspace(c)) continue;
- if (ui && isspace(c) && isspace(s[ui-1])) continue;
- s[uj] = s[ui];
- uj++;
- }
- if (isspace(s[uj-1])) uj--;
- s[uj] = '\0';
+ for (ui=0, uj=0; ui<strlen(s); ui++) {
+ c = s[ui];
+ if (c == '.') c = s[ui] = ' ';
+ if (uj == 0 && isspace(c)) continue;
+ if (ui && isspace(c) && isspace(s[ui-1])) continue;
+ s[uj] = s[ui];
+ uj++;
+ }
+ if (isspace(s[uj-1])) uj--;
+ s[uj] = '\0';
- /* clean trailing punctuation */
- comma |= clean_trailing_punct(s);
+ /* clean trailing punctuation */
+ comma |= clean_trailing_punct(s);
- /* assume country code is US */
+ /* assume country code is US */
- ret->cc = (char *) palloc0(3 * sizeof(char));
- strcpy(ret->cc, "US");
+ ret->cc = (char *) palloc0(3 * sizeof(char));
+ strcpy(ret->cc, "US");
- /* get US zipcode components */
+ /* get US zipcode components */
- rc = match("\\b(\\d{5})[-\\s]{0,1}?(\\d{0,4})?$", s, ovect, 0);
- if (rc >= 2) {
- ret->zip = (char *) palloc0((ovect[3]-ovect[2]+1) * sizeof(char));
- strncpy(ret->zip, s+ovect[2], ovect[3]-ovect[2]);
- if (rc >= 3) {
- ret->zipplus = (char *) palloc0((ovect[5]-ovect[4]+1) * sizeof(char));
- strncpy(ret->zipplus, s+ovect[4], ovect[5]-ovect[4]);
- }
- /* truncate the postalcode off the string */
- *(s+ovect[0]) = '\0';
- comma = 0;
- }
- /* get canada zipcode components */
- else {
- rc = match("\\b([a-z]\\d[a-z]\\s?\\d[a-z]\\d)$", s, ovect, PCRE_CASELESS);
- if (rc >= 1) {
- ret->zip = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
- strncpy(ret->zip, s+ovect[0], ovect[1]-ovect[0]);
- strcpy(ret->cc, "CA");
- /* truncate the postalcode off the string */
- *(s+ovect[0]) = '\0';
- comma = 0;
- }
- }
+ rc = match("\\b(\\d{5})[-\\s]{0,1}?(\\d{0,4})?$", s, ovect, 0);
+ if (rc >= 2) {
+ ret->zip = (char *) palloc0((ovect[3]-ovect[2]+1) * sizeof(char));
+ strncpy(ret->zip, s+ovect[2], ovect[3]-ovect[2]);
+ if (rc >= 3) {
+ ret->zipplus = (char *) palloc0((ovect[5]-ovect[4]+1) * sizeof(char));
+ strncpy(ret->zipplus, s+ovect[4], ovect[5]-ovect[4]);
+ }
+ /* truncate the postalcode off the string */
+ *(s+ovect[0]) = '\0';
+ comma = 0;
+ }
+ /* get canada zipcode components */
+ else {
+ rc = match("\\b([a-z]\\d[a-z]\\s?\\d[a-z]\\d)$", s, ovect, PARSE_CASELESS);
+ if (rc >= 1) {
+ ret->zip = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
+ strncpy(ret->zip, s+ovect[0], ovect[1]-ovect[0]);
+ strcpy(ret->cc, "CA");
+ /* truncate the postalcode off the string */
+ *(s+ovect[0]) = '\0';
+ comma = 0;
+ }
+ }
- /* clean trailing punctuation */
- comma |= clean_trailing_punct(s);
+ /* clean trailing punctuation */
+ comma |= clean_trailing_punct(s);
- /* get state components */
+ /* get state components */
- caregx = "^(?-xism:(?i:(?=[abmnopqsy])(?:n[ltsu]|[am]b|[bq]c|on|pe|sk|yt)))$";
- stregx = "\\b(?-xism:(?i:(?=[abcdfghiklmnopqrstuvwy])(?:a(?:l(?:a(?:bam|sk)a|berta)?|mer(?:ican)?\\ samoa|r(?:k(?:ansas)?|izona)?|[kszb])|s(?:a(?:moa|skatchewan)|outh\\ (?:carolin|dakot)a|\\ (?:carolin|dakot)a|[cdk])|c(?:a(?:lif(?:ornia)?)?|o(?:nn(?:ecticut)?|lorado)?|t)|d(?:e(?:la(?:ware)?)?|istrict\\ of\\ columbia|c)|f(?:l(?:(?:orid)?a)?|ederal\\ states\\ of\\ micronesia|m)|m(?:i(?:c(?:h(?:igan)?|ronesia)|nn(?:esota)?|ss(?:(?:issipp|our)i)?)?|a(?:r(?:shall(?:\\ is(?:l(?:and)?)?)?|yland)|ss(?:achusetts)?|ine|nitoba)?|o(?:nt(?:ana)?)?|[ehdnstpb])|g(?:u(?:am)?|(?:eorgi)?a)|h(?:awai)?i|i(?:d(?:aho)?|l(?:l(?:inois)?)?|n(?:d(?:iana)?)?|(?:ow)?a)|k(?:(?:ansa)?s|(?:entuck)?y)|l(?:a(?:bordor)?|ouisiana)|n(?:e(?:w(?:\\ (?:foundland(?:\\ and\\ labordor)?|hampshire|jersey|mexico|(?:yor|brunswic)k)|foundland)|(?:brask|vad)a)?|o(?:rth(?:\\ (?:mariana(?:\\ is(?:l(?:and)?)?)?|(?:carolin|dakot)a)|west\\ territor(?:ies|y))|va\\ scotia)|\\ (?:carolin|dakot)a|u(?:navut)?|[vhjmycdblsf]|w?t)|o(?:h(
?:io)?|k(?:lahoma)?|r(?:egon)?|n(?:t(?:ario)?)?)|p(?:a(?:lau)?|e(?:nn(?:sylvania)?|i)?|r(?:ince\\ edward\\ island)?|w|uerto\\ rico)|r(?:hode\\ island|i)|t(?:e(?:nn(?:essee)?|xas)|[nx])|ut(?:ah)?|v(?:i(?:rgin(?:\\ islands|ia))?|(?:ermon)?t|a)|w(?:a(?:sh(?:ington)?)?|i(?:sc(?:onsin)?)?|y(?:oming)?|(?:est)?\\ virginia|v)|b(?:ritish\\ columbia|c)|q(?:uebe)?c|y(?:ukon|t))))$";
+ caregx = "^(?-xism:(?i:(?=[abmnopqsy])(?:n[ltsu]|[am]b|[bq]c|on|pe|sk|yt)))$";
+ stregx = "\\b(?-xism:(?i:(?=[abcdfghiklmnopqrstuvwy])(?:a(?:l(?:a(?:bam|sk)a|berta)?|mer(?:ican)?\\ samoa|r(?:k(?:ansas)?|izona)?|[kszb])|s(?:a(?:moa|skatchewan)|outh\\ (?:carolin|dakot)a|\\ (?:carolin|dakot)a|[cdk])|c(?:a(?:lif(?:ornia)?)?|o(?:nn(?:ecticut)?|lorado)?|t)|d(?:e(?:la(?:ware)?)?|istrict\\ of\\ columbia|c)|f(?:l(?:(?:orid)?a)?|ederal\\ states\\ of\\ micronesia|m)|m(?:i(?:c(?:h(?:igan)?|ronesia)|nn(?:esota)?|ss(?:(?:issipp|our)i)?)?|a(?:r(?:shall(?:\\ is(?:l(?:and)?)?)?|yland)|ss(?:achusetts)?|ine|nitoba)?|o(?:nt(?:ana)?)?|[ehdnstpb])|g(?:u(?:am)?|(?:eorgi)?a)|h(?:awai)?i|i(?:d(?:aho)?|l(?:l(?:inois)?)?|n(?:d(?:iana)?)?|(?:ow)?a)|k(?:(?:ansa)?s|(?:entuck)?y)|l(?:a(?:bordor)?|ouisiana)|n(?:e(?:w(?:\\ (?:foundland(?:\\ and\\ labordor)?|hampshire|jersey|mexico|(?:yor|brunswic)k)|foundland)|(?:brask|vad)a)?|o(?:rth(?:\\ (?:mariana(?:\\ is(?:l(?:and)?)?)?|(?:carolin|dakot)a)|west\\ territor(?:ies|y))|va\\ scotia)|\\ (?:carolin|dakot)a|u(?:navut)?|[vhjmycdblsf]|w?t)|o(?:h(?:i
o)?|k(?:lahoma)?|r(?:egon)?|n(?:t(?:ario)?)?)|p(?:a(?:lau)?|e(?:nn(?:sylvania)?|i)?|r(?:ince\\ edward\\ island)?|w|uerto\\ rico)|r(?:hode\\ island|i)|t(?:e(?:nn(?:essee)?|xas)|[nx])|ut(?:ah)?|v(?:i(?:rgin(?:\\ islands|ia))?|(?:ermon)?t|a)|w(?:a(?:sh(?:ington)?)?|i(?:sc(?:onsin)?)?|y(?:oming)?|(?:est)?\\ virginia|v)|b(?:ritish\\ columbia|c)|q(?:uebe)?c|y(?:ukon|t))))$";
- rc = match(stregx, s, ovect, PCRE_CASELESS);
- if (rc > 0) {
- state = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
- strncpy(state, s+ovect[0], ovect[1]-ovect[0]);
+ rc = match(stregx, s, ovect, PARSE_CASELESS);
+ if (rc > 0) {
+ state = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
+ strncpy(state, s+ovect[0], ovect[1]-ovect[0]);
- /* truncate the state/province off the string */
- *(s+ovect[0]) = '\0';
+ /* truncate the state/province off the string */
+ *(s+ovect[0]) = '\0';
- /* lookup state in hash and get abbreviation */
- strtoupper(state);
+ /* lookup state in hash and get abbreviation */
+ strtoupper(state);
#ifdef USE_HSEARCH
- e.key = state;
- err = hsearch_r(e, FIND, &ep, stH);
- if (err) {
- ret->st = (char *) palloc0(3 * sizeof(char));
- strcpy(ret->st, ep->data);
- }
+ e.key = state;
+ err = hsearch_r(e, FIND, &ep, stH);
+ if (err) {
+ ret->st = (char *) palloc0(3 * sizeof(char));
+ strcpy(ret->st, ep->data);
+ }
#else
- key = state;
- val = (char *)hash_get(stH, key);
- if (val) {
- ret->st = pstrdup(val);
- }
+ key = state;
+ val = (char *)hash_get(stH, key);
+ if (val) {
+ ret->st = pstrdup(val);
+ }
#endif
- else {
- *reterr = 1002;
- return NULL;
- }
+ else {
+ *reterr = 1002;
+ return NULL;
+ }
- /* check if it a Canadian Province */
- rc = match(caregx, ret->st, ovect, PCRE_CASELESS);
- if (rc > 0) {
- strcpy(ret->cc, "CA");
- // if (ret->cc) printf(" CC: %s\n", ret->cc);
- }
- comma = 0;
- }
+ /* check if it a Canadian Province */
+ rc = match(caregx, ret->st, ovect, PARSE_CASELESS);
+ if (rc > 0) {
+ strcpy(ret->cc, "CA");
+ // if (ret->cc) printf(" CC: %s\n", ret->cc);
+ }
+ comma = 0;
+ }
- /* clean trailing punctuation */
- comma |= clean_trailing_punct(s);
+ /* clean trailing punctuation */
+ comma |= clean_trailing_punct(s);
- /* get city components */
+ /* get city components */
- /*
- * This part is ambiguous without punctuation after the street
- * because we can have any of the following forms:
- *
- * num predir? prefixtype? street+ suffixtype? suffdir?,
- * ((north|south|east|west)? city)? state? zip?
- *
- * and technically num can be of the form:
- *
- * pn1? n1 pn2? n2? sn2?
- * where
- * pn1 is a prefix character
- * n1 is a number
- * pn2 is a prefix character
- * n2 is a number
- * sn2 is a suffix character
- *
- * and a trailing letter might be [NSEW] which predir can also be
- *
- * So it is ambigious whether a directional between street and city
- * belongs to which component. Futher since the the street and the city
- * are both just a string of arbitrary words, it is difficult if not
- * impossible to determine if an give word belongs to sone side or the
- * other.
- *
- * So for the best results users should include a comma after the street.
- *
- * The approach will be as follows:
- * 1. look for a comma and assume this is the separator
- * 2. if we can find a state specific regex try that
- * 3. else loop through an array of possible regex patterns
- * 4. fail and assume there is not city
- */
+ /*
+ * This part is ambiguous without punctuation after the street
+ * because we can have any of the following forms:
+ *
+ * num predir? prefixtype? street+ suffixtype? suffdir?,
+ * ((north|south|east|west)? city)? state? zip?
+ *
+ * and technically num can be of the form:
+ *
+ * pn1? n1 pn2? n2? sn2?
+ * where
+ * pn1 is a prefix character
+ * n1 is a number
+ * pn2 is a prefix character
+ * n2 is a number
+ * sn2 is a suffix character
+ *
+ * and a trailing letter might be [NSEW] which predir can also be
+ *
+ * So it is ambigious whether a directional between street and city
+ * belongs to which component. Futher since the the street and the city
+ * are both just a string of arbitrary words, it is difficult if not
+ * impossible to determine if an give word belongs to sone side or the
+ * other.
+ *
+ * So for the best results users should include a comma after the street.
+ *
+ * The approach will be as follows:
+ * 1. look for a comma and assume this is the separator
+ * 2. if we can find a state specific regex try that
+ * 3. else loop through an array of possible regex patterns
+ * 4. fail and assume there is not city
+ */
- /* look for a comma */
- DBG("parse_address: s=%s", s);
- mi = 0;
+ /* look for a comma */
+ DBG("parse_address: s=%s", s);
+ mi = 0;
- regx = "(?:,\\s*)([^,]+)$";
- rc = match((char *)regx, s, ovect, 0);
- if (rc <= 0) {
- /* look for state specific regex */
- mi++;
- regx = (char *) get_state_regex(ret->st);
- if (regx)
- rc = match((char *)regx, s, ovect, 0);
- }
- DBG("Checked for comma: %d", rc);
- if (rc <= 0 && ret->st && strlen(ret->st)) {
- /* look for state specific regex */
- mi++;
- regx = (char *) get_state_regex(ret->st);
- if (regx)
- rc = match((char *)regx, s, ovect, 0);
- }
- DBG("Checked for state-city: %d", rc);
- if (rc <= 0) {
- int i;
- /* run through the regx's and see if we get a match */
- for (i=0; i<nreg; i++) {
- mi++;
- rc = match((char *)t_regx[i], s, ovect, 0);
- DBG(" rc=%d, i=%d", rc, i);
- if (rc > 0) break;
- }
- DBG("rc=%d, i=%d", rc, i);
- }
- DBG("Checked regexs: %d, %d, %d", rc, ovect[2], ovect[3]);
- if (rc > 0 && ovect[3]>ovect[2]) {
- /* we have a match so process it */
- ret->city = (char *) palloc0((ovect[3]-ovect[2]+1) * sizeof(char));
- strncpy(ret->city, s+ovect[2], ovect[3]-ovect[2]);
- /* truncate the state/province off the string */
- *(s+ovect[2]) = '\0';
- }
+ regx = "(?:,\\s*)([^,]+)$";
+ rc = match((char *)regx, s, ovect, 0);
+ if (rc <= 0) {
+ /* look for state specific regex */
+ mi++;
+ regx = (char *) get_state_regex(ret->st);
+ if (regx)
+ rc = match((char *)regx, s, ovect, 0);
+ }
+ DBG("Checked for comma: %d", rc);
+ if (rc <= 0 && ret->st && strlen(ret->st)) {
+ /* look for state specific regex */
+ mi++;
+ regx = (char *) get_state_regex(ret->st);
+ if (regx)
+ rc = match((char *)regx, s, ovect, 0);
+ }
+ DBG("Checked for state-city: %d", rc);
+ if (rc <= 0) {
+ int i;
+ /* run through the regx's and see if we get a match */
+ for (i=0; i<nreg; i++) {
+ mi++;
+ rc = match((char *)t_regx[i], s, ovect, 0);
+ DBG(" rc=%d, i=%d", rc, i);
+ if (rc > 0) break;
+ }
+ DBG("rc=%d, i=%d", rc, i);
+ }
+ DBG("Checked regexs: %d, %d, %d", rc, ovect[2], ovect[3]);
+ if (rc > 0 && ovect[3]>ovect[2]) {
+ /* we have a match so process it */
+ ret->city = (char *) palloc0((ovect[3]-ovect[2]+1) * sizeof(char));
+ strncpy(ret->city, s+ovect[2], ovect[3]-ovect[2]);
+ /* truncate the state/province off the string */
+ *(s+ovect[2]) = '\0';
+ }
- /* clean trailing punctuation */
- clean_trailing_punct(s);
+ /* clean trailing punctuation */
+ clean_trailing_punct(s);
- /* check for [@] that would indicate a intersection */
- /* -- 2010-12-11 : per Nancy R. we are using @ to indicate an intersection
- ampersand is used in both street names and landmarks so it is highly
- ambiguous -- */
- rc = match("^([^@]+)\\s*[@]\\s*([^@]+)$", s, ovect, 0);
- if (rc > 0) {
- s[ovect[3]] = '\0';
- clean_trailing_punct(s+ovect[2]);
- ret->street = pstrdup(s+ovect[2]);
+ /* check for [@] that would indicate a intersection */
+ /* -- 2010-12-11 : per Nancy R. we are using @ to indicate an intersection
+ ampersand is used in both street names and landmarks so it is highly
+ ambiguous -- */
+ rc = match("^([^@]+)\\s*[@]\\s*([^@]+)$", s, ovect, 0);
+ if (rc > 0) {
+ s[ovect[3]] = '\0';
+ clean_trailing_punct(s+ovect[2]);
+ ret->street = pstrdup(s+ovect[2]);
- s[ovect[5]] = '\0';
- clean_leading_punct(s+ovect[4]);
- ret->street2 = pstrdup(s+ovect[4]);
- }
- else {
+ s[ovect[5]] = '\0';
+ clean_leading_punct(s+ovect[4]);
+ ret->street2 = pstrdup(s+ovect[4]);
+ }
+ else {
- /* and the remainder must be the address components */
- ret->address1 = pstrdup(clean_leading_punct(s));
+ /* and the remainder must be the address components */
+ ret->address1 = pstrdup(clean_leading_punct(s));
- /* split the number off the street if it exists */
- rc = match("^((?i)[nsew]?\\d+[-nsew]*\\d*[nsew]?\\b)", s, ovect, 0);
- if (rc > 0) {
- ret->num = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
- strncpy(ret->num, s, ovect[1]-ovect[0]);
- ret->street = pstrdup(clean_leading_punct(s+ovect[1]));
- }
- }
+ /* split the number off the street if it exists */
+ rc = match("^((?i)[nsew]?\\d+[-nsew]*\\d*[nsew]?\\b)", s, ovect, 0);
+ if (rc > 0) {
+ ret->num = (char *) palloc0((ovect[1]-ovect[0]+1) * sizeof(char));
+ strncpy(ret->num, s, ovect[1]-ovect[0]);
+ ret->street = pstrdup(clean_leading_punct(s+ovect[1]));
+ }
+ }
- return ret;
+ return ret;
}
int load_state_hash(HHash *stH)
{
- char * words[][2] = {
- {"ALABAMA" , "AL"},
- {"ALASKA" , "AK"},
- {"AMERICAN SAMOA" , "AS"},
- {"AMER SAMOA" , "AS"},
- {"SAMOA" , "AS"},
- {"ARIZONA" , "AZ"},
- {"ARKANSAS" , "AR"},
- {"ARK" , "AR"},
- {"CALIFORNIA" , "CA"},
- {"CALIF" , "CA"},
- {"COLORADO" , "CO"},
- {"CONNECTICUT" , "CT"},
- {"CONN" , "CT"},
- {"DELAWARE" , "DE"},
- {"DELA" , "DE"},
- {"DISTRICT OF COLUMBIA" , "DC"},
- {"FEDERAL STATES OF MICRONESIA" , "FM"},
- {"MICRONESIA" , "FM"},
- {"FLORIDA" , "FL"},
- {"FLA" , "FL"},
- {"GEORGIA" , "GA"},
- {"GUAM" , "GU"},
- {"HAWAII" , "HI"},
- {"IDAHO" , "ID"},
- {"ILLINOIS" , "IL"},
- {"ILL" , "IL"},
- {"INDIANA" , "IN"},
- {"IND" , "IN"},
- {"IOWA" , "IA"},
- {"KANSAS" , "KS"},
- {"KENTUCKY" , "KY"},
- {"LOUISIANA" , "LA"},
- {"MAINE" , "ME"},
- {"MARSHALL ISLAND" , "MH"},
- {"MARSHALL ISL" , "MH"},
- {"MARSHALL IS" , "MH"},
- {"MARSHALL" , "MH"},
- {"MARYLAND" , "MD"},
- {"MASSACHUSETTS" , "MA"},
- {"MASS" , "MA"},
- {"MICHIGAN" , "MI"},
- {"MICH" , "MI"},
- {"MINNESOTA" , "MN"},
- {"MINN" , "MN"},
- {"MISSISSIPPI" , "MS"},
- {"MISS" , "MS"},
- {"MISSOURI" , "MO"},
- {"MONTANA" , "MT"},
- {"MONT" , "MT"},
- {"NEBRASKA" , "NE"},
- {"NEVADA" , "NV"},
- {"NEW HAMPSHIRE" , "NH"},
- {"NEW JERSEY" , "NJ"},
- {"NEW MEXICO" , "NM"},
- {"NEW YORK" , "NY"},
- {"NORTH CAROLINA" , "NC"},
- {"N CAROLINA" , "NC"},
- {"NORTH DAKOTA" , "ND"},
- {"N DAKOTA" , "ND"},
- {"NORTH MARIANA ISL" , "MP"},
- {"NORTH MARIANA IS" , "MP"},
- {"NORTH MARIANA" , "MP"},
- {"NORTH MARIANA ISLAND" , "MP"},
- {"OHIO" , "OH"},
- {"OKLAHOMA" , "OK"},
- {"OREGON" , "OR"},
- {"PALAU" , "PW"},
- {"PENNSYLVANIA" , "PA"},
- {"PENN" , "PA"},
- {"PUERTO RICO" , "PR"},
- {"RHODE ISLAND" , "RI"},
- {"SOUTH CAROLINA" , "SC"},
- {"S CAROLINA" , "SC"},
- {"SOUTH DAKOTA" , "SD"},
- {"S DAKOTA" , "SD"},
- {"TENNESSEE" , "TN"},
- {"TENN" , "TN"},
- {"TEXAS" , "TX"},
- {"UTAH" , "UT"},
- {"VERMONT" , "VT"},
- {"VIRGIN ISLANDS" , "VI"},
- {"VIRGINIA" , "VA"},
- {"WASHINGTON" , "WA"},
- {"WASH" , "WA"},
- {"WEST VIRGINIA" , "WV"},
- {"W VIRGINIA" , "WV"},
- {"WISCONSIN" , "WI"},
- {"WISC" , "WI"},
- {"WYOMING" , "WY"},
- {"ALBERTA" , "AB"},
- {"BRITISH COLUMBIA" , "BC"},
- {"MANITOBA" , "MB"},
- {"NEW BRUNSWICK" , "NB"},
- {"NEW FOUNDLAND AND LABORDOR" , "NL"},
- {"NEW FOUNDLAND" , "NL"},
- {"NEWFOUNDLAND" , "NL"},
- {"LABORDOR" , "NL"},
- {"NORTHWEST TERRITORIES" , "NT"},
- {"NORTHWEST TERRITORY" , "NT"},
- {"NWT" , "NT"},
- {"NOVA SCOTIA" , "NS"},
- {"NUNAVUT" , "NU"},
- {"ONTARIO" , "ON"},
- {"ONT" , "ON"},
- {"PRINCE EDWARD ISLAND" , "PE"},
- {"PEI" , "PE"},
- {"QUEBEC" , "QC"},
- {"SASKATCHEWAN" , "SK"},
- {"YUKON" , "YT"},
- {"NF" , "NL"},
- {NULL, NULL}
- };
+ char * words[][2] = {
+ {"ALABAMA" , "AL"},
+ {"ALASKA" , "AK"},
+ {"AMERICAN SAMOA" , "AS"},
+ {"AMER SAMOA" , "AS"},
+ {"SAMOA" , "AS"},
+ {"ARIZONA" , "AZ"},
+ {"ARKANSAS" , "AR"},
+ {"ARK" , "AR"},
+ {"CALIFORNIA" , "CA"},
+ {"CALIF" , "CA"},
+ {"COLORADO" , "CO"},
+ {"CONNECTICUT" , "CT"},
+ {"CONN" , "CT"},
+ {"DELAWARE" , "DE"},
+ {"DELA" , "DE"},
+ {"DISTRICT OF COLUMBIA" , "DC"},
+ {"FEDERAL STATES OF MICRONESIA" , "FM"},
+ {"MICRONESIA" , "FM"},
+ {"FLORIDA" , "FL"},
+ {"FLA" , "FL"},
+ {"GEORGIA" , "GA"},
+ {"GUAM" , "GU"},
+ {"HAWAII" , "HI"},
+ {"IDAHO" , "ID"},
+ {"ILLINOIS" , "IL"},
+ {"ILL" , "IL"},
+ {"INDIANA" , "IN"},
+ {"IND" , "IN"},
+ {"IOWA" , "IA"},
+ {"KANSAS" , "KS"},
+ {"KENTUCKY" , "KY"},
+ {"LOUISIANA" , "LA"},
+ {"MAINE" , "ME"},
+ {"MARSHALL ISLAND" , "MH"},
+ {"MARSHALL ISL" , "MH"},
+ {"MARSHALL IS" , "MH"},
+ {"MARSHALL" , "MH"},
+ {"MARYLAND" , "MD"},
+ {"MASSACHUSETTS" , "MA"},
+ {"MASS" , "MA"},
+ {"MICHIGAN" , "MI"},
+ {"MICH" , "MI"},
+ {"MINNESOTA" , "MN"},
+ {"MINN" , "MN"},
+ {"MISSISSIPPI" , "MS"},
+ {"MISS" , "MS"},
+ {"MISSOURI" , "MO"},
+ {"MONTANA" , "MT"},
+ {"MONT" , "MT"},
+ {"NEBRASKA" , "NE"},
+ {"NEVADA" , "NV"},
+ {"NEW HAMPSHIRE" , "NH"},
+ {"NEW JERSEY" , "NJ"},
+ {"NEW MEXICO" , "NM"},
+ {"NEW YORK" , "NY"},
+ {"NORTH CAROLINA" , "NC"},
+ {"N CAROLINA" , "NC"},
+ {"NORTH DAKOTA" , "ND"},
+ {"N DAKOTA" , "ND"},
+ {"NORTH MARIANA ISL" , "MP"},
+ {"NORTH MARIANA IS" , "MP"},
+ {"NORTH MARIANA" , "MP"},
+ {"NORTH MARIANA ISLAND" , "MP"},
+ {"OHIO" , "OH"},
+ {"OKLAHOMA" , "OK"},
+ {"OREGON" , "OR"},
+ {"PALAU" , "PW"},
+ {"PENNSYLVANIA" , "PA"},
+ {"PENN" , "PA"},
+ {"PUERTO RICO" , "PR"},
+ {"RHODE ISLAND" , "RI"},
+ {"SOUTH CAROLINA" , "SC"},
+ {"S CAROLINA" , "SC"},
+ {"SOUTH DAKOTA" , "SD"},
+ {"S DAKOTA" , "SD"},
+ {"TENNESSEE" , "TN"},
+ {"TENN" , "TN"},
+ {"TEXAS" , "TX"},
+ {"UTAH" , "UT"},
+ {"VERMONT" , "VT"},
+ {"VIRGIN ISLANDS" , "VI"},
+ {"VIRGINIA" , "VA"},
+ {"WASHINGTON" , "WA"},
+ {"WASH" , "WA"},
+ {"WEST VIRGINIA" , "WV"},
+ {"W VIRGINIA" , "WV"},
+ {"WISCONSIN" , "WI"},
+ {"WISC" , "WI"},
+ {"WYOMING" , "WY"},
+ {"ALBERTA" , "AB"},
+ {"BRITISH COLUMBIA" , "BC"},
+ {"MANITOBA" , "MB"},
+ {"NEW BRUNSWICK" , "NB"},
+ {"NEW FOUNDLAND AND LABORDOR" , "NL"},
+ {"NEW FOUNDLAND" , "NL"},
+ {"NEWFOUNDLAND" , "NL"},
+ {"LABORDOR" , "NL"},
+ {"NORTHWEST TERRITORIES" , "NT"},
+ {"NORTHWEST TERRITORY" , "NT"},
+ {"NWT" , "NT"},
+ {"NOVA SCOTIA" , "NS"},
+ {"NUNAVUT" , "NU"},
+ {"ONTARIO" , "ON"},
+ {"ONT" , "ON"},
+ {"PRINCE EDWARD ISLAND" , "PE"},
+ {"PEI" , "PE"},
+ {"QUEBEC" , "QC"},
+ {"SASKATCHEWAN" , "SK"},
+ {"YUKON" , "YT"},
+ {"NF" , "NL"},
+ {NULL, NULL}
+ };
#ifdef USE_HSEARCH
- ENTRY e, *ep;
- int err;
+ ENTRY e, *ep;
+ int err;
#else
- char *key;
- char *val;
+ char *key;
+ char *val;
#endif
- int i, cnt;
+ int i, cnt;
- /* count the entries above */
- cnt = 0;
- while (words[cnt][0]) cnt++;
+ /* count the entries above */
+ cnt = 0;
+ while (words[cnt][0]) cnt++;
- DBG("Words cnt=%d", cnt);
+ DBG("Words cnt=%d", cnt);
#ifdef USE_HSEARCH
- if (! hcreate_r(cnt*2, stH)) return 1001;
- for (i=0; i<cnt; i++) {
- e.key = words[i][0];
- e.data = words[i][1];
- err = hsearch_r(e, ENTER, &ep, stH);
- /* there should be no failures */
- if (!err) return 1003;
- e.key = words[i][1];
- e.data = words[i][1];
- err = hsearch_r(e, ENTER, &ep, stH);
- /* there should be no failures */
- if (!err) return 1003;
- }
+ if (! hcreate_r(cnt*2, stH)) return 1001;
+ for (i=0; i<cnt; i++) {
+ e.key = words[i][0];
+ e.data = words[i][1];
+ err = hsearch_r(e, ENTER, &ep, stH);
+ /* there should be no failures */
+ if (!err) return 1003;
+ e.key = words[i][1];
+ e.data = words[i][1];
+ err = hsearch_r(e, ENTER, &ep, stH);
+ /* there should be no failures */
+ if (!err) return 1003;
+ }
#else
- if (! stH ) return 1001;
- for (i=0; i<cnt; i++) {
- //DBG("load_hash i=%d", i);
- key = words[i][0];
- val = words[i][1];
- hash_set(stH, key, (void *)val);
- key = words[i][1];
- val = words[i][1];
- hash_set(stH, key, (void *)val);
- }
+ if (! stH ) return 1001;
+ for (i=0; i<cnt; i++) {
+ //DBG("load_hash i=%d", i);
+ key = words[i][0];
+ val = words[i][1];
+ hash_set(stH, key, (void *)val);
+ key = words[i][1];
+ val = words[i][1];
+ hash_set(stH, key, (void *)val);
+ }
#endif
- return 0;
+ return 0;
}
void free_state_hash(HHash *stH)
{
//#if 0
#ifdef USE_HSEARCH
- if (stH) hdestroy_r(stH);
+ if (stH) hdestroy_r(stH);
#else
- if (stH) hash_free(stH);
+ if (stH) hash_free(stH);
#endif
//#endif
}
diff --git a/extensions/address_standardizer/parseaddress-api.h b/extensions/address_standardizer/parseaddress-api.h
index a3773a431..67af25571 100644
--- a/extensions/address_standardizer/parseaddress-api.h
+++ b/extensions/address_standardizer/parseaddress-api.h
@@ -20,7 +20,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include "postgres.h"
-#define OVECCOUNT 30
+#define OVECPAIRS 10
+#define OVECCOUNT 3*OVECPAIRS
#ifdef USE_HSEARCH
@@ -40,17 +41,17 @@ typedef hash_t HHash;
#endif
typedef struct address_struct {
- char *num;
- char *street;
- char *street2;
- char *address1;
- char *city;
- char *st;
- char *zip;
- char *zipplus;
- char *cc;
- double lat;
- double lon;
+ char *num;
+ char *street;
+ char *street2;
+ char *address1;
+ char *city;
+ char *st;
+ char *zip;
+ char *zipplus;
+ char *cc;
+ double lat;
+ double lon;
} ADDRESS;
int clean_trailing_punct(char *s);
diff --git a/extensions/address_standardizer/std_pg_hash.c b/extensions/address_standardizer/std_pg_hash.c
index da2f18974..fbdf17ee4 100644
--- a/extensions/address_standardizer/std_pg_hash.c
+++ b/extensions/address_standardizer/std_pg_hash.c
@@ -623,6 +623,7 @@ static int load_lex(LEXICON *lex, char *tab)
char *word;
char *stdword;
int token;
+ (void)total_tuples;
DBG("start load_lex\n");
SET_TIME(t1);
diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index d0db04381..f7bd9e481 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -5677,6 +5677,7 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
lwalloc(nearbycount * sizeof(LWGEOM *))
;
int nn = 0;
+ (void)nn;
for (i=0; i<numnodes; ++i)
{
LWT_ISO_NODE *n = &(nodes[i]);
diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c
index bf90432b4..8a1c8d9f5 100644
--- a/postgis/gserialized_estimate.c
+++ b/postgis/gserialized_estimate.c
@@ -727,6 +727,8 @@ nd_box_ratio(const ND_BOX *b1, const ND_BOX *b2, int ndims)
double vol2 = 1.0;
double vol1 = 1.0;
+ (void)vol1;
+
for ( d = 0 ; d < ndims; d++ )
{
if ( b1->max[d] <= b2->min[d] || b1->min[d] >= b2->max[d] )
@@ -1414,6 +1416,8 @@ compute_gserialized_stats_mode(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfu
int stats_slot; /* What slot is this data going into? (2D vs ND) */
int stats_kind; /* And this is what? (2D vs ND) */
+ (void)total_sample_volume;
+
/* Initialize sum and stddev */
nd_box_init(&sum);
nd_box_init(&stddev);
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
configure.ac | 66 +-
extensions/address_standardizer/Makefile.in | 3 +-
extensions/address_standardizer/parseaddress-api.c | 890 +++++++++++----------
extensions/address_standardizer/parseaddress-api.h | 25 +-
extensions/address_standardizer/std_pg_hash.c | 1 +
liblwgeom/lwgeom_topo.c | 1 +
postgis/gserialized_estimate.c | 4 +
8 files changed, 543 insertions(+), 448 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list