ports/80223: [maintainer update] Postgis upgrade from 1.0.0-RC5 to 1.0.0

Anderson S.Ferreira anderson at cnpm.embrapa.br
Thu Apr 21 21:01:01 UTC 2005


>Number:         80223
>Category:       ports
>Synopsis:       [maintainer update] Postgis upgrade from 1.0.0-RC5 to 1.0.0
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 21 21:00:47 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Anderson S. Ferreira
>Release:        FreeBSD 5.4-PRERELEASE i386
>Organization:
Embrapa Monitoramento por Satélite
>Environment:
System: FreeBSD ipe.cnpm.embrapa.br 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #16: Thu Mar 31 09:32:42 BRT 2005 root at ipe.cnpm.embrapa.br:/usr/src/sys/i386/compile/IPE i386

>Description:

After a long series of release candidates, the much anticipated 1.0.0 version of PostGIS has been released. 
The 1.0.0 version includes substantial changes over the original 0.X series, most importantly a new on-disk
format which is both more compact and faster to access. The 1.0.0 version is compatible with PostgreSQL 7.2
and higher, but is most tighhtly integrated with the PostgreSQL 8.0 and higher releases.

New features in 1.0.0 include:

    * Smaller and faster on-disk formats
    * Improved selectivity estimates, including support for join selectivity and sub-selects
    * Hex-based canonical format, for driftless dump and restore
    * 4-D geometries
    * New functions:
          o Polygonize
          o AsGML
          o ForceRHR
          o SnapToGrid
          o Geometry Constructors 
    * Improved JDBC interface with jdbc2 support
    * 64-bit platform support
    * Performance improvements for common boolean operators 

>How-To-Repeat:
	
>Fix:

	

--- postgis.patch begins here ---
diff -ruN postgis/Makefile postgis.new/Makefile
--- postgis.old/Makefile	Wed Apr 13 07:34:51 2005
+++ postgis/Makefile	Thu Apr 21 17:45:53 2005
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	postgis
-DISTVERSION=	1.0.0-rc5
+DISTVERSION=	1.0.0
 CATEGORIES=	databases
 MASTER_SITES=	http://postgis.refractions.net/
 
@@ -19,7 +19,6 @@
 USE_BISON=	yes
 USE_PERL5_BUILD=	yes
 
-PKGMESSAGE=	pkg-message
 PGSQL_SRC=	${WRKDIR}/pgsql/postgresql
 
 INSTALL_TARGET=	install
@@ -41,6 +40,8 @@
 
 PGSQL_PORTDIR=	${PORTSDIR}/databases/postgresql${PGSQL_VER}-server
 
+MAN1=		pgsql2shp.1 shp2pgsql.1
+
 .if !defined(NOPORTDOCS)
 BUILD_DEPENDS+=	xsltproc:${PORTSDIR}/textproc/libxslt \
 		${LOCALBASE}/share/xsl/docbook/html/chunk.xsl:${PORTSDIR}/textproc/docbook-xsl
@@ -73,7 +74,6 @@
 post-install:
 	@ ${SETENV} PKG_PREFIX=${PREFIX} \
 		${SH} ${PKGINSTALL} ${PORTNAME} POST-INSTALL
-	@ ${CAT} ${PKGMESSAGE}
 
 post-deinstall:
 	@ ${SETENV} PKG_PREFIX=${PREFIX} \
diff -ruN postgis/distinfo postgis.new/distinfo
--- postgis/distinfo	Wed Apr 13 07:34:51 2005
+++ postgis.new/distinfo	Thu Apr 21 16:41:03 2005
@@ -1,2 +1,2 @@
-MD5 (postgis-1.0.0-rc5.tar.gz) = 6918a4c11ca70ab5685effd0f39b3ecf
-SIZE (postgis-1.0.0-rc5.tar.gz) = 1372632
+MD5 (postgis-1.0.0.tar.gz) = 15a5f625a7ebe2cbc66db51881d78d08
+SIZE (postgis-1.0.0.tar.gz) = 1383594
diff -ruN postgis/files/README.postgis postgis.new/files/README.postgis
--- postgis/files/README.postgis	Wed Dec 31 21:00:00 1969
+++ postgis.new/files/README.postgis	Thu Apr 21 17:38:20 2005
@@ -0,0 +1,214 @@
+PostGIS - Geographic Information Systems Extensions to PostgreSQL
+~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+VERSION: 1.0.0 (2005/01/13)
+
+MORE INFORMATION: http://postgis.refractions.net
+
+INTRODUCTION:
+This distribution contains a module which implements GIS simple 
+features, ties the features to rtree indexing, and provides some 
+spatial functions for accessing and analyzing geographic data.
+
+Directory structure:
+
+  ./          Build scripts and install directions.
+  ./lwgeom    Library source code.
+  ./jdbc      Extensions to the PostgreSQL JDBC drivers to support
+              the GIS objects. 
+  ./doc       Documentation on the code, objects and functions 
+              provided. 
+  ./loader    A program to convert ESRI Shape files into SQL text
+              suitable for uploading into a PostGIS/PostgreSQL database
+              and a program for converting PostGIS spatial tables into
+              Shape files..
+  ./examples  Small programs which demonstrate ways of accessing 
+              GIS data.
+	        
+
+INSTALLATION:
+
+PostGIS is compatible with PostgreSQL 7.2 and above.
+
+To install the module, move this directory to the "contrib" directory of your
+PostgreSQL source installation. Alternately, point PGSQL_SRC at your
+PostgreSQL source tree either in an environment variable or editing 
+Makefile.config.
+
+You *must* have a PostgreSQL source tree, and you *must* have succesfully
+built and installed it for this to work. 
+
+SEE THE NOTE ON GEOS SUPPORT BELOW FOR SPECIAL COMPILATION INSTRUCTIONS
+
+
+* PROJ4 SUPPORT (Recommended): 
+  The Proj4 reprojection library is required if you want to use the 
+  transform() function to reproject features within the database.
+
+    http://www.remotesensing.org/proj
+
+  Install Proj4 in the default location.
+  Edit the postgis Makefile.config and change the USE_PROJ variable to 1
+  and ensure that the PROJ_DIR variable points to your Proj4 
+  installation location (/usr/local is the default).
+
+* SPATIAL PREDICATE / GEOS SUPPORT (Recommended):
+  The GEOS library provides support for exact topological tests
+  such as Touches(), Contains(), Disjoint() and spatial operations
+  such as Intersection(), Union() and Buffer().  
+
+    http://geos.refractions.net
+
+  In order to use the GEOS support, you *may* need to specially compile 
+  your version of PostgreSQL to link the C++ runtime library.
+  To do this, invoke the PgSQL configuration script this way:
+ 
+  LDFLAGS=-lstdc++ ./configure --your-options-go-here
+
+  The initial LDFLAGS variable is passed through to the Makefile and
+  adds the C++ library to the linking stage. 
+  Once you have compiled PgSQL with C++ support, you can enable GEOS
+  support in PostGIS by setting the USE_GEOS variable in the PostGIS
+  Makefile.config to 1, and ensure that the GEOS_DIR variable points
+  to your GEOS installation location (/usr/local is the default).
+  
+
+To compile PostGIS, as root run:
+	
+  make
+  make install
+
+PostGIS now requires the PL/pgSQL procedural language in order to operate
+correctly. To install PL/pgSQL use the 'createlang' program from the PostgreSQL
+installation. (The PostgreSQL Programmer's Guide has details if you want 
+to this manually for some reason.)
+
+As postgres run:
+
+  createlang plpgsql yourdatabase
+  psql -f lwpostgis.sql -d yourdatabase
+
+Installation should now be complete.
+
+
+UPGRADING:
+
+Upgrading PostGIS can be tricky, because the underlying C libraries which 
+support the object types and geometries may have changed between versions.
+
+For this purpose PostGIS provides an utility script to restore a dump
+produced with the pg_dump -Fc command. It is experimental so redirecting
+its output to a file will help in case of problems. The procedure is
+as follow:
+
+	# Create a "custom-format" dump of the database you want
+	# to upgrade (let's call it "olddb")
+	$ pg_dump -Fc olddb olddb.dump
+
+	# Restore the dump contextually upgrading postgis into
+	# a new database. The new database doesn't have to exist.
+	# Let's call it "newdb"
+	$ sh utils/postgis_restore.pl lwpostgis.sql newdb olddb.dump > restore.log
+
+	# Check that all restored dump objects really had to be restored from dump
+	# and do not conflict with the ones defined in lwpostgis.sql
+	$ grep ^KEEPING restore.log | less
+
+	# If upgrading from PostgreSQL < 7.5 to >= 7.5 you might want to 
+	# drop the attrelid, varattnum and stats columns in the geometry_columns
+	# table, which are no-more needed. Keeping them won't hurt.
+	# !!! DROPPING THEM WHEN REALLY NEEDED WILL DO HURT !!!!
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP attrelid"
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP varattnum"
+	$ psql newdb -c "ALTER TABLE geometry_columns DROP stats"
+
+	# spatial_ref_sys table is restore from the dump, to ensure your custom
+	# additions are kept, but the distributed one might contain modification
+	# so you should backup your entries, drop the table and source the new one.
+	# If you did make additions we assume you know how to backup them before
+	# upgrading the table. Replace of it with the new one is done like this:
+	$ psql newdb
+	newdb=> drop table spatial_ref_sys;
+	DROP
+	newdb=> \i spatial_ref_sys.sql
+
+Following is the "old" procedure description. IT SHOULD BE AVOIDED if possible,
+as it will leave in the database many spurious functions. It is kept in this document
+as a "backup" in case postgis_restore.pl won't work for you:
+
+	pg_dump -t "*" -f dumpfile.sql yourdatabase
+	dropdb yourdatabase
+	createdb yourdatabase
+	createlang plpgsql yourdatabase
+	psql -f lwpostgis.sql -d yourdatabase
+	psql -f dumpfile.sql -d yourdatabase
+	vacuumdb -z yourdatabase
+
+
+USAGE:
+
+Try the following example SQL statements to create non-OpenGIS tables and 
+geometries:
+
+  CREATE TABLE geom_test ( gid int4, geom geometry,name varchar(25) );
+  INSERT INTO geom_test ( gid, geom, name ) 
+    VALUES ( 1, 'POLYGON((0 0 0,0 5 0,5 5 0,5 0 0,0 0 0))', '3D Square');
+  INSERT INTO geom_test ( gid, geom, name ) 
+    VALUES ( 2, 'LINESTRING(1 1 1,5 5 5,7 7 5)', '3D Line' );
+  INSERT INTO geom_test ( gid, geom, name )
+    VALUES ( 3, 'MULTIPOINT(3 4,8 9)', '2D Aggregate Point' );
+  SELECT * from geom_test WHERE geom && 'BOX3D(2 2 0,3 3 0)'::box3d;
+
+The following SQL creates proper OpenGIS entries in the SPATIAL_REF_SYS
+and GEOMETRY_COLUMNS tables, and ensures that all geometries are created
+with an SRID.
+
+  INSERT INTO SPATIAL_REF_SYS
+    ( SRID, AUTH_NAME, AUTH_SRID, SRTEXT ) VALUES
+    ( 1, 'EPSG', 4269,
+      'GEOGCS["NAD83",
+        DATUM[
+          "North_American_Datum_1983",
+          SPHEROID[
+          "GRS 1980",
+          6378137,
+          298.257222101
+        ]
+      ],
+      PRIMEM["Greenwich",0],
+      UNIT["degree",0.0174532925199433]]'
+    );
+
+  CREATE TABLE geotest (
+    id INT4,
+    name VARCHAR(32)
+    );
+
+  SELECT AddGeometryColumn('db','geotest','geopoint',1,'POINT',2);
+
+  INSERT INTO geotest (id, name, geopoint)
+    VALUES (1, 'Olympia', GeometryFromText('POINT(-122.90 46.97)',1));
+  INSERT INTO geotest (id, name, geopoint)
+    VALUES (2, 'Renton', GeometryFromText('POINT(-122.22 47.50)',1));
+
+  SELECT name,AsText(geopoint) FROM geotest;
+
+
+Spatial Indexes:
+
+PostgreSQL provides support for GiST spatial indexing. The GiST scheme offers 
+indexing even on large objects, using a system of "lossy" indexing where 
+a large object is proxied by a smaller one in the index.  In the case 
+of the PostGIS indexing system, all objects are proxied in the index by 
+their bounding boxes.
+
+You can build a GiST index with:
+
+  CREATE INDEX <indexname> 
+    ON <tablename> 
+    USING GIST ( <geometryfield> );
+
+Always run the "VACUUM ANALYZE <tablename>" on your tables after
+creating an index. This gathers statistics which the query planner
+uses to optimize index usage.
+
diff -ruN postgis/files/patch-doc postgis.new/files/patch-doc
--- postgis/files/patch-doc	Wed Apr 13 06:08:06 2005
+++ postgis.new/files/patch-doc	Thu Apr 21 17:21:27 2005
@@ -1,5 +1,5 @@
---- doc/Makefile	Fri Mar  4 16:34:47 2005
-+++ doc/Makefile	Mon Mar 21 09:07:57 2005
+--- doc/Makefile	Tue Apr 12 08:17:04 2005
++++ doc/Makefile	Thu Apr 21 17:20:56 2005
 @@ -1,11 +1,14 @@
  COMMONOPTS = -f docbook -b html -e no-valid
  
@@ -13,10 +13,10 @@
  
 -XSLBASE?=/usr/share/sgml/docbook/xsl-stylesheets
 +XSLBASE?=/usr/local/share/xsl/docbook
+ #XSLBASE = /usr/share/xml/docbook/stylesheet/nwalsh
  
  all: html
- 
-@@ -15,14 +18,13 @@
+@@ -16,14 +19,13 @@
  chunked-html: postgis-out.xml
  	xsltproc \
  		--output html/ \
@@ -32,10 +32,12 @@
  
  html/postgis.html: postgis-out.xml
  	xsltproc \
-@@ -66,5 +68,15 @@
+@@ -67,6 +69,15 @@
  maintainer-clean: clean
  	@rm -f html/*.html
  
+-install: html/postgis.html man/shp2pgsql.1 man/pgsql2shp.1
+-
 +install: chunked-html
 +	$(mkinstalldirs) $(DOCSDIR)
 +	$(INSTALL_DATA)	html/index.html $(DOCSDIR)/index.html
@@ -45,6 +47,6 @@
 +	$(INSTALL_DATA)	html/ch04.html $(DOCSDIR)/ch04.html
 +	$(INSTALL_DATA)	html/ch05.html $(DOCSDIR)/ch05.html
 +	$(INSTALL_DATA)	html/ch06.html $(DOCSDIR)/ch06.html
-+	$(INSTALL_DATA)	html/ch07.html $(DOCSDIR)/ch07.html
- 
++	$(INSTALL_DATA)	html/apa.html $(DOCSDIR)/apa.html
++ 
  .PHONY: html 
diff -ruN postgis/files/patch-lwgeom postgis.new/files/patch-lwgeom
--- postgis/files/patch-lwgeom	Wed Apr 13 06:08:06 2005
+++ postgis.new/files/patch-lwgeom	Thu Apr 21 17:09:27 2005
@@ -1,5 +1,5 @@
---- lwgeom/Makefile	Fri Mar 18 09:43:23 2005
-+++ lwgeom/Makefile	Mon Mar 21 08:58:26 2005
+--- lwgeom/Makefile	Mon Apr  4 06:48:57 2005
++++ lwgeom/Makefile	Thu Apr 21 17:08:37 2005
 @@ -21,10 +21,10 @@
  
  ifeq (${USE_VERSION},71) 
@@ -23,10 +23,10 @@
 +	$(INSTALL_DATA) lwpostgis.sql $(DESTDIR)$(DATADIR)/lwpostgis.sql.default
 +	$(INSTALL_DATA) ../spatial_ref_sys.sql $(DESTDIR)$(DATADIR)/spatial_ref_sys.sql
 +	$(INSTALL_DATA) ../README.postgis $(DESTDIR)$(DATADIR)/README.postgis
+ 	$(INSTALL_DATA) ../doc/man/pgsql2shp.1 $(DESTDIR)$(mandir)/man1/pgsql2shp.1
+ 	$(INSTALL_DATA) ../doc/man/shp2pgsql.1 $(DESTDIR)$(mandir)/man1/shp2pgsql.1
  
- #- This has been copied from postgresql and adapted
- install-lwgeom-lib: $(shlib)
-@@ -169,9 +169,9 @@
+@@ -171,9 +171,9 @@
  	sh ../geos_version.sh $(GEOS_DIR) > postgis_geos_version.h
  
  installdirs:
diff -ruN postgis/pkg-install postgis.new/pkg-install
--- postgis/pkg-install	Wed Apr 13 07:34:51 2005
+++ postgis.new/pkg-install	Thu Apr 21 17:40:24 2005
@@ -2,14 +2,15 @@
 
 msg(){
  echo "
-  ================== ** Postgis Upgrade Notice ** ===================
+  ================== ** Postgis Upgrade Notice ** ====================
 
-  If you are a user from a old version of Postgis (0.9.1 or older), 
-  make a backup from your databases before continue !
+  If you are a user from old versions of Postgis (1.0.0-RC5 or older), 
+  stop now and read the README.postgis file located in port´s files 
+  directory to know how to make a dump from your databases !
 
   If you need to backup your data, press CTRL-C now !
 
-  ======================= GEOS Support Notice =======================
+  ======================= GEOS Support Notice ========================
   In order to use the GEOS support, you may need to specially compile
   your version of PostgreSQL to link the C++ runtime library.
   To do this, invoke the PostgreSQL Makefile script this way:
@@ -27,7 +28,7 @@
   The initial LDFLAGS variable is passed through to the Makefile and
   adds the C++ library to the linking stage.
 
-  ===================================================================
+  ====================================================================
 "
 sleep 10
 
diff -ruN postgis/pkg-message postgis.new/pkg-message
--- postgis/pkg-message	Wed Apr 13 07:34:51 2005
+++ postgis.new/pkg-message	Wed Dec 31 21:00:00 1969
@@ -1,9 +0,0 @@
-=============================================================
-
-Postgis Installation note
-
-* The name of the postgis library has changed.
-  Users from older versions (0.9.1 or older), *must* read 
-  PREFIX/share/postgis/README.postgis for instructions.
-
-=============================================================
--- postgis.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list