Commit fb991b4f authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 2.1.5+dfsg

parent 7bed3341
This diff is collapsed.
PostGIS 2.1.5
2014/12/18
* Enhancements *
- #2933, Speedup construction of large multi-geometry objects
* Bug Fixes *
- #2947, Fix memory leak in lwgeom_make_valid for single-component
collection input
- #2949, Fix memory leak in lwgeom_mindistance2d for curve input
- #2931, BOX representation is case sensitive
- #2942, PostgreSQL 9.5 support
- #2953, 2D stats not generated when Z/M values are extreme
- #3009, Geography cast may effect underlying tuple
PostGIS 2.1.4
2014/09/10
......
PostGIS - Geographic Information Systems Extensions to PostgreSQL
=================================================================
:Version: 2.1.4
:Date: 2014-09-10
:Version: 2.1.5
:Date: 2014-12-18
:Website: http://postgis.net
This distribution contains a module which implements GIS simple features, ties
......
......@@ -5,5 +5,5 @@
POSTGIS_MAJOR_VERSION=2
POSTGIS_MINOR_VERSION=1
POSTGIS_MICRO_VERSION=4
POSTGIS_MICRO_VERSION=5
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -11,7 +11,8 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# Copyright (C) 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -19,10 +20,16 @@
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
# Check for 'mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl FIXME we are no longer going to remove this! adjust warning
dnl FIXME message accordingly.
AC_DIAGNOSE([obsolete],
[$0: this macro is deprecated, and will soon be removed.
You should use the Autoconf-provided 'AC][_PROG_MKDIR_P' macro instead,
and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.])
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@ dnl **********************************************************************
dnl * $Id: configure.ac 2797 2008-05-31 09:56:44Z mcayland $
dnl *
dnl * PostGIS - Spatial Types for PostgreSQL
dnl * http://postgis.refractions.net
dnl * http://postgis.net
dnl * Copyright 2008 Mark Cave-Ayland
dnl *
dnl * This is free software; you can redistribute and/or modify it under
......@@ -116,6 +116,7 @@ AC_CHECK_FUNC(vasprintf, [HAVE_VASPRINTF=1], [HAVE_VASPRINTF=0])
AC_DEFINE([HAVE_VASPRINTF])
AC_CHECK_FUNC(asprintf, [HAVE_ASPRINTF=1], [HAVE_ASPRINTF=0])
AC_DEFINE([HAVE_ASPRINTF])
AC_CHECK_FUNC(strcasestr, AC_DEFINE([HAVE_STRCASESTR]))
AC_FUNC_FSEEKO()
dnl
......
......@@ -2,7 +2,7 @@
# * $Id$
# *
# * PostGIS - Spatial Types for PostgreSQL
# * http://postgis.refractions.net
# * http://postgis.net
# * Copyright 2010 Mark Cave-Ayland
# *
# * This is free software; you can redistribute and/or modify it under
......
......@@ -3,7 +3,7 @@
<title>Topology</title>
<para>The PostGIS Topology types and functions are used to manage topological objects such as faces, edges and nodes. </para>
<para>Sandro Santilli's presentation at PostGIS Day Paris 2011 conference gives a good synopsis of PostGIS Topology and where it is headed <ulink url="http://strk.keybit.net/projects/postgis/Paris2011_TopologyWithPostGIS_2_0.pdf">Topology with PostGIS 2.0 slide deck</ulink>.</para>
<para>Vincent Picavet provides a good synopsis and overview of what is Topology, how is it used, and various FOSS4G tools that support it in <ulink url="http://2010.foss4g.org/presentations/3555.pdf">State of the art of FOSS4G for topology and network analysis</ulink>.</para>
<para>Vincent Picavet provides a good synopsis and overview of what is Topology, how is it used, and various FOSS4G tools that support it in <ulink url="https://github.com/Oslandia/presentations/blob/master/pgconf_eu_2012/pgconfeu2012_vincent_picavet_postgis_topology.pdf?raw=true">PostGIS Topology PGConf EU 2012</ulink>.</para>
<para>An example of a topologically based GIS database is the <ulink url="http://www.census.gov/geo/www/tiger/overview.html">US Census Topologically Integrated Geographic Encoding and Reference System (TIGER)</ulink> database. If you want to experiment with PostGIS topology and need some data, check out <xref linkend="Topology_Load_Tiger" />.</para>
<para>The PostGIS topology module has existed in prior versions of PostGIS but was never part of the Official PostGIS documentation.
In PostGIS 2.0.0 major cleanup is going on to remove use of all deprecated functions in it, fix known usability issues, better document the features and functions, add new functions, and enhance to closer conform to SQL-MM standards.</para>
......@@ -280,7 +280,7 @@ ERROR: value for domain topology.topoelementarray violates check constraint "di
<para>If you don't specify [child_layer] (or set it to NULL) this layer would contain Basic TopoGeometries (composed by primitive topology elements).
Otherwise this layer will contain hierarchical TopoGeometries (composed by TopoGeometries from the child_layer).</para>
<para>Once the layer is created (it's id is returned by the AddTopoGeometryColumn function) you're ready to construct TopoGeometry objects in it</para>
<para>Once the layer is created (its id is returned by the AddTopoGeometryColumn function) you're ready to construct TopoGeometry objects in it</para>
<para>Valid <varname>feature_type</varname>s are: POINT, LINE, POLYGON, COLLECTION</para>
<!-- use this format if new function -->
......@@ -2343,7 +2343,7 @@ edgeid
<refname>AddFace</refname>
<refpurpose>
Registers a face primitive to a topology and get it's identifier.
Registers a face primitive to a topology and gets its identifier.
</refpurpose>
</refnamediv>
......@@ -2362,7 +2362,7 @@ Registers a face primitive to a topology and get it's identifier.
<title>Description</title>
<para>
Registers a face primitive to a topology and get it's identifier.
Registers a face primitive to a topology and gets its identifier.
</para>
<para>
......
......@@ -2,7 +2,7 @@
# * $Id: Makefile.in
# *
# * PostGIS - Spatial Types for PostgreSQL
# * http://postgis.refractions.net
# * http://postgis.net
# * Copyright 2008 Kevin Neufeld
# *
# * This is free software; you can redistribute and/or modify it under
......
......@@ -2,7 +2,7 @@
* $Id: generator.c 3967 2009-05-04 16:48:11Z kneufeld $
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.refractions.net
* http://postgis.net
* Copyright 2008 Kevin Neufeld
*
* This is free software; you can redistribute and/or modify it under
......
......@@ -2,7 +2,7 @@
* $Id: generator.c 3967 2009-05-04 16:48:11Z kneufeld $
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.refractions.net
* http://postgis.net
* Copyright 2008 Kevin Neufeld
*
* This is free software; you can redistribute and/or modify it under
......
......@@ -2,7 +2,7 @@
* $Id: generator.c 3967 2009-05-04 16:48:11Z kneufeld $
*
* PostGIS - Spatial Types for PostgreSQL
* http://postgis.refractions.net
* http://postgis.net
* Copyright 2008 Kevin Neufeld
*
* This is free software; you can redistribute and/or modify it under
......
......@@ -108,4 +108,4 @@ by Frank Warmerdam <warmerda@gdal.velocet.ca> to write to ESRI Shape files.
.LP
shp2pgsql(1)
More information is available at http://postgis.refractions.net
More information is available at http://postgis.net
......@@ -145,4 +145,4 @@ by Frank Warmerdam <warmerda@gdal.velocet.ca> to read from ESRI Shape files.
.LP
pgsql2shp(1)
More information is available at http://postgis.refractions.net
More information is available at http://postgis.net
......@@ -371,6 +371,10 @@ COMMENT ON FUNCTION ST_AsGeoJSON(integer , geometry , integer , integer ) IS 'ar
COMMENT ON FUNCTION ST_AsGeoJSON(integer , geography , integer , integer ) IS 'args: gj_version, geog, maxdecimaldigits=15, options=0 - Return the geometry as a GeoJSON element.';
COMMENT ON FUNCTION ST_AsGML(geometry , integer , integer ) IS 'args: geom, maxdecimaldigits=15, options=0 - Return the geometry as a GML version 2 or 3 element.';
COMMENT ON FUNCTION ST_AsGML(geography , integer , integer ) IS 'args: geog, maxdecimaldigits=15, options=0 - Return the geometry as a GML version 2 or 3 element.';
COMMENT ON FUNCTION ST_AsGML(integer , geometry , integer , integer , text , text ) IS 'args: version, geom, maxdecimaldigits=15, options=0, nprefix=null, id=null - Return the geometry as a GML version 2 or 3 element.';
COMMENT ON FUNCTION ST_AsGML(integer , geography , integer , integer , text , text ) IS 'args: version, geog, maxdecimaldigits=15, options=0, nprefix=null, id=null - Return the geometry as a GML version 2 or 3 element.';
......
......@@ -367,7 +367,7 @@ st_asgeojson
<refsynopsisdiv>
<funcsynopsis>
<!--
<funcprototype>
<funcdef>text <function>ST_AsGML</function></funcdef>
<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef>
......@@ -380,7 +380,7 @@ st_asgeojson
<paramdef choice="opt"><type>integer </type> <parameter>maxdecimaldigits=15</parameter></paramdef>
<paramdef choice="opt"><type>integer </type> <parameter>options=0</parameter></paramdef>
</funcprototype>
-->
<funcprototype>
<funcdef>text <function>ST_AsGML</function></funcdef>
......
......@@ -2,7 +2,28 @@
<appendix id="release_notes">
<title>Appendix</title>
<subtitle>Release Notes</subtitle>
<sect1>
<title>Release 2.1.5</title>
<para>Release date: 2014-12-18</para>
<para>This is a bug fix and performance improvement release.</para>
<simplesect>
<title>Enhancements</title>
<para>#2933, Speedup construction of large multi-geometry objects</para>
</simplesect>
<simplesect>
<title>Bug Fixes</title>
<para>#2947, Fix memory leak in lwgeom_make_valid for single-component
collection input</para>
<para>#2949, Fix memory leak in lwgeom_mindistance2d for curve input</para>
<para>#2931, BOX representation is case sensitive</para>
<para>#2942, PostgreSQL 9.5 support</para>
<para>#2953, 2D stats not generated when Z/M values are extreme</para>
<para>#3009, Geography cast may effect underlying tuple</para>
</simplesect>
</sect1>
<sect1>
<title>Release 2.1.4</title>
<para>Release date: 2014-09-10</para>
......
......@@ -93,7 +93,7 @@ COMMENT ON FUNCTION topology.AddNode(varchar , geometry , boolean , boolean ) IS
COMMENT ON FUNCTION topology.AddEdge(varchar , geometry ) IS 'args: toponame, aline - Adds a linestring edge to the edge table and associated start and end points to the point nodes table of the specified topology schema using the specified linestring geometry and returns the edgeid of the new (or existing) edge.';
COMMENT ON FUNCTION topology.AddFace(varchar , geometry , boolean ) IS 'args: toponame, apolygon, force_new=false - Registers a face primitive to a topology and get its identifier.';
COMMENT ON FUNCTION topology.AddFace(varchar , geometry , boolean ) IS 'args: toponame, apolygon, force_new=false - Registers a face primitive to a topology and gets its identifier.';
COMMENT ON FUNCTION topology.ST_Simplify(TopoGeometry, float) IS 'args: geomA, tolerance - Returns a "simplified" geometry version of the given TopoGeometry using the Douglas-Peucker algorithm.';
......
#############################################################################
#
# Master makefile used to build extensions
# Copyright (C) 2012 Regina Obe and Leo Hsu <lr@pcorp.us>
# Copyright (C) 2012 Sandro Santilli <strk@keybit.net>
#
# This is free software; you can redistribute and/or modify it under
# the terms of the GNU General Public Licence. See the COPYING file.
#
#############################################################################
SUBDIRS = postgis
SUBDIRS += postgis_tiger_geocoder
ifeq (topology,topology)
SUBDIRS += postgis_topology
endif
all clean distclean install uninstall:
for DIR in $(SUBDIRS); do \
echo "---- Making $@ in $${DIR}"; \
$(MAKE) -C "$${DIR}" $@; \
done
distclean: distclean-local
distclean-local:
rm -f Makefile
check:
@echo "Nothing to check"
include ../upgradeable_versions.mk
EXTENSION = postgis
EXTVERSION = 2.1.4
MINORVERSION = 2.1
GREP = /bin/grep
MICRO_NUMBER = $(shell echo $(EXTVERSION) | sed "s/[0-9]\.[0-9]\.\([0-9]*\)[a-zA-Z]*[0-9]*/\1/")
PREREL_NUMBER = $(shell echo $(EXTVERSION) | \
sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
$(GREP) "[a-zA-Z]" | \
sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
MICRO_PREV = $(shell if test "$(MICRO_NUMBER)x" != "x"; then expr $(MICRO_NUMBER) - 1; fi)
PREREL_PREV = $(shell if test "$(PREREL_NUMBER)x" != "x"; then expr $(PREREL_NUMBER) - 1; fi)
PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
$(GREP) "[a-zA-Z]" | \
sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
#DOCS = $(wildcard ../../doc/html/*.html)
PG_CONFIG = /var/lib/jenkins/workspace/pg/rel/pg9.2w64/bin/pg_config
PG91 = $(shell $(PG_CONFIG) --version | $(GREP) -qE " 8\.| 9\.0" && echo no || echo yes)
SQL_BITS = $(wildcard sql_bits/*.sql)
EXTRA_CLEAN += ${SQL_BITS} sql/*.sql
ifeq ($(PG91),yes)
sql/$(EXTENSION).sql: sql_bits/postgis.sql sql_bits/postgis_comments.sql sql_bits/rtpostgis.sql sql_bits/mark_editable_objects.sql.in sql_bits/raster_comments.sql sql_bits/spatial_ref_sys.sql
mkdir -p sql
cat $^ > $@
all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql sql_minor_upgrade sql_patch_upgrade
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
mkdir -p sql
cp $< $@
sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/postgis--unpackaged.sql.in
mkdir -p sql
cp $< $@
#this is a cludge to allow upgrading from same SVN to same SVN
sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: sql_bits/extension_upgrade_patch.sql
cp $< $@
sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql_bits/extension_upgrade_patch.sql
cp $< $@
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/spatial_ref_sys.sql: ../../spatial_ref_sys.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/postgis.sql: ../../postgis/postgis.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
../../doc/postgis_comments.sql:
$(MAKE) -C ../../doc comments
sql_bits/postgis_comments.sql: ../../doc/postgis_comments.sql
cp $< $@
#strip BEGIN/COMMIT since these are not allowed in extensions
sql_bits/rtpostgis.sql: ../../raster/rt_pg/rtpostgis.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' $< > $@
# we need to also drop this temporary function from the extension
# for casts that are being dropped we need to drop them
# from extension only if they are in the existension so we use our postgis_extension_drop..
# so that it will silently fail if cast is not in extension
sql_bits/rtpostgis_upgrade_20_21.sql: ../../raster/rt_pg/rtpostgis_upgrade_20_21.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-e 's/DROP FUNCTION _rename_raster_tables();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _rename_raster_tables();DROP FUNCTION _rename_raster_tables();/g' \
-e 's/DROP FUNCTION _drop_st_samealignment();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _drop_st_samealignment();DROP FUNCTION _drop_st_samealignment();/g' \
-e 's/DROP CAST\(.*\)/SELECT postgis_extension_drop_if_exists('\''$(EXTENSION)'\'', '\''DROP CAST \1'\'');DROP CAST \1/' \
$< > $@
sql_bits/rtpostgis_upgrade_21_minor.sql: ../../raster/rt_pg/rtpostgis_upgrade_21_minor.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-e 's/DROP FUNCTION _rename_raster_tables();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _rename_raster_tables();DROP FUNCTION _rename_raster_tables();/g' \
-e 's/DROP FUNCTION _drop_st_samealignment();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION _drop_st_samealignment();DROP FUNCTION _drop_st_samealignment();/g' \
-e 's/DROP CAST\(.*\)/SELECT postgis_extension_drop_if_exists('\''$(EXTENSION)'\'', '\''DROP CAST \1'\'');DROP CAST \1/' \
$< > $@
#don't drop casts just yet since we don't have provision to remove from extension yet
#need to also drop temporary functions from extenions since it gets auto-added
sql_bits/postgis_upgrade_20_21.sql: ../../postgis/postgis_upgrade_20_21.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-e '/^\(DROP\|CREATE\) \(CAST\).*;/d' \
-e '/^\(DROP\|CREATE\) \(CAST\)/,/\;/d' \
-e 's/DROP FUNCTION postgis_major_version_check();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION postgis_major_version_check();DROP FUNCTION postgis_major_version_check();/g' \
$< > $@
sql_bits/postgis_upgrade_21_minor.sql: ../../postgis/postgis_upgrade_21_minor.sql
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' \
-e '/^\(DROP\|CREATE\) \(CAST\).*;/d' \
-e '/^\(DROP\|CREATE\) \(CAST\)/,/\;/d' \
-e 's/DROP FUNCTION postgis_major_version_check();/ALTER EXTENSION ${EXTENSION} DROP FUNCTION postgis_major_version_check();DROP FUNCTION postgis_major_version_check();/g' \
$< > $@
../../doc/raster_comments.sql:
$(MAKE) -C ../../doc comments
sql_bits/raster_comments.sql: ../../doc/raster_comments.sql
cp $< $@
#extension_upgrade_minor.sql is the one that contains both postgis AND raster
#TODO: what about postgis_drop_after.sql ? where does it fit ??
sql_bits/extension_upgrade_minor.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade_20_21.sql sql_bits/rtpostgis_upgrade_20_21.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql
cat $^ > $@
sql_bits/extension_upgrade_patch.sql: ../postgis_extension_helper.sql sql_bits/postgis_upgrade_21_minor.sql sql_bits/rtpostgis_upgrade_21_minor.sql ../../doc/raster_comments.sql ../../doc/postgis_comments.sql ../postgis_extension_helper_uninstall.sql
cat $^ > $@
# sql_bits/rtpostgis--unpackaged.sql: ../../raster/rt_pg/rtpostgis.sql
# sed -e 's/^[\t]*//' \
# -e :a -e '$!N; s/,\n/,/; ta' \
# $< > $@
#remove leading white space and tabs
#remove line break from a line if it ends in ,
sql_bits/rtpostgis-filtered.sql: ../../raster/rt_pg/rtpostgis.sql
sed \
-e 's/^[\t]*//' \
$< > $@
## we are going to hard code for now using sql script to generate unpackage script
# sql_bits/rtpostgis--unpackaged.sql: ../../raster/rt_pg/rtpostgis.sql
# sed \
# -e 's/^[\t]*//' \
# -e '$!N; s/(\n/(/g' \
# -e '/^CREATE \(OR REPLACE FUNCTION\|TRIGGER\|TYPE\|TABLE\|VIEW\)/!d;' \
# -e 's/OR REPLACE//g' \
# -e 's/CREATE\(.*\)/ALTER EXTENSION $(EXTENSION) ADD\1;/' \
# -e 's/DEFAULT [^()]\+//g' \
# -e 's/\(BEFORE\|AS\|RETURNS\)\(.*\)/;/' \
# -e 's/(;/;/' \
# -e 's/\\(;/;/' \
# -e 's/;;/;/g' $< > $@
# sql_bits/postgis--unpackaged.sql: ../../postgis/postgis.sql
# sed -e '/^CREATE \(OR REPLACE\|TRIGGER\|TYPE\|TABLE\|VIEW\)/!d;' \
# -e 's/OR REPLACE//g' \
# -e 's/CREATE\(.*\)/ALTER EXTENSION $(EXTENSION) ADD\1;/' \
# -e 's/DEFAULT [\.0-9a-zA-Z]\+//g' \
# -e 's/\(BEFORE\|AS\|RETURNS\)\(.*\)/;/' \
# -e 's/(;/;/' \
# -e 's/\\(;/;/' \
# -e 's/;;/;/g' $< > $@
sql_minor_upgrade: sql_bits/extension_upgrade_minor.sql
for OLD_VERSION in $(UPGRADEABLE_VERSIONS_MINOR); do \
cat $< > sql/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
done
sql_patch_upgrade: sql_bits/extension_upgrade_patch.sql
for OLD_VERSION in $(UPGRADEABLE_VERSIONS_PATCH); do \
cat $< > sql/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
done
DATA = $(wildcard sql/*--*.sql)
EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/postgis--unpackaged--$(EXTVERSION).sql
endif
distclean: clean
rm -f Makefile
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
# postgis extension
comment = 'PostGIS geometry, geography, and raster spatial types and functions'
default_version = '2.1.4'
default_version = '2.1.5'
module_pathname = '$libdir/postgis-2.1'
relocatable = true
include ../upgradeable_versions.mk
EXTENSION = postgis_tiger_geocoder
EXTVERSION = 2.1.4
MINORVERSION = 2011.2.1
MICRO_NUMBER = $(shell echo $(EXTVERSION) | sed "s/[0-9]\.[0-9]\.\([0-9]*\)[a-zA-Z]*[0-9]*/\1/")
PREREL_NUMBER = $(shell echo $(EXTVERSION) | \
sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
grep "[a-zA-Z]" | \
sed "s/[0-9][a-zA-Z]\([0-9]*\)[a-zA-Z]*/\1/")
MICRO_PREV = $(shell if test "$(MICRO_NUMBER)x" != "x"; then expr $(MICRO_NUMBER) - 1; fi)
PREREL_PREV = $(shell if test "$(PREREL_NUMBER)x" != "x"; then expr $(PREREL_NUMBER) - 1; fi)
PREREL_PREFIX = $(shell echo $(EXTVERSION) | \
sed "s/[0-9]\.[0-9]\.\(.*\)/\1/" | \
grep "[a-zA-Z]" | \
sed "s/\([0-9][a-zA-Z]*\)[0-9]*/\1/")
DATA = $(filter-out $(wildcard sql/*--*.sql),$(wildcard sql/*.sql))
PG_CONFIG = /var/lib/jenkins/workspace/pg/rel/pg9.2w64/bin/pg_config
PG91 = $(shell $(PG_CONFIG) --version | grep -qE " 8\.| 9\.0" && echo no || echo yes)
SQL_BITS = $(wildcard sql_bits/*.sql)
EXTRA_CLEAN += sql/*.sql ${SQL_BITS}
ifeq ($(PG91),yes)
all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql sql_minor_upgrade
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
mkdir -p sql
cp $< $@
sql/$(EXTENSION).sql: sql_bits/tiger_geocoder.sql sql_bits/mark_editable_objects.sql.in sql_bits/tiger_geocoder_comments.sql
mkdir -p sql
cat $^ > $@
#this is a cludge to allow upgrading from same SVN to same SVN
sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_objects.sql.in sql_bits/tiger_geocoder_comments.sql ../postgis_extension_helper_uninstall.sql
mkdir -p sql
cat $^ > $@
sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql
mkdir -p sql
cp $< $@
#strip BEGIN/COMMIT since these are not allowed in extensions
#strip CREATE SCHEMA since we force extension
# to create schema by setting schema to tiger_geocoder in control
sql_bits/tiger_geocoder_minor.sql.in: ../../extras/tiger_geocoder/tiger_2011/utility/set_search_path.sql \
../../extras/tiger_geocoder/tiger_2011/tiger_loader_2013.sql \
../../extras/tiger_geocoder/tiger_2011/utility/utmzone.sql \
../../extras/tiger_geocoder/tiger_2011/utility/cull_null.sql \
../../extras/tiger_geocoder/tiger_2011/utility/nullable_levenshtein.sql \
../../extras/tiger_geocoder/tiger_2011/utility/levenshtein_ignore_case.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/end_soundex.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/count_words.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/state_extract.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/get_last_words.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_countysub_exact.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_countysub_fuzzy.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_place_exact.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_place_fuzzy.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/normalize_address.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/pprint_addy.sql \
../../extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql \
../../extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_normalize_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/other_helper_functions.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/rate_attributes.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/includes_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/interpolate_from_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_location.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_intersection.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/reverse_geocode.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/census_tracts_functions.sql
cat $^ > $@
sql_bits/tiger_geocoder.sql.in: sql_bits/norm_addy_create.sql.in \
../../extras/tiger_geocoder/tiger_2011/utility/set_search_path.sql \
../../extras/tiger_geocoder/tiger_2011/geocode_settings.sql \
../../extras/tiger_geocoder/tiger_2011/tables/lookup_tables_2011.sql \
../../extras/tiger_geocoder/tiger_2011/tiger_loader_2013.sql \
../../extras/tiger_geocoder/tiger_2011/census_loader.sql \
../../extras/tiger_geocoder/tiger_2011/utility/set_search_path.sql \
../../extras/tiger_geocoder/tiger_2011/utility/utmzone.sql \
../../extras/tiger_geocoder/tiger_2011/utility/cull_null.sql \
../../extras/tiger_geocoder/tiger_2011/utility/nullable_levenshtein.sql \
../../extras/tiger_geocoder/tiger_2011/utility/levenshtein_ignore_case.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/end_soundex.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/count_words.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/state_extract.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/get_last_words.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_countysub_exact.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_countysub_fuzzy.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_place_exact.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract_place_fuzzy.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/location_extract.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/normalize_address.sql \
../../extras/tiger_geocoder/tiger_2011/normalize/pprint_addy.sql \
../../extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_tables.sql \
../../extras/tiger_geocoder/tiger_2011/pagc_normalize/pagc_normalize_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/other_helper_functions.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/rate_attributes.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/includes_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/interpolate_from_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_address.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_location.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode_intersection.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/geocode.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/reverse_geocode.sql \
../../extras/tiger_geocoder/tiger_2011/geocode/census_tracts_functions.sql \
../../extras/tiger_geocoder/tiger_2011/topology/tiger_topology_loader.sql \
../postgis_extension_helper.sql \
sql_bits/add_search_path.sql \
../postgis_extension_helper_uninstall.sql
cat $^ > $@
sql_bits/tiger_geocoder.sql: sql_bits/tiger_geocoder.sql.in
sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' -e '/^CREATE SCHEMA/d;' $< > $@
sql_bits/add_search_path.sql: sql_bits/add_search_path.sql.in
cp $< $@
../../doc/tiger_geocoder_comments.sql:
$(MAKE) -C ../../doc comments
sql_bits/tiger_geocoder_comments.sql: ../../doc/tiger_geocoder_comments.sql
cp $< $@
#grep all lines that start with CREATE OR REPLACE FUNCTION, TRIGGER...
#then replace CREATE OR REPLACE .. with ALTER EXTENSION..;
#then remove default values and extra junk
# sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../tiger_geocoder/tiger_geocoder.sql
# sed -e '/^CREATE \(OR REPLACE\|TYPE\|TABLE\|VIEW\|CAST\)/!d;' \
# -e 's/OR REPLACE//g' \
# -e 's/CREATE\(.*\)/ALTER EXTENSION $(EXTENSION) ADD\1;/' \
# -e 's/DEFAULT [\.0-9a-zA-Z]\+//g' \
# -e 's/\(BEFORE\|WITH FUNCTION\)\(.*\)/;/' \
# -e 's/[ \t]+;/;/' \
# -e 's/(;/;/' \
# -e 's/\\(;/;/' \
# -e 's/;;/;/g' $< > $@
#hardcode for now using
#the extensions/make_unpackaged.sql script form an install
sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/tiger_geocoder--unpackaged.sql.in
mkdir -p sql
cp $< $@
#upgrade script should have everything but table, schema, type creation/alter
#NOTE: we assume all object definitions end in ;
#first expression deletes all non-removable objects defined on same line
#second deletes all non-removable defined on multiple lines
# the end of the body of object we assume ends in ;
#aggregates are special
#they can be dropped but we need to remove
#them from the extension first
sql/tiger_geocoder_upgrade_minor.sql: sql_bits/tiger_geocoder_minor.sql.in
mkdir -p sql
sed -e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\).*;/d' \
-e '/^\(CREATE\|ALTER\) \(CAST\|TYPE\|TABLE\|SCHEMA\|DOMAIN\|TRIGGER\)/,/\;/d' \
-e 's/BEGIN;//g' -e 's/COMMIT;//g' \
$< > $@
sql_minor_upgrade: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql/tiger_geocoder_upgrade_minor.sql sql_bits/mark_editable_