[SCM] shapelib branch, master, updated. upstream/1.2.10-16-g9df21f8

Arto Jantunen viiru at debian.org
Tue May 8 17:45:47 UTC 2012


The following commit has been merged in the master branch:
commit 05126c00f76246ad18b8bb0259d95278ec7d1411
Author: Arto Jantunen <viiru at debian.org>
Date:   Mon May 7 13:08:35 2012 +0300

    Convert to source-format 3.0 (quilt)

diff --git a/Makefile b/Makefile
index 3dd053e..6d24091 100644
--- a/Makefile
+++ b/Makefile
@@ -113,18 +113,18 @@ lib:
 	gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC dbfopen.c -o .libs/dbfopen.lo
 	gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c -o dbfopen.o >/dev/null 2>&1
 	mv -f .libs/dbfopen.lo dbfopen.lo
-	/bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath /usr/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo  
-#	rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
-#	rm -fr .libs/libshp.lax
-#	mkdir .libs/libshp.lax
-#	/usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  shpopen.lo shptree.lo dbfopen.lo  -lc
-#
-#	(cd .libs && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1)
-#	(cd .libs && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so)
-#	ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o 
-#	ranlib .libs/libshp.a
-#	rm -fr .libs/libshp.lax
-#	(cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)
+	/bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath /usr/local/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo  
+	rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
+	rm -fr .libs/libshp.lax
+	mkdir .libs/libshp.lax
+	/usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  shpopen.lo shptree.lo dbfopen.lo  -lc
+
+	(cd .libs && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1)
+	(cd .libs && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so)
+	ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o 
+	ranlib .libs/libshp.a
+	rm -fr .libs/libshp.lax
+	(cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)
 
 lib_install:
 	cp .libs/libshp.la .libs/libshp.lai
diff --git a/contrib/Makefile b/contrib/Makefile
index 60ff7ae..ab0ab13 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -9,7 +9,7 @@ CFLAGS	=	-g -I.. -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2
 
 SHPOBJ	=	../shpopen.o ../dbfopen.o 
 
-SHPGOBJ =	../shpopen.o ../dbfopen.o  shpgeo.o
+SHPGOBJ =	../shpopen.o ../dbfopen.o shpgeo.o
 
 GEOOBJ	=	./shpgeo.o -lm -lproj
 
diff --git a/contrib/shpgeo.h b/contrib/shpgeo.h
index 4210d04..02276b1 100644
--- a/contrib/shpgeo.h
+++ b/contrib/shpgeo.h
@@ -67,7 +67,7 @@
 extern "C" {
 #endif
 
-## #include "proj_api.h"
+#include "proj_api.h"
 
 
 #define		SHPD_POINT	 		1
diff --git a/dbfopen.c b/dbfopen.c
index 178ae18..43b25ac 100644
--- a/dbfopen.c
+++ b/dbfopen.c
@@ -197,6 +197,8 @@ static char rcsid[] =
 #  define TRUE		1
 #endif
 
+static int	nStringFieldLen = 0;
+static char * pszStringField = NULL;
 
 /************************************************************************/
 /*                             SfRealloc()                              */
@@ -429,12 +431,6 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
 	      psDBF->panFieldOffset[iField-1] + psDBF->panFieldSize[iField-1];
     }
 
-/* -------------------------------------------------------------------- */
-/*  Initialize our temporary input fields.                              */
-/* -------------------------------------------------------------------- */
-    psDBF->nStringFieldLen = 0;
-    psDBF->pszStringField = NULL;
-
     return( psDBF );
 }
 
@@ -493,12 +489,14 @@ DBFClose(DBFHandle psDBF)
     free( psDBF->pszHeader );
     free( psDBF->pszCurrentRecord );
 
-    if( psDBF->pszStringField != NULL )
+    free( psDBF );
+
+    if( pszStringField != NULL )
     {
-        free( psDBF->pszStringField );
+        free( pszStringField );
+        pszStringField = NULL;
+        nStringFieldLen = 0;
     }
-
-    free( psDBF );
 }
 
 /************************************************************************/
@@ -573,12 +571,6 @@ DBFCreate( const char * pszFilename )
 
     psDBF->bNoHeader = TRUE;
 
-/* --------------------------------------------------------------------*/
-/*  Initialize our temporary input fields.*/
-/* --------------------------------------------------------------------*/
-    psDBF->nStringFieldLen = 0;
-    psDBF->pszStringField = NULL;
-
     return( psDBF );
 }
 
@@ -699,6 +691,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
     unsigned char	*pabyRec;
     void	*pReturnField = NULL;
 
+    static double dDoubleField;
 
 /* -------------------------------------------------------------------- */
 /*      Verify selection.                                               */
@@ -741,31 +734,30 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
 /* -------------------------------------------------------------------- */
 /*	Ensure our field buffer is large enough to hold this buffer.	*/
 /* -------------------------------------------------------------------- */
-    if( psDBF->panFieldSize[iField]+1 > psDBF->nStringFieldLen )
+    if( psDBF->panFieldSize[iField]+1 > nStringFieldLen )
     {
-	psDBF->nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10;
-	psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField,
-						   psDBF->nStringFieldLen);
+	nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10;
+	pszStringField = (char *) SfRealloc(pszStringField,nStringFieldLen);
     }
 
 /* -------------------------------------------------------------------- */
 /*	Extract the requested field.					*/
 /* -------------------------------------------------------------------- */
-    strncpy( psDBF->pszStringField, 
+    strncpy( pszStringField, 
 	     ((const char *) pabyRec) + psDBF->panFieldOffset[iField],
 	     psDBF->panFieldSize[iField] );
-    psDBF->pszStringField[psDBF->panFieldSize[iField]] = '\0';
+    pszStringField[psDBF->panFieldSize[iField]] = '\0';
 
-    pReturnField = psDBF->pszStringField;
+    pReturnField = pszStringField;
 
 /* -------------------------------------------------------------------- */
 /*      Decode the field.                                               */
 /* -------------------------------------------------------------------- */
     if( chReqType == 'N' )
     {
-	psDBF->dDoubleField = atof(psDBF->pszStringField);
+        dDoubleField = atof(pszStringField);
 
-	pReturnField = &psDBF->dDoubleField;
+	pReturnField = &dDoubleField;
     }
 
 /* -------------------------------------------------------------------- */
@@ -776,7 +768,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
     {
         char	*pchSrc, *pchDst;
 
-        pchDst = pchSrc = psDBF->pszStringField;
+        pchDst = pchSrc = pszStringField;
         while( *pchSrc == ' ' )
             pchSrc++;
 
@@ -784,7 +776,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
             *(pchDst++) = *(pchSrc++);
         *pchDst = '\0';
 
-        while( pchDst != psDBF->pszStringField && *(--pchDst) == ' ' )
+        while( pchDst != pszStringField && *(--pchDst) == ' ' )
             *pchDst = '\0';
     }
 #endif
@@ -1359,6 +1351,9 @@ DBFReadTuple(DBFHandle psDBF, int hEntity )
 {
     int	       	nRecordOffset;
     unsigned char	*pabyRec;
+    static char	*pReturnTuple = NULL;
+
+    static int	nTupleLen = 0;
 
 /* -------------------------------------------------------------------- */
 /*	Have we read the record?					*/
@@ -1380,15 +1375,14 @@ DBFReadTuple(DBFHandle psDBF, int hEntity )
 
     pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
 
-    if ( psDBF->nStringFieldLen < psDBF->nRecordLength) {
-      psDBF->nStringFieldLen = psDBF->nRecordLength;
-      psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField,
-						 psDBF->nRecordLength);
+    if ( nTupleLen < psDBF->nRecordLength) {
+      nTupleLen = psDBF->nRecordLength;
+      pReturnTuple = (char *) SfRealloc(pReturnTuple, psDBF->nRecordLength);
     }
     
-    memcpy ( psDBF->pszStringField, pabyRec, psDBF->nRecordLength );
+    memcpy ( pReturnTuple, pabyRec, psDBF->nRecordLength );
         
-    return( psDBF->pszStringField );
+    return( pReturnTuple );
 }
 
 /************************************************************************/
diff --git a/debian/patches/0001-Disable-proj_api.h-include.patch b/debian/patches/0001-Disable-proj_api.h-include.patch
new file mode 100644
index 0000000..02ef2bf
--- /dev/null
+++ b/debian/patches/0001-Disable-proj_api.h-include.patch
@@ -0,0 +1,25 @@
+From: Author unknown
+Date: Unknown
+Subject: [PATCH] Disable proj_api.h include
+
+This patch was included in the monolithic patch which existed before the
+split, the author is most likely Noel Köthe <noel at debian.org>.
+
+---
+ contrib/shpgeo.h |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/contrib/shpgeo.h b/contrib/shpgeo.h
+index 02276b1..4210d04 100644
+--- a/contrib/shpgeo.h
++++ b/contrib/shpgeo.h
+@@ -67,7 +67,7 @@
+ extern "C" {
+ #endif
+ 
+-#include "proj_api.h"
++## #include "proj_api.h"
+ 
+ 
+ #define		SHPD_POINT	 		1
+-- 
diff --git a/debian/patches/0002-Add-manpages.patch b/debian/patches/0002-Add-manpages.patch
new file mode 100644
index 0000000..352beb4
--- /dev/null
+++ b/debian/patches/0002-Add-manpages.patch
@@ -0,0 +1,1003 @@
+From: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
+Date: Fri, 8 Apr 2005 10:51:19 +0200
+Subject: [PATCH] Add manpages
+
+Debian-bug: http://bugs.debian.org/148037
+---
+ man/Makefile    |   16 +++
+ man/dbfadd.1    |   61 +++++++++++
+ man/dbfcreate.1 |   88 +++++++++++++++
+ man/dbfdump.1   |  111 +++++++++++++++++++
+ man/shpadd.1    |   85 +++++++++++++++
+ man/shpcreate.1 |   68 ++++++++++++
+ man/shpdump.1   |  316 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ man/shprewind.1 |   88 +++++++++++++++
+ man/shptest.1   |   89 ++++++++++++++++
+ 9 files changed, 922 insertions(+), 0 deletions(-)
+ create mode 100644 man/Makefile
+ create mode 100644 man/dbfadd.1
+ create mode 100644 man/dbfcreate.1
+ create mode 100644 man/dbfdump.1
+ create mode 100644 man/shpadd.1
+ create mode 100644 man/shpcreate.1
+ create mode 100644 man/shpdump.1
+ create mode 100644 man/shprewind.1
+ create mode 100644 man/shptest.1
+
+diff --git a/man/Makefile b/man/Makefile
+new file mode 100644
+index 0000000..1bf4918
+--- /dev/null
++++ b/man/Makefile
+@@ -0,0 +1,16 @@
++SOURCES=dbfdump.1 dbfcreate.1 dbfadd.1 shpdump.1 shpadd.1 shpcreate.1 shprewind.1 shptest.1
++TARGETS=$(addsuffix .cat, $(SOURCES)) $(addsuffix .ps, $(SOURCES)) $(addsuffix .html, $(SOURCES))
++
++%.1.cat: %.1
++	groff -man -Tascii $^ >$@
++
++%.1.ps: %.1
++	groff -man -Tps $^ >$@
++
++%.1.html: %.1
++	man2html $^ >$@
++
++all:	$(TARGETS)
++
++clean:
++	$(RM) *.1.cat *.1.ps *.1.html *~ 
+diff --git a/man/dbfadd.1 b/man/dbfadd.1
+new file mode 100644
+index 0000000..fea9a8a
+--- /dev/null
++++ b/man/dbfadd.1
+@@ -0,0 +1,61 @@
++.\" Process this file with
++.\" groff -man -Tascii dbfadd.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++dbfadd \- add a row to an xBase DBF file
++.SH SYNOPSIS
++.B dbfadd
++.I filename fieldvalues...
++.SH DESCRIPTION
++Adds a row to the DBF file named by
++.I filename
++with column values given by the
++.I fieldvalues
++options that follow.  A
++.B NULL
++value is denoted by an empty argument.
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I filename
++or 
++.I fieldvalues
++arguments.
++.TP
++.B 2
++Failed to open
++.I filename
++for reading and appending.
++.TP
++.B 3
++Too few values in
++.I fieldvalues...
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI DBFOpen( filename ",""rb+"") failed."
++.TP
++.RI Got\  count1 " fields, but require " count2 
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.
++Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote this man page.
++.SH BUGS
++Field values that are too large to fit in a field are silently
++truncated from the right. Numeric field values that can't be parsed by
++.BR atof (3)
++get undefined values.
++.SH "SEE ALSO"
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpadd (1),
++.BR shpcreate (1),
++.BR shpdump (1),
++.BR shprewind (1)
+diff --git a/man/dbfcreate.1 b/man/dbfcreate.1
+new file mode 100644
+index 0000000..58436e5
+--- /dev/null
++++ b/man/dbfcreate.1
+@@ -0,0 +1,88 @@
++.\" Process this file with
++.\" groff -man -Tascii dbfcreate.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++dbfcreate \- Create an empty xBase DBF file
++.SH SYNOPSIS
++.B dbfcreate
++.IR "filename" "[[\-s " "fieldname width" "] | [\-n " "fieldname width decimals" ]] ...
++.SH DESCRIPTION
++Creates an empty DBF file called
++.I filename
++with columns described by all the
++.B \-s
++and
++.B \-n
++options that follow.
++.SH OPTIONS
++.TP
++.BI "\-s " "fieldname width"
++adds a column named
++.I fieldname
++taking textual values of at most
++.I width
++characters.
++.TP
++.BI \-n\  fieldname\ width\ decimals
++adds a column named
++.I fieldname
++taking numeric values of at most
++.I width
++digits and precision of at most
++.I decimals
++decimal places.  The number of digits of precision should be included in
++.IR width .
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I filename
++argument.
++.TP
++.B 2
++Failed to create the file
++.I filename
++for writing.
++.TP
++.B 3
++Missing 
++.IR fieldname , width ", or " decimals
++argument for a
++.B \-s
++or
++.B \-n
++option.
++.TP
++.B 4
++Failed to add a column given by a
++.B \-s
++or
++.B \-n
++option.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI DBFCreate( filename ") failed."
++.TP
++.RI DBFAddField( fieldname ",FTString," width ",0) failed."
++.TP
++.RI DBFAddField( fieldname ",FTDouble," width "," decimals ") failed."
++.TP
++.RI "Argument incomplete, or unrecognised: " arg
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.
++Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote this man page.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpadd (1),
++.BR shpcreate (1),
++.BR shpdump (1),
++.BR shprewind (1)
+diff --git a/man/dbfdump.1 b/man/dbfdump.1
+new file mode 100644
+index 0000000..e7a8574
+--- /dev/null
++++ b/man/dbfdump.1
+@@ -0,0 +1,111 @@
++.\" Process this file with
++.\" groff -man -Tascii dbfdump.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++dbfdump \- dump xBase DBF files as text
++.SH SYNOPSIS
++.B dbfdump [\-h] [\-m] [\-r]
++.I file
++.SH DESCRIPTION
++Dumps the contents of
++.I file
++to standard output.  The first line contains the field names appearing
++in
++.I file,
++and each of the following lines contains the field values of a
++record.  Field names and values are padded by spaces to their field
++widths.  Empty fields are printed as the string "(NULL)".
++.SH OPTIONS
++.TP
++.B \-h
++Prints the column field definitions before other output.  Each field
++definition consists of a line of the form
++
++.RI "Field: " index ", Type=" type ", Title=`" "name" "', Width=" "width" ", Decimals=" precision
++
++where
++.I index
++is the zero offset column number of the field; the
++.I type
++indicates the datatype of the field value and is either "Integer",
++"Real" or "String"; 
++.I name
++is the field's name;
++.I width
++is the number of bytes reserved for the field's value; and
++.I precision
++is the number of decimal places of precision for "Real" type
++fields, and is zero for "Integer" and "String" type fields.
++.TP
++.B \-m
++Prints each record in multiline format separated by empty lines.
++The first line of a record gives the number of the record in the form
++
++Records:
++.I record_index
++
++where
++.I record_index
++is the zero offset number of the record in the file, and
++then each field of the record appears on its own line in the format
++
++.IR name :
++.I value
++
++.TP
++.B \-r
++Prints the exact bytes occurring in
++.I file
++for field values and suppresses printing "(NULL)" for
++empty values.
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I file
++argument.
++.TP
++.B 2
++Failed to open
++.I file.
++.TP
++.B 3
++There are no fields in
++.I file.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI DBFOpen( file ",""r"") failed."
++.TP
++There are no fields in this table!
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH BUGS
++Unless the
++.B \-r
++option is given, values in numeric fields that overflow the
++.B int
++or 
++.B double
++types of the 
++.B C
++language are printed as plus or minus a huge number.  For integer
++fields the huge value is
++.B HUGE_VALL
++from <stdlib.h> and for real fields it is
++.BR HUGE_VALF .
++.SH "SEE ALSO"
++.BR dbf_dump (1),
++.BR dbfcreate (1),
++.BR dbfadd (1),
++.BR shpadd (1),
++.BR shpcreate (1),
++.BR shpdump (1),
++.BR shprewind (1)
+diff --git a/man/shpadd.1 b/man/shpadd.1
+new file mode 100644
+index 0000000..f57576a
+--- /dev/null
++++ b/man/shpadd.1
+@@ -0,0 +1,85 @@
++.\" Process this file with
++.\" groff -man -Tascii shpadd.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++shpadd \- append a shape to an ESRI shapefile
++.SH SYNOPSIS
++.B shpadd
++.I file
++.RI "[[" "x y" "] [+]]*"
++.SH DESCRIPTION
++Appends a shape to the shapefile determined from
++.IR file .
++The geometric data of the new shape consists of lists of 
++.I X/Y 
++points on the command line grouped into 
++.IR parts ,
++with points in different parts separated by a plus
++.RB ( + )
++sign.  If no points or parts are given then a shape of type
++.B NullShape
++is appended to the shapefile, and otherwise the type of the new shape
++is determined by the shapefile's header.  See
++.BR shpdump (1)
++for a description of shape types and how geometric data for parts are
++interpreted for a specific type.  No geometric restrictions set by the
++shapefile specification are enforced by
++.BR shpadd (1).
++
++Shapefiles actually consist of two files with the same basename and
++extensions
++.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
++containing the shape data and shape index respectively.  The files
++to open are determined by first stripping any filename extension
++from
++.I file 
++and attempting to open the files
++.IB file .shp
++or 
++.IB file .SHP,
++and
++.IB file .shx
++or
++.IB file .SHX
++for the respective data and index files.
++
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I file
++argument, the shapefile can't be opened, or the program
++ran out of memory.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI "Unable to open:" file
++.TP
++.RI "Out of memory"
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH BUGS
++Coordinate values that can't be
++be parsed by 
++.BR sscanf (3)
++get undefined values.  There's no way to give measure or
++.I Z
++data to vertices in a shape, but those are always set to zero
++if the shapefile's shape type requires those values.
++.B MultiPatch
++shape types aren't supported.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpcreate (1),
++.BR shpdump (1),
++.BR shprewind (1)
+diff --git a/man/shpcreate.1 b/man/shpcreate.1
+new file mode 100644
+index 0000000..4fa69a8
+--- /dev/null
++++ b/man/shpcreate.1
+@@ -0,0 +1,68 @@
++.\" Process this file with
++.\" groff -man -Tascii shpcreate.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++shpcreate \- create an empty ESRI shapefile
++.SH SYNOPSIS
++.B shpcreate
++.I file shapetype
++.SH DESCRIPTION
++Creates an empty shapefile supporting shapes of the given type
++.IR shapetype .
++Shapefiles actually consist of two files with the same basename and
++extensions
++.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
++containing the shape data and shape index respectively.  The files
++to create are determined by first stripping any filename extension
++from
++.I file 
++and attempting to create the files
++.IB file .shp
++or 
++.IB file .SHP,
++and
++.IB file .shx
++or
++.IB file .SHX
++for the respective data and index files.  The supported values for the
++.I shapetype
++argument are:
++.BR point ", " arc ", " polygon ", and " multipoint .
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I file
++or 
++.I shapetype
++argument.
++.TP
++.B 2
++Unknown 
++.IR shapetype .
++.TP
++.B 3
++Unable to create the shapefile.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI "Shape Type `" shapetype "' not recognised."
++.TP
++.RI "Unable to create:" file
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpadd (1),
++.BR shpdump (1),
++.BR shprewind (1)
+diff --git a/man/shpdump.1 b/man/shpdump.1
+new file mode 100644
+index 0000000..455d702
+--- /dev/null
++++ b/man/shpdump.1
+@@ -0,0 +1,316 @@
++.\" Process this file with
++.\" groff -man -Tascii shpdump.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++shpdump \- dump an ESRI shapefile as text
++.SH SYNOPSIS
++.B shpdump [\-validate]
++.I file
++.SH DESCRIPTION
++Prints the contents of the shapefile
++.I file
++to standard output in textual format.  Shapefiles actually consist
++of two files with the same basename and extensions
++.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
++containing the shape data and shape index respectively.  The files
++to open are determined by first stripping any filename extension
++from
++.I file 
++and attempting to open the files
++.IB file .shp
++or 
++.IB file .SHP,
++and
++.IB file .shx
++or
++.IB file .SHX
++for the respective data and index files.
++
++Output consists of a header giving number and type of shapes in the
++file and the bounds for the minimum and maximum
++.IR X ,\  Y ,\  Z ", and " M  
++values appearing in the shapes.  The header is followed by the
++geometric data for each shape in the file.  All shapes in the file
++should be of the same type, except that
++.B NullShape
++typed shapes may be intermixed with any other type.  The header has
++the form
++.RS
++
++Shapefile Type:
++.I type
++# of Shapes:
++.I count
++
++File Bounds:
++.RI ( minX , minY , minZ , minM )
++         to\  
++.RI ( maxX , maxY , maxZ , maxM )
++
++.RE
++See section
++.B SHAPE TYPES
++below for the list of possible shape types.
++
++Next for each shape in the file a header giving 
++it's
++.IR shape_index ,
++it's type
++.IR type ,
++number of vertices
++.IR nVertices ,
++number of parts
++.IR nParts ,
++and bounding box is given, followed by the vertex data of each part.
++.RS
++
++Shape:\ 
++.IR shape_index \ ( type )\ nVertices= nVertices ,\ nParts= nParts
++  Bounds:
++.RI ( minX , minY , minZ , minM )
++      to\  
++.RI ( maxX , maxY , maxZ , maxM )
++
++.RI "  " "vertices of the first part"
++
++.RI "+ " "vertices of the second part..."
++
++.RI "+ " "vertices of the last part"
++
++.RE
++The
++.I shape_index
++of a shape is the number of the shape starting from zero in the shape
++file.  Each vertex has the form
++.RS
++
++.RI ( X , Y , Z , M )
++
++.RE
++If there are multiple parts then the type of the part is appended
++appended to first vertex of each part, and the first vertex of the
++second and following parts is preceded by a plus
++.RB ( + )
++sign.  The part type is
++.B Ring
++for all shape types except
++.B MultiPatch
++where it is the type of a surface patch.  See below for the description
++of possible part types.
++.SH SHAPE TYPES
++Each type of shape except
++.B MultiPatch
++typed shapes comes in three flavours: The normal unsuffixed type, where
++points lie in
++.IR X/Y -space;
++a type with suffix
++.B M
++where points lie in 
++.IR X/Y -space
++and additionally have a
++.I measure
++value in
++.IR M -space;
++and finally a type with suffix
++.B Z
++where points lie in
++.IR X/Y/Z -space
++and also have a measure value in
++.IR M -space.
++.\"
++.TP
++.B NullShape
++A shape without data.  Shapes of this type may be intermixed with
++other shapes and are sometimes used to represented deleted or missing
++geometric data for a shape.
++.\"
++.TP
++.B Point " or " PointZ " or " PointM
++A single point.
++.\"
++.TP
++.BR Arc " or " ArcZ " or " ArcM
++Piecewise linear paths.  Shapes of this type may consist of multiple
++parts which may or may not intersect and/or connect.  Arcs are called
++.BR PolyLine s
++in the shapefile specification.
++.\"
++.TP
++.BR Polygon " or " PolygonZ " or " PolygonM
++Polygon shapes consist of one or more parts, called 
++.IR rings ,
++that each define a closed path.  Rings must contain at least four
++vertices with the first and last vertices being equal, and must not
++self-intersect.  For shapes of type
++.BR Polygon ,
++the rings define a polygon with optional holes by giving the vertices
++of inner rings a counterclockwise orientation and the vertices of
++outer rings a clockwise orientation.  Intersection and orientation
++is always computed in
++.IR X/Y -space
++and never in
++.IR X/Y/M -space.
++.\"
++.TP
++.BR MultiPoint " or " MultiPointZ " or " MultiPointM
++A set of points.
++.\"
++.TP
++.BR MultiPatch
++A
++.B MultiPatch
++represents one or more surfaces in
++.IR X/Y/Z -space,
++and consists of a number of parts called it's
++.IR "surface patches" .
++Each surface patch describes a either a surface or a hole in another
++surface, depending on the type of the patch.  Patches may share a
++common boundary but may not otherwise intersect.  The type of a patch
++may be one of
++.RS
++.TP
++.B TriangleStrip
++A set of connected triangles.  The first three points
++define the first triangle and every following point defines
++a new triangle using the new point and the two previous points.
++.TP
++.B TriangleFan
++A set of connected triangles.  The first three points define the first
++triangle and every following point defines a new triangle using the
++previous point, the current point, and the first point, thus forming a
++fan of triangles around the first point.
++.TP
++.B OuterRing
++The outer ring of a sequence of rings defining a polygon with holes.
++All following parts of type
++.B InnerRing
++are taken to be the holes of the polygon.  The sequence of rings
++ends with the first
++.RB non- InnerRing
++typed part or the part of the shape, whichever comes first.
++.TP
++.B InnerRing
++An inner ring in a sequence of rings defining a polygon with holes.
++This type of part may only follow an
++.B OuterRing
++or other
++.B InnerRing
++typed parts.
++.TP
++.B FirstRing
++The first in a sequence of rings defining a polygon of
++unspecified type.  The following parts of type
++.B Ring
++defines the other rings in the polygon.  This type of part is used when
++the innerness or outerness of a polygon isn't known or applicable.  The sequence of rings
++defining the polygon ends with the first
++.BR non- Ring
++typed part or the last part of the shape, whichever comes first.
++.TP
++.B Ring
++A ring in a sequence of rings defining a polygon of unspecified type.
++It may only follow a
++.B FirstRing
++or other
++.B Ring
++typed parts.
++.TP
++.B UknownPartType
++This type is returned for parts whose type isn't recognised.
++.RE
++.\"
++.TP
++.B UnknownShapeType
++This type is returned for shapes whose type isn't recognised.
++.SH OPTIONS
++.TP
++.B \-validate
++Performs validation on the orientation of inner and outer rings in
++.BR Polygon ", " PolygonZ ", and " PolygonM
++objects.  According to the shapefile specification outer rings should
++be given a clockwise orientation, and inner rings that define holes a
++counterclockwise orientation.  If some rings of a shape are oriented
++the wrong way around then the following message is output after
++dumping that shape:
++
++.IR  count " rings wound in the wrong direction."
++
++In addition the total number of shapes with problem rings is output
++after the last shape has been dumped:
++
++.IR count " object has invalid ring orderings."
++
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++No shapefile
++.I file
++was given or it couldn't be opened.
++.SH EXAMPLE
++.PP
++.RS
++$ shpdump shapefile.shp
++
++Shapefile Type: Arc   # of Shapes: 3
++
++File Bounds: ( 3531586.750, 7253086.100,0,0)
++         to  ( 3536417.463, 7778375.875,0,0)
++
++Shape:0 (Arc)  nVertices=2, nParts=1
++  Bounds:( 3536397.797, 7253086.100, 0, 0)
++      to ( 3536417.463, 7253163.597, 0, 0)
++     ( 3536397.797, 7253163.597, 0, 0) Ring 
++     ( 3536417.463, 7253086.100, 0, 0)  
++
++Shape:1 (Arc)  nVertices=3, nParts=1
++  Bounds:( 3458966.390, 7373335.808, 0, 0)
++      to ( 3459141.856, 7373474.681, 0, 0)
++     ( 3458966.390, 7373474.681, 0, 0) Ring 
++     ( 3458979.042, 7373466.273, 0, 0)  
++     ( 3459141.856, 7373335.808, 0, 0)  
++
++Shape:2 (Arc)  nVertices=7, nParts=1
++  Bounds:( 3531586.750, 7777880.500, 0, 0)
++      to ( 3532930.206, 7778375.875, 0, 0)
++     ( 3531586.750, 7777880.500, 0, 0) Ring 
++     ( 3532228.265, 7778072.455, 0, 0)  
++     ( 3532310.897, 7778119.445, 0, 0)  
++     ( 3532367.866, 7778144.877, 0, 0)  
++     ( 3532440.559, 7778168.920, 0, 0)  
++     ( 3532506.504, 7778190.785, 0, 0)  
++     ( 3532930.206, 7778375.875, 0, 0)
++
++$ 
++.RE
++.PP
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI "Unable to open:" file
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH BUGS
++The
++.B \-validate
++option supports only one outer ring in a polygonal shape
++and assumes that the first ring in a shape is the outer ring.  It doesn't support
++polygons inside
++.B MultiPatch
++shapes.  The
++.IR X " and " Y 
++coordinates of a point are printed to three decimal places only.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpadd (1),
++.BR shpcreate (1),
++.BR shprewind (1)
+diff --git a/man/shprewind.1 b/man/shprewind.1
+new file mode 100644
+index 0000000..00200f0
+--- /dev/null
++++ b/man/shprewind.1
+@@ -0,0 +1,88 @@
++.\" Process this file with
++.\" groff -man -Tascii shprewind.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++shprewind \- fix polygon ring orientations in ESRI shapefiles
++.SH SYNOPSIS
++.B shprewind
++.I infile outfile
++.SH DESCRIPTION
++Makes a copy of the shapefile
++.I infile
++to 
++.I outfile
++and fixes the orientation of points in the rings of
++.BR Polygon ", " PolygonZ ", and " PolygonM
++typed shapes to conform to the shapefile specification.  According to the
++specification, the vertices of outer rings should be oriented
++clockwise on the
++.I X/Y
++plane, and those of inner rings counterclockwise.
++
++Shapefiles actually consist of two files with the same basename and
++extensions
++.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
++containing the shape data and shape index respectively.  The files
++to open are determined by first stripping any filename extension
++from
++.I infile 
++and attempting to open the files
++.IB infile .shp
++or 
++.IB infile .SHP,
++and
++.IB infile .shx
++or
++.IB infile .SHX
++for the respective data and index files.  The files to create
++from
++.I outfile
++are determined by stripping any filename extension from
++.I outfile
++and appending
++.B .shp
++and
++.B .shx
++suffixes for the respective data and index files.
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing
++.I infile
++or
++.I outfile
++arguments, failed to open shapefile
++.I infile
++or create shapefile
++.IR outfile.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI "Unable to open:" infile
++.TP
++.RI "Unable to create:" outfile
++.TP
++.IR count " objects rewound."
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH BUGS
++The implementation assumes that there is at most one outer ring in
++each shape, that it is the first ring in a shape, and all other
++rings in a shape are inner rings.  Polygons inside
++.B MultiPatch
++shape types aren't rewound.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpadd (1),
++.BR shpcreate (1),
++.BR shpdump (1)
+diff --git a/man/shptest.1 b/man/shptest.1
+new file mode 100644
+index 0000000..7ab016e
+--- /dev/null
++++ b/man/shptest.1
+@@ -0,0 +1,89 @@
++.\" Process this file with
++.\" groff -man -Tascii shptest.1
++.\"
++.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
++.SH NAME
++shptest \- create some shapefiles for testing
++.SH SYNOPSIS
++.B shptest
++.I num
++.SH DESCRIPTION
++Writes out a shapefile consisting of files
++.RI test num .shp
++and
++.RI test num .shx
++in the current directory.  The
++.I num
++argument specifies the type of shapes in the shapefile to create and takes
++values from:
++.TP
++.B 0
++.B  NullShape
++.TP
++.B 1
++.B  Point
++.TP
++.B 2
++.B  PointZ
++.TP
++.B 3
++.B  PointM
++.TP
++.B 4
++.B MultiPoint
++.TP
++.B 5
++.B MultiPointZ
++.TP
++.B 6
++.B MultiPointM
++.TP
++.B 7
++.B Arc
++.TP
++.B 8
++.B ArcZ
++.TP
++.B 9
++.B ArcM
++.TP
++.B 10
++.B  Polygon
++.TP
++.B 11
++.B  PolygonZ
++.TP
++.B 12
++.B PolygonM
++.TP
++.B 13
++.B MultiPatch
++.SH EXIT STATUS
++.TP
++.B 0
++Successful program execution.
++.TP
++.B 1
++Missing argument.
++.TP
++.B 10
++Test
++.RI ` num '
++not recognised.
++.SH DIAGNOSTICS
++The following diagnostics may be issued on stdout:
++.TP
++.RI "Test `" num "' not recognised."
++.SH AUTHORS
++Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
++.B shapelib
++shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
++this man page.
++.SH "SEE ALSO"
++.BR dbfadd (1),
++.BR dbfcreate (1),
++.BR dbfdump (1),
++.BR dbf_dump (1),
++.BR shpcreate (1),
++.BR shpdump (1),
++.BR shprewind (1)
+-- 
diff --git a/debian/patches/0003-Thread-safety-fixes.patch b/debian/patches/0003-Thread-safety-fixes.patch
new file mode 100644
index 0000000..5468df4
--- /dev/null
+++ b/debian/patches/0003-Thread-safety-fixes.patch
@@ -0,0 +1,181 @@
+From: M Joonas Pihlaja <jpihlaja at cc.helsinki.fi>
+Date: Fri, 8 Apr 2005 10:51:19 +0200
+Subject: [PATCH] Thread safety fixes
+
+---
+ dbfopen.c  |   60 +++++++++++++++++++++++++++++++++---------------------------
+ shapefil.h |    5 +++++
+ 2 files changed, 38 insertions(+), 27 deletions(-)
+
+diff --git a/dbfopen.c b/dbfopen.c
+index 43b25ac..178ae18 100644
+--- a/dbfopen.c
++++ b/dbfopen.c
+@@ -197,8 +197,6 @@ static char rcsid[] =
+ #  define TRUE		1
+ #endif
+ 
+-static int	nStringFieldLen = 0;
+-static char * pszStringField = NULL;
+ 
+ /************************************************************************/
+ /*                             SfRealloc()                              */
+@@ -431,6 +429,12 @@ DBFOpen( const char * pszFilename, const char * pszAccess )
+ 	      psDBF->panFieldOffset[iField-1] + psDBF->panFieldSize[iField-1];
+     }
+ 
++/* -------------------------------------------------------------------- */
++/*  Initialize our temporary input fields.                              */
++/* -------------------------------------------------------------------- */
++    psDBF->nStringFieldLen = 0;
++    psDBF->pszStringField = NULL;
++
+     return( psDBF );
+ }
+ 
+@@ -489,14 +493,12 @@ DBFClose(DBFHandle psDBF)
+     free( psDBF->pszHeader );
+     free( psDBF->pszCurrentRecord );
+ 
+-    free( psDBF );
+-
+-    if( pszStringField != NULL )
++    if( psDBF->pszStringField != NULL )
+     {
+-        free( pszStringField );
+-        pszStringField = NULL;
+-        nStringFieldLen = 0;
++        free( psDBF->pszStringField );
+     }
++
++    free( psDBF );
+ }
+ 
+ /************************************************************************/
+@@ -571,6 +573,12 @@ DBFCreate( const char * pszFilename )
+ 
+     psDBF->bNoHeader = TRUE;
+ 
++/* --------------------------------------------------------------------*/
++/*  Initialize our temporary input fields.*/
++/* --------------------------------------------------------------------*/
++    psDBF->nStringFieldLen = 0;
++    psDBF->pszStringField = NULL;
++
+     return( psDBF );
+ }
+ 
+@@ -691,7 +699,6 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
+     unsigned char	*pabyRec;
+     void	*pReturnField = NULL;
+ 
+-    static double dDoubleField;
+ 
+ /* -------------------------------------------------------------------- */
+ /*      Verify selection.                                               */
+@@ -734,30 +741,31 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
+ /* -------------------------------------------------------------------- */
+ /*	Ensure our field buffer is large enough to hold this buffer.	*/
+ /* -------------------------------------------------------------------- */
+-    if( psDBF->panFieldSize[iField]+1 > nStringFieldLen )
++    if( psDBF->panFieldSize[iField]+1 > psDBF->nStringFieldLen )
+     {
+-	nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10;
+-	pszStringField = (char *) SfRealloc(pszStringField,nStringFieldLen);
++	psDBF->nStringFieldLen = psDBF->panFieldSize[iField]*2 + 10;
++	psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField,
++						   psDBF->nStringFieldLen);
+     }
+ 
+ /* -------------------------------------------------------------------- */
+ /*	Extract the requested field.					*/
+ /* -------------------------------------------------------------------- */
+-    strncpy( pszStringField, 
++    strncpy( psDBF->pszStringField, 
+ 	     ((const char *) pabyRec) + psDBF->panFieldOffset[iField],
+ 	     psDBF->panFieldSize[iField] );
+-    pszStringField[psDBF->panFieldSize[iField]] = '\0';
++    psDBF->pszStringField[psDBF->panFieldSize[iField]] = '\0';
+ 
+-    pReturnField = pszStringField;
++    pReturnField = psDBF->pszStringField;
+ 
+ /* -------------------------------------------------------------------- */
+ /*      Decode the field.                                               */
+ /* -------------------------------------------------------------------- */
+     if( chReqType == 'N' )
+     {
+-        dDoubleField = atof(pszStringField);
++	psDBF->dDoubleField = atof(psDBF->pszStringField);
+ 
+-	pReturnField = &dDoubleField;
++	pReturnField = &psDBF->dDoubleField;
+     }
+ 
+ /* -------------------------------------------------------------------- */
+@@ -768,7 +776,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
+     {
+         char	*pchSrc, *pchDst;
+ 
+-        pchDst = pchSrc = pszStringField;
++        pchDst = pchSrc = psDBF->pszStringField;
+         while( *pchSrc == ' ' )
+             pchSrc++;
+ 
+@@ -776,7 +784,7 @@ static void *DBFReadAttribute(DBFHandle psDBF, int hEntity, int iField,
+             *(pchDst++) = *(pchSrc++);
+         *pchDst = '\0';
+ 
+-        while( pchDst != pszStringField && *(--pchDst) == ' ' )
++        while( pchDst != psDBF->pszStringField && *(--pchDst) == ' ' )
+             *pchDst = '\0';
+     }
+ #endif
+@@ -1351,9 +1359,6 @@ DBFReadTuple(DBFHandle psDBF, int hEntity )
+ {
+     int	       	nRecordOffset;
+     unsigned char	*pabyRec;
+-    static char	*pReturnTuple = NULL;
+-
+-    static int	nTupleLen = 0;
+ 
+ /* -------------------------------------------------------------------- */
+ /*	Have we read the record?					*/
+@@ -1375,14 +1380,15 @@ DBFReadTuple(DBFHandle psDBF, int hEntity )
+ 
+     pabyRec = (unsigned char *) psDBF->pszCurrentRecord;
+ 
+-    if ( nTupleLen < psDBF->nRecordLength) {
+-      nTupleLen = psDBF->nRecordLength;
+-      pReturnTuple = (char *) SfRealloc(pReturnTuple, psDBF->nRecordLength);
++    if ( psDBF->nStringFieldLen < psDBF->nRecordLength) {
++      psDBF->nStringFieldLen = psDBF->nRecordLength;
++      psDBF->pszStringField = (char *) SfRealloc(psDBF->pszStringField,
++						 psDBF->nRecordLength);
+     }
+     
+-    memcpy ( pReturnTuple, pabyRec, psDBF->nRecordLength );
++    memcpy ( psDBF->pszStringField, pabyRec, psDBF->nRecordLength );
+         
+-    return( pReturnTuple );
++    return( psDBF->pszStringField );
+ }
+ 
+ /************************************************************************/
+diff --git a/shapefil.h b/shapefil.h
+index 19ba921..0244ba1 100644
+--- a/shapefil.h
++++ b/shapefil.h
+@@ -401,6 +401,11 @@ typedef	struct
+     
+     int		bNoHeader;
+     int		bUpdated;
++
++    int		nStringFieldLen;
++    char	*pszStringField;
++
++    double	dDoubleField;
+ } DBFInfo;
+ 
+ typedef DBFInfo * DBFHandle;
+-- 
diff --git a/debian/patches/0004-Properly-use-libtool.patch b/debian/patches/0004-Properly-use-libtool.patch
new file mode 100644
index 0000000..79d10a3
--- /dev/null
+++ b/debian/patches/0004-Properly-use-libtool.patch
@@ -0,0 +1,48 @@
+From: Riku Voipio <riku.voipio at iki.fi>
+Date: Tue, 4 Nov 2008 14:46:56 +0200
+Subject: [PATCH] Properly use libtool
+
+The problem is that shapelib throws away a seemingly good libtool linked
+library and replaces it with something hacks in together almost right.
+
+Bug-Debian: http://bugs.debian.org/497160
+---
+ Makefile |   24 ++++++++++++------------
+ 1 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 6d24091..3dd053e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -113,18 +113,18 @@ lib:
+ 	gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c  -fPIC -DPIC dbfopen.c -o .libs/dbfopen.lo
+ 	gcc -DPACKAGE=\"libshp\" -DVERSION=\"$(SHPLIB_VERSION)\" -DSTDC_HEADERS=1 -I. -I. -I/usr/local/include -g -O2 -c dbfopen.c -o dbfopen.o >/dev/null 2>&1
+ 	mv -f .libs/dbfopen.lo dbfopen.lo
+-	/bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath /usr/local/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo  
+-	rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
+-	rm -fr .libs/libshp.lax
+-	mkdir .libs/libshp.lax
+-	/usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  shpopen.lo shptree.lo dbfopen.lo  -lc
+-
+-	(cd .libs && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1)
+-	(cd .libs && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so)
+-	ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o 
+-	ranlib .libs/libshp.a
+-	rm -fr .libs/libshp.lax
+-	(cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)
++	/bin/sh ./libtool --mode=link gcc  -g -O2  -o libshp.la -rpath /usr/lib -version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo  
++#	rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
++#	rm -fr .libs/libshp.lax
++#	mkdir .libs/libshp.lax
++#	/usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.$(LIBSHP_VERSION)  shpopen.lo shptree.lo dbfopen.lo  -lc
++#
++#	(cd .libs && rm -f libshp.so.1 && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so.1)
++#	(cd .libs && rm -f libshp.so && ln -s libshp.so.$(LIBSHP_VERSION) libshp.so)
++#	ar cru .libs/libshp.a  shpopen.o shptree.o dbfopen.o 
++#	ranlib .libs/libshp.a
++#	rm -fr .libs/libshp.lax
++#	(cd .libs && rm -f libshp.la && ln -s ../libshp.la libshp.la)
+ 
+ lib_install:
+ 	cp .libs/libshp.la .libs/libshp.lai
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..dad392a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+0001-Disable-proj_api.h-include.patch
+0002-Add-manpages.patch
+0003-Thread-safety-fixes.patch
+0004-Properly-use-libtool.patch
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/man/Makefile b/man/Makefile
deleted file mode 100644
index 1bf4918..0000000
--- a/man/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-SOURCES=dbfdump.1 dbfcreate.1 dbfadd.1 shpdump.1 shpadd.1 shpcreate.1 shprewind.1 shptest.1
-TARGETS=$(addsuffix .cat, $(SOURCES)) $(addsuffix .ps, $(SOURCES)) $(addsuffix .html, $(SOURCES))
-
-%.1.cat: %.1
-	groff -man -Tascii $^ >$@
-
-%.1.ps: %.1
-	groff -man -Tps $^ >$@
-
-%.1.html: %.1
-	man2html $^ >$@
-
-all:	$(TARGETS)
-
-clean:
-	$(RM) *.1.cat *.1.ps *.1.html *~ 
diff --git a/man/dbfadd.1 b/man/dbfadd.1
deleted file mode 100644
index fea9a8a..0000000
--- a/man/dbfadd.1
+++ /dev/null
@@ -1,61 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii dbfadd.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-dbfadd \- add a row to an xBase DBF file
-.SH SYNOPSIS
-.B dbfadd
-.I filename fieldvalues...
-.SH DESCRIPTION
-Adds a row to the DBF file named by
-.I filename
-with column values given by the
-.I fieldvalues
-options that follow.  A
-.B NULL
-value is denoted by an empty argument.
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I filename
-or 
-.I fieldvalues
-arguments.
-.TP
-.B 2
-Failed to open
-.I filename
-for reading and appending.
-.TP
-.B 3
-Too few values in
-.I fieldvalues...
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI DBFOpen( filename ",""rb+"") failed."
-.TP
-.RI Got\  count1 " fields, but require " count2 
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.
-Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote this man page.
-.SH BUGS
-Field values that are too large to fit in a field are silently
-truncated from the right. Numeric field values that can't be parsed by
-.BR atof (3)
-get undefined values.
-.SH "SEE ALSO"
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpadd (1),
-.BR shpcreate (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/man/dbfcreate.1 b/man/dbfcreate.1
deleted file mode 100644
index 58436e5..0000000
--- a/man/dbfcreate.1
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii dbfcreate.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-dbfcreate \- Create an empty xBase DBF file
-.SH SYNOPSIS
-.B dbfcreate
-.IR "filename" "[[\-s " "fieldname width" "] | [\-n " "fieldname width decimals" ]] ...
-.SH DESCRIPTION
-Creates an empty DBF file called
-.I filename
-with columns described by all the
-.B \-s
-and
-.B \-n
-options that follow.
-.SH OPTIONS
-.TP
-.BI "\-s " "fieldname width"
-adds a column named
-.I fieldname
-taking textual values of at most
-.I width
-characters.
-.TP
-.BI \-n\  fieldname\ width\ decimals
-adds a column named
-.I fieldname
-taking numeric values of at most
-.I width
-digits and precision of at most
-.I decimals
-decimal places.  The number of digits of precision should be included in
-.IR width .
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I filename
-argument.
-.TP
-.B 2
-Failed to create the file
-.I filename
-for writing.
-.TP
-.B 3
-Missing 
-.IR fieldname , width ", or " decimals
-argument for a
-.B \-s
-or
-.B \-n
-option.
-.TP
-.B 4
-Failed to add a column given by a
-.B \-s
-or
-.B \-n
-option.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI DBFCreate( filename ") failed."
-.TP
-.RI DBFAddField( fieldname ",FTString," width ",0) failed."
-.TP
-.RI DBFAddField( fieldname ",FTDouble," width "," decimals ") failed."
-.TP
-.RI "Argument incomplete, or unrecognised: " arg
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.
-Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote this man page.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpadd (1),
-.BR shpcreate (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/man/dbfdump.1 b/man/dbfdump.1
deleted file mode 100644
index e7a8574..0000000
--- a/man/dbfdump.1
+++ /dev/null
@@ -1,111 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii dbfdump.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-dbfdump \- dump xBase DBF files as text
-.SH SYNOPSIS
-.B dbfdump [\-h] [\-m] [\-r]
-.I file
-.SH DESCRIPTION
-Dumps the contents of
-.I file
-to standard output.  The first line contains the field names appearing
-in
-.I file,
-and each of the following lines contains the field values of a
-record.  Field names and values are padded by spaces to their field
-widths.  Empty fields are printed as the string "(NULL)".
-.SH OPTIONS
-.TP
-.B \-h
-Prints the column field definitions before other output.  Each field
-definition consists of a line of the form
-
-.RI "Field: " index ", Type=" type ", Title=`" "name" "', Width=" "width" ", Decimals=" precision
-
-where
-.I index
-is the zero offset column number of the field; the
-.I type
-indicates the datatype of the field value and is either "Integer",
-"Real" or "String"; 
-.I name
-is the field's name;
-.I width
-is the number of bytes reserved for the field's value; and
-.I precision
-is the number of decimal places of precision for "Real" type
-fields, and is zero for "Integer" and "String" type fields.
-.TP
-.B \-m
-Prints each record in multiline format separated by empty lines.
-The first line of a record gives the number of the record in the form
-
-Records:
-.I record_index
-
-where
-.I record_index
-is the zero offset number of the record in the file, and
-then each field of the record appears on its own line in the format
-
-.IR name :
-.I value
-
-.TP
-.B \-r
-Prints the exact bytes occurring in
-.I file
-for field values and suppresses printing "(NULL)" for
-empty values.
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I file
-argument.
-.TP
-.B 2
-Failed to open
-.I file.
-.TP
-.B 3
-There are no fields in
-.I file.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI DBFOpen( file ",""r"") failed."
-.TP
-There are no fields in this table!
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH BUGS
-Unless the
-.B \-r
-option is given, values in numeric fields that overflow the
-.B int
-or 
-.B double
-types of the 
-.B C
-language are printed as plus or minus a huge number.  For integer
-fields the huge value is
-.B HUGE_VALL
-from <stdlib.h> and for real fields it is
-.BR HUGE_VALF .
-.SH "SEE ALSO"
-.BR dbf_dump (1),
-.BR dbfcreate (1),
-.BR dbfadd (1),
-.BR shpadd (1),
-.BR shpcreate (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/man/shpadd.1 b/man/shpadd.1
deleted file mode 100644
index f57576a..0000000
--- a/man/shpadd.1
+++ /dev/null
@@ -1,85 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii shpadd.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-shpadd \- append a shape to an ESRI shapefile
-.SH SYNOPSIS
-.B shpadd
-.I file
-.RI "[[" "x y" "] [+]]*"
-.SH DESCRIPTION
-Appends a shape to the shapefile determined from
-.IR file .
-The geometric data of the new shape consists of lists of 
-.I X/Y 
-points on the command line grouped into 
-.IR parts ,
-with points in different parts separated by a plus
-.RB ( + )
-sign.  If no points or parts are given then a shape of type
-.B NullShape
-is appended to the shapefile, and otherwise the type of the new shape
-is determined by the shapefile's header.  See
-.BR shpdump (1)
-for a description of shape types and how geometric data for parts are
-interpreted for a specific type.  No geometric restrictions set by the
-shapefile specification are enforced by
-.BR shpadd (1).
-
-Shapefiles actually consist of two files with the same basename and
-extensions
-.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
-containing the shape data and shape index respectively.  The files
-to open are determined by first stripping any filename extension
-from
-.I file 
-and attempting to open the files
-.IB file .shp
-or 
-.IB file .SHP,
-and
-.IB file .shx
-or
-.IB file .SHX
-for the respective data and index files.
-
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I file
-argument, the shapefile can't be opened, or the program
-ran out of memory.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI "Unable to open:" file
-.TP
-.RI "Out of memory"
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH BUGS
-Coordinate values that can't be
-be parsed by 
-.BR sscanf (3)
-get undefined values.  There's no way to give measure or
-.I Z
-data to vertices in a shape, but those are always set to zero
-if the shapefile's shape type requires those values.
-.B MultiPatch
-shape types aren't supported.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpcreate (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/man/shpcreate.1 b/man/shpcreate.1
deleted file mode 100644
index 4fa69a8..0000000
--- a/man/shpcreate.1
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii shpcreate.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-shpcreate \- create an empty ESRI shapefile
-.SH SYNOPSIS
-.B shpcreate
-.I file shapetype
-.SH DESCRIPTION
-Creates an empty shapefile supporting shapes of the given type
-.IR shapetype .
-Shapefiles actually consist of two files with the same basename and
-extensions
-.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
-containing the shape data and shape index respectively.  The files
-to create are determined by first stripping any filename extension
-from
-.I file 
-and attempting to create the files
-.IB file .shp
-or 
-.IB file .SHP,
-and
-.IB file .shx
-or
-.IB file .SHX
-for the respective data and index files.  The supported values for the
-.I shapetype
-argument are:
-.BR point ", " arc ", " polygon ", and " multipoint .
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I file
-or 
-.I shapetype
-argument.
-.TP
-.B 2
-Unknown 
-.IR shapetype .
-.TP
-.B 3
-Unable to create the shapefile.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI "Shape Type `" shapetype "' not recognised."
-.TP
-.RI "Unable to create:" file
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpadd (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/man/shpdump.1 b/man/shpdump.1
deleted file mode 100644
index 455d702..0000000
--- a/man/shpdump.1
+++ /dev/null
@@ -1,316 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii shpdump.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-shpdump \- dump an ESRI shapefile as text
-.SH SYNOPSIS
-.B shpdump [\-validate]
-.I file
-.SH DESCRIPTION
-Prints the contents of the shapefile
-.I file
-to standard output in textual format.  Shapefiles actually consist
-of two files with the same basename and extensions
-.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
-containing the shape data and shape index respectively.  The files
-to open are determined by first stripping any filename extension
-from
-.I file 
-and attempting to open the files
-.IB file .shp
-or 
-.IB file .SHP,
-and
-.IB file .shx
-or
-.IB file .SHX
-for the respective data and index files.
-
-Output consists of a header giving number and type of shapes in the
-file and the bounds for the minimum and maximum
-.IR X ,\  Y ,\  Z ", and " M  
-values appearing in the shapes.  The header is followed by the
-geometric data for each shape in the file.  All shapes in the file
-should be of the same type, except that
-.B NullShape
-typed shapes may be intermixed with any other type.  The header has
-the form
-.RS
-
-Shapefile Type:
-.I type
-# of Shapes:
-.I count
-
-File Bounds:
-.RI ( minX , minY , minZ , minM )
-         to\  
-.RI ( maxX , maxY , maxZ , maxM )
-
-.RE
-See section
-.B SHAPE TYPES
-below for the list of possible shape types.
-
-Next for each shape in the file a header giving 
-it's
-.IR shape_index ,
-it's type
-.IR type ,
-number of vertices
-.IR nVertices ,
-number of parts
-.IR nParts ,
-and bounding box is given, followed by the vertex data of each part.
-.RS
-
-Shape:\ 
-.IR shape_index \ ( type )\ nVertices= nVertices ,\ nParts= nParts
-  Bounds:
-.RI ( minX , minY , minZ , minM )
-      to\  
-.RI ( maxX , maxY , maxZ , maxM )
-
-.RI "  " "vertices of the first part"
-
-.RI "+ " "vertices of the second part..."
-
-.RI "+ " "vertices of the last part"
-
-.RE
-The
-.I shape_index
-of a shape is the number of the shape starting from zero in the shape
-file.  Each vertex has the form
-.RS
-
-.RI ( X , Y , Z , M )
-
-.RE
-If there are multiple parts then the type of the part is appended
-appended to first vertex of each part, and the first vertex of the
-second and following parts is preceded by a plus
-.RB ( + )
-sign.  The part type is
-.B Ring
-for all shape types except
-.B MultiPatch
-where it is the type of a surface patch.  See below for the description
-of possible part types.
-.SH SHAPE TYPES
-Each type of shape except
-.B MultiPatch
-typed shapes comes in three flavours: The normal unsuffixed type, where
-points lie in
-.IR X/Y -space;
-a type with suffix
-.B M
-where points lie in 
-.IR X/Y -space
-and additionally have a
-.I measure
-value in
-.IR M -space;
-and finally a type with suffix
-.B Z
-where points lie in
-.IR X/Y/Z -space
-and also have a measure value in
-.IR M -space.
-.\"
-.TP
-.B NullShape
-A shape without data.  Shapes of this type may be intermixed with
-other shapes and are sometimes used to represented deleted or missing
-geometric data for a shape.
-.\"
-.TP
-.B Point " or " PointZ " or " PointM
-A single point.
-.\"
-.TP
-.BR Arc " or " ArcZ " or " ArcM
-Piecewise linear paths.  Shapes of this type may consist of multiple
-parts which may or may not intersect and/or connect.  Arcs are called
-.BR PolyLine s
-in the shapefile specification.
-.\"
-.TP
-.BR Polygon " or " PolygonZ " or " PolygonM
-Polygon shapes consist of one or more parts, called 
-.IR rings ,
-that each define a closed path.  Rings must contain at least four
-vertices with the first and last vertices being equal, and must not
-self-intersect.  For shapes of type
-.BR Polygon ,
-the rings define a polygon with optional holes by giving the vertices
-of inner rings a counterclockwise orientation and the vertices of
-outer rings a clockwise orientation.  Intersection and orientation
-is always computed in
-.IR X/Y -space
-and never in
-.IR X/Y/M -space.
-.\"
-.TP
-.BR MultiPoint " or " MultiPointZ " or " MultiPointM
-A set of points.
-.\"
-.TP
-.BR MultiPatch
-A
-.B MultiPatch
-represents one or more surfaces in
-.IR X/Y/Z -space,
-and consists of a number of parts called it's
-.IR "surface patches" .
-Each surface patch describes a either a surface or a hole in another
-surface, depending on the type of the patch.  Patches may share a
-common boundary but may not otherwise intersect.  The type of a patch
-may be one of
-.RS
-.TP
-.B TriangleStrip
-A set of connected triangles.  The first three points
-define the first triangle and every following point defines
-a new triangle using the new point and the two previous points.
-.TP
-.B TriangleFan
-A set of connected triangles.  The first three points define the first
-triangle and every following point defines a new triangle using the
-previous point, the current point, and the first point, thus forming a
-fan of triangles around the first point.
-.TP
-.B OuterRing
-The outer ring of a sequence of rings defining a polygon with holes.
-All following parts of type
-.B InnerRing
-are taken to be the holes of the polygon.  The sequence of rings
-ends with the first
-.RB non- InnerRing
-typed part or the part of the shape, whichever comes first.
-.TP
-.B InnerRing
-An inner ring in a sequence of rings defining a polygon with holes.
-This type of part may only follow an
-.B OuterRing
-or other
-.B InnerRing
-typed parts.
-.TP
-.B FirstRing
-The first in a sequence of rings defining a polygon of
-unspecified type.  The following parts of type
-.B Ring
-defines the other rings in the polygon.  This type of part is used when
-the innerness or outerness of a polygon isn't known or applicable.  The sequence of rings
-defining the polygon ends with the first
-.BR non- Ring
-typed part or the last part of the shape, whichever comes first.
-.TP
-.B Ring
-A ring in a sequence of rings defining a polygon of unspecified type.
-It may only follow a
-.B FirstRing
-or other
-.B Ring
-typed parts.
-.TP
-.B UknownPartType
-This type is returned for parts whose type isn't recognised.
-.RE
-.\"
-.TP
-.B UnknownShapeType
-This type is returned for shapes whose type isn't recognised.
-.SH OPTIONS
-.TP
-.B \-validate
-Performs validation on the orientation of inner and outer rings in
-.BR Polygon ", " PolygonZ ", and " PolygonM
-objects.  According to the shapefile specification outer rings should
-be given a clockwise orientation, and inner rings that define holes a
-counterclockwise orientation.  If some rings of a shape are oriented
-the wrong way around then the following message is output after
-dumping that shape:
-
-.IR  count " rings wound in the wrong direction."
-
-In addition the total number of shapes with problem rings is output
-after the last shape has been dumped:
-
-.IR count " object has invalid ring orderings."
-
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-No shapefile
-.I file
-was given or it couldn't be opened.
-.SH EXAMPLE
-.PP
-.RS
-$ shpdump shapefile.shp
-
-Shapefile Type: Arc   # of Shapes: 3
-
-File Bounds: ( 3531586.750, 7253086.100,0,0)
-         to  ( 3536417.463, 7778375.875,0,0)
-
-Shape:0 (Arc)  nVertices=2, nParts=1
-  Bounds:( 3536397.797, 7253086.100, 0, 0)
-      to ( 3536417.463, 7253163.597, 0, 0)
-     ( 3536397.797, 7253163.597, 0, 0) Ring 
-     ( 3536417.463, 7253086.100, 0, 0)  
-
-Shape:1 (Arc)  nVertices=3, nParts=1
-  Bounds:( 3458966.390, 7373335.808, 0, 0)
-      to ( 3459141.856, 7373474.681, 0, 0)
-     ( 3458966.390, 7373474.681, 0, 0) Ring 
-     ( 3458979.042, 7373466.273, 0, 0)  
-     ( 3459141.856, 7373335.808, 0, 0)  
-
-Shape:2 (Arc)  nVertices=7, nParts=1
-  Bounds:( 3531586.750, 7777880.500, 0, 0)
-      to ( 3532930.206, 7778375.875, 0, 0)
-     ( 3531586.750, 7777880.500, 0, 0) Ring 
-     ( 3532228.265, 7778072.455, 0, 0)  
-     ( 3532310.897, 7778119.445, 0, 0)  
-     ( 3532367.866, 7778144.877, 0, 0)  
-     ( 3532440.559, 7778168.920, 0, 0)  
-     ( 3532506.504, 7778190.785, 0, 0)  
-     ( 3532930.206, 7778375.875, 0, 0)
-
-$ 
-.RE
-.PP
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI "Unable to open:" file
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH BUGS
-The
-.B \-validate
-option supports only one outer ring in a polygonal shape
-and assumes that the first ring in a shape is the outer ring.  It doesn't support
-polygons inside
-.B MultiPatch
-shapes.  The
-.IR X " and " Y 
-coordinates of a point are printed to three decimal places only.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpadd (1),
-.BR shpcreate (1),
-.BR shprewind (1)
diff --git a/man/shprewind.1 b/man/shprewind.1
deleted file mode 100644
index 00200f0..0000000
--- a/man/shprewind.1
+++ /dev/null
@@ -1,88 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii shprewind.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-shprewind \- fix polygon ring orientations in ESRI shapefiles
-.SH SYNOPSIS
-.B shprewind
-.I infile outfile
-.SH DESCRIPTION
-Makes a copy of the shapefile
-.I infile
-to 
-.I outfile
-and fixes the orientation of points in the rings of
-.BR Polygon ", " PolygonZ ", and " PolygonM
-typed shapes to conform to the shapefile specification.  According to the
-specification, the vertices of outer rings should be oriented
-clockwise on the
-.I X/Y
-plane, and those of inner rings counterclockwise.
-
-Shapefiles actually consist of two files with the same basename and
-extensions
-.BR .shp \ and\  .shx " (or " .SHP \ and\  .SHX ") "
-containing the shape data and shape index respectively.  The files
-to open are determined by first stripping any filename extension
-from
-.I infile 
-and attempting to open the files
-.IB infile .shp
-or 
-.IB infile .SHP,
-and
-.IB infile .shx
-or
-.IB infile .SHX
-for the respective data and index files.  The files to create
-from
-.I outfile
-are determined by stripping any filename extension from
-.I outfile
-and appending
-.B .shp
-and
-.B .shx
-suffixes for the respective data and index files.
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing
-.I infile
-or
-.I outfile
-arguments, failed to open shapefile
-.I infile
-or create shapefile
-.IR outfile.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI "Unable to open:" infile
-.TP
-.RI "Unable to create:" outfile
-.TP
-.IR count " objects rewound."
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH BUGS
-The implementation assumes that there is at most one outer ring in
-each shape, that it is the first ring in a shape, and all other
-rings in a shape are inner rings.  Polygons inside
-.B MultiPatch
-shape types aren't rewound.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpadd (1),
-.BR shpcreate (1),
-.BR shpdump (1)
diff --git a/man/shptest.1 b/man/shptest.1
deleted file mode 100644
index 7ab016e..0000000
--- a/man/shptest.1
+++ /dev/null
@@ -1,89 +0,0 @@
-.\" Process this file with
-.\" groff -man -Tascii shptest.1
-.\"
-.TH SHAPELIB 1 "OCTOBER 2004" "shapelib" "User Commands"
-.SH NAME
-shptest \- create some shapefiles for testing
-.SH SYNOPSIS
-.B shptest
-.I num
-.SH DESCRIPTION
-Writes out a shapefile consisting of files
-.RI test num .shp
-and
-.RI test num .shx
-in the current directory.  The
-.I num
-argument specifies the type of shapes in the shapefile to create and takes
-values from:
-.TP
-.B 0
-.B  NullShape
-.TP
-.B 1
-.B  Point
-.TP
-.B 2
-.B  PointZ
-.TP
-.B 3
-.B  PointM
-.TP
-.B 4
-.B MultiPoint
-.TP
-.B 5
-.B MultiPointZ
-.TP
-.B 6
-.B MultiPointM
-.TP
-.B 7
-.B Arc
-.TP
-.B 8
-.B ArcZ
-.TP
-.B 9
-.B ArcM
-.TP
-.B 10
-.B  Polygon
-.TP
-.B 11
-.B  PolygonZ
-.TP
-.B 12
-.B PolygonM
-.TP
-.B 13
-.B MultiPatch
-.SH EXIT STATUS
-.TP
-.B 0
-Successful program execution.
-.TP
-.B 1
-Missing argument.
-.TP
-.B 10
-Test
-.RI ` num '
-not recognised.
-.SH DIAGNOSTICS
-The following diagnostics may be issued on stdout:
-.TP
-.RI "Test `" num "' not recognised."
-.SH AUTHORS
-Frank Warmerdam (warmerdam at pobox.com) is the maintainer of the
-.B shapelib
-shapefile library.  Joonas Pihlaja (jpihlaja at cc.helsinki.fi) wrote
-this man page.
-.SH "SEE ALSO"
-.BR dbfadd (1),
-.BR dbfcreate (1),
-.BR dbfdump (1),
-.BR dbf_dump (1),
-.BR shpcreate (1),
-.BR shpdump (1),
-.BR shprewind (1)
diff --git a/shapefil.h b/shapefil.h
index 0244ba1..19ba921 100644
--- a/shapefil.h
+++ b/shapefil.h
@@ -401,11 +401,6 @@ typedef	struct
     
     int		bNoHeader;
     int		bUpdated;
-
-    int		nStringFieldLen;
-    char	*pszStringField;
-
-    double	dDoubleField;
 } DBFInfo;
 
 typedef DBFInfo * DBFHandle;

-- 
Library for reading and writing ArcView Shapefiles



More information about the Pkg-grass-devel mailing list