From 36491714ba22af066402bf4fd1ebbbda7d26c11c Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 30 Dec 2003 13:31:53 +0000 Subject: [PATCH] made shp2pgsql looser about numeric precisions git-svn-id: http://svn.osgeo.org/postgis/trunk@418 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/loader/shp2pgsql.c b/loader/shp2pgsql.c index 3f2a4d630..7bcea8023 100644 --- a/loader/shp2pgsql.c +++ b/loader/shp2pgsql.c @@ -12,6 +12,9 @@ * ********************************************************************** * $Log$ + * Revision 1.44 2003/12/30 13:31:53 strk + * made shp2pgsql looser about numeric precisions + * * Revision 1.43 2003/12/30 12:37:46 strk * Fixed segfault bug reported by Randy George, removed explicit sequence drop * @@ -110,7 +113,10 @@ int dump_format = 0; //0=insert statements, 1 = dump int quoteidentifiers = 0; char opt; char *col_names; -DBFFieldType *types; + +DBFFieldType *types; /* Fields type, width and precision */ +int *widths; +int *precisions; int Insert_attributes(DBFHandle hDBFHandle, int row); char *make_good_string(char *str); @@ -691,8 +697,10 @@ int main (int ARGC, char **ARGV){ */ num_fields = DBFGetFieldCount( hDBFHandle ); num_records = DBFGetRecordCount(hDBFHandle); - names = malloc((num_fields + 1)*sizeof(char*)); - types = (DBFFieldType *)malloc((num_fields + 1)*sizeof(char*)); + names = malloc(num_fields*sizeof(char*)); + types = (DBFFieldType *)malloc(num_fields*sizeof(char*)); + widths = malloc(num_fields*sizeof(int)); + precisions = malloc(num_fields*sizeof(int)); col_names = malloc(num_fields * sizeof(char) * 32); if(opt != 'a'){ strcpy(col_names, "(gid," ); @@ -702,8 +710,12 @@ int main (int ARGC, char **ARGV){ for(j=0;j 18 ){ - printf ("numeric(%d,%d)",field_width, field_precision); + //printf ("numeric(%d,%d)",field_width, field_precision); + printf ("numeric"); }else{ printf ("float8"); } -- 2.40.0