[postgis-commits] svn - r2698 - in branches/gSoC2007_raster/pgraster: . win32/build

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Mon Aug 20 10:43:44 PDT 2007


Author: xingkth
Date: 2007-08-20 10:43:43 -0700 (Mon, 20 Aug 2007)
New Revision: 2698

Added:
   branches/gSoC2007_raster/pgraster/EXAMPLE.win32
   branches/gSoC2007_raster/pgraster/win32/build/SP27GTIF.TIF
   branches/gSoC2007_raster/pgraster/win32/build/cea.tif
Modified:
   branches/gSoC2007_raster/pgraster/TODO.TXT
   branches/gSoC2007_raster/pgraster/geotiff2pgraster.c
   branches/gSoC2007_raster/pgraster/pgraster2geotiff.c
   branches/gSoC2007_raster/pgraster/win32/build/geotiff2pgraster.exe
   branches/gSoC2007_raster/pgraster/win32/build/pgraster2geotiff.exe
Log:
xing-make pgraster2geotiff works and fix a problem of geotiff2pgraster loader.

Added: branches/gSoC2007_raster/pgraster/EXAMPLE.win32
===================================================================
--- branches/gSoC2007_raster/pgraster/EXAMPLE.win32	2007-08-20 01:57:53 UTC (rev 2697)
+++ branches/gSoC2007_raster/pgraster/EXAMPLE.win32	2007-08-20 17:43:43 UTC (rev 2698)
@@ -0,0 +1,21 @@
+##################################################
+1. Sample for GeoTIFF2PGRaster Loader
+##################################################
+
+(1) geotiff2pgraster.exe -h localhost -p 5432 -d pgraster -U postgres -P justdoit "E:\Work\GoolgeSoC2007\SP27GTIF.TIF" public.sp27gtif -v 
+
+(2) geotiff2pgraster.exe -h localhost -p 5432 -d pgraster -U postgres -P justdoit "E:\Work\GoolgeSoC2007\SP27GTIF.TIF" -q 
+Notes: If ignored, "public" will be the schema and filename of "sp27gtif" will be the table name.
+
+(3) geotiff2pgraster.exe -h localhost -p 5432 -d pgraster -U postgres -P justdoit SP27GTIF.TIF
+Notes: If output mode is ignored (-q|-v), the normal mode will be applied. Only warning and error information will be prompted at normal mode. At quiet mode, no information will be prompted. At verbose mode, details about the progress of data loading will be presented.
+
+
+
+
+
+##################################################
+2. Sample for PGRaster2GeoTIFF Loader
+##################################################
+
+pgraster2geotiff.exe -h localhost -p 5432 -d pgraster -U postgres -P justdoit public.goodtif "E:\Work\goodtif.TIF" 

Modified: branches/gSoC2007_raster/pgraster/TODO.TXT
===================================================================
--- branches/gSoC2007_raster/pgraster/TODO.TXT	2007-08-20 01:57:53 UTC (rev 2697)
+++ branches/gSoC2007_raster/pgraster/TODO.TXT	2007-08-20 17:43:43 UTC (rev 2698)
@@ -1,19 +1,33 @@
-// TO DO List
+##################################################################
+###########   TO DO List (x: finished; ... : doing; )  ###########
+##################################################################
 
-1. libgeotiff functions
+// Last Update: 2007-08-20
 
+1. libgeotiff functions (x)
+
 2. libpq functions (x)
 
-3. create table and insert data.
+3. create table and insert data. (x)
 
 4. create datatypes / structure for PGRaster (x).
 
-5. byte order / big&little endian / network byte order
+5. byte order / big&little endian / network byte order (x)
 
-6. ntohl() - network 32 bit integer to local byte order converter.
+6. ntohl() - network 32 bit integer to local byte order converter. (x)
 
-7. pgraster and postgis share the same proj system. 
+7. pgraster and postgis share the same proj system. (x)
 
 8. UTF-8 Conversion
 
 9. Create functions in the server side using plpgsql (x). 
+
+10. Port between Win32 & Linux platform. 
+
+11. Change of Makefile.
+
+12. Build under Linux platform.
+
+13. Test of Single-Band GeoTIFF files. (x)
+
+14. Test of Multi-Band GeoTIFF files. (...)

Modified: branches/gSoC2007_raster/pgraster/geotiff2pgraster.c
===================================================================
--- branches/gSoC2007_raster/pgraster/geotiff2pgraster.c	2007-08-20 01:57:53 UTC (rev 2697)
+++ branches/gSoC2007_raster/pgraster/geotiff2pgraster.c	2007-08-20 17:43:43 UTC (rev 2698)
@@ -191,7 +191,7 @@
 
 void _EndReadTIFF();
 
-byte* _GetTIFFAt(int row, int col, int band, int *bytereturned);
+byte* _GetTIFFAt(int col, int row, int band, int *bytereturned);
 
 /* Step 3. CreateIndex() */
 void CreateIndex();
@@ -550,7 +550,7 @@
  */
 static void exit_nicely(PGconn *conn, int code)
 {
-	if(beginTransaction == TRUE)
+	if(code == 0 && beginTransaction == TRUE)
 	{
 		res = PQexec(conn, "ROLLBACK");
 		PQclear(res);
@@ -782,10 +782,14 @@
 	
 	if(outmode != MODE_QUIET)
 	{
-		fprintf(stdout, "From GeoTIFF:\n\tgeotiff_file=%s geotiff_filename=%s\n",  geotiff_file,geotiff_filename);
+		fprintf(stdout, "****************************************************************\n");
+		fprintf(stdout, "****************** GeoTIFF2PGRaster Converter ******************\n");
+		fprintf(stdout, "****************************************************************\n");
 		fprintf(stdout, "To PostgreSQL:\n\t host=%s PGPORT=%s database=%s user=%s password=%s schema=%s table=%s \n",
 				getenv("PGHOST"), getenv("PGPORT"), getenv("PGDATABASE"),
 				getenv("PGUSER"), getenv("PGPASSWORD"),schema,table);
+		fprintf(stdout, "To GeoTIFF:\n\tgeotiff_file=%s geotiff_filename=%s\n",  geotiff_file,geotiff_filename);
+		
 	}
 
 }
@@ -1795,7 +1799,7 @@
 {
 	
 	int result = 0;
-	
+
 	if((mode==PHOTOMETRIC_RGB) && (spp==4))
 		hasAlpha = 1;
 	else
@@ -1818,6 +1822,9 @@
 	if( mode == PHOTOMETRIC_CIELAB )
 		_initCIELabConversion(tif);
 
+
+	TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
+
 	for (stripCount = 0; stripCount < stripMax; stripCount++)
 	{
     	if((result = TIFFReadEncodedStrip (tif, stripCount,
@@ -1870,7 +1877,7 @@
 	}
 }
 
-byte* _GetTIFFAt(int row, int col, int band, int *bitsreturned)
+byte* _GetTIFFAt(int col, int row, int band, int *bitsreturned)
 {
 
 	*bitsreturned = 0;
@@ -2408,12 +2415,11 @@
 void Cleanup()
 {
 	/* end the transaction */
-	res = PQexec(conn, "COMMIT");
-	PQclear(res);
-
 	res = PQexec(conn, "END");
 	PQclear(res);
 
+	beginTransaction = FALSE;
+
 	/* Close Connection*/
 	PQfinish(conn);	
 
@@ -2426,6 +2432,9 @@
 /* Step 7. PrintResultMessage */
 void PrintResultMessage(int sucessful)
 {
+	if(outmode == MODE_QUIET)
+		return;
+
 	if(sucessful == 1)
 	{
 		//sucessful

Modified: branches/gSoC2007_raster/pgraster/pgraster2geotiff.c
===================================================================
--- branches/gSoC2007_raster/pgraster/pgraster2geotiff.c	2007-08-20 01:57:53 UTC (rev 2697)
+++ branches/gSoC2007_raster/pgraster/pgraster2geotiff.c	2007-08-20 17:43:43 UTC (rev 2698)
@@ -128,7 +128,7 @@
 uint16 fillorder = FILLORDER_MSB2LSB ;
 byte tiff_bigendian = 0; // whether TIFF file uses big endian byte order.
 byte badIndians = 0; // whether TIFFBigEndian != big_endian
-byte hasAlpha = 0; // hasAlpha channel???
+byte hasAlpha = 0; // hasAlpha channel???beginTransaction
 uint32 rows = 0; // number of TIFF image rows
 uint32 cols = 0; // number of TIFF image column
 uint32 bands = 0; // number of raster bands (image channel)
@@ -353,10 +353,8 @@
 	fprintf(out," -k  			Keep postgresql identifiers case.\n");
     fprintf(out," -?/--help 	Display this help screen.\n");
 
-	fprintf(out," -q  Load data in quiet mode.\n");
+	fprintf(out," -q | -v  Export data in quiet | verbose mode.\n");
 
-	fprintf(out," -v  Load data in verbose mode.\n");
-
     fprintf(out,"\n");
 
 	fprintf(out,"(Note that -a, -c, -d and -p are mutually exclusive.)\n");	
@@ -465,7 +463,7 @@
 			geotiff_file = ARGV[optind];
 			parse_geotiffname(geotiff_file);
 		}
-		curindex++;		
+		curindex++;	
     }
 
 	/* 
@@ -557,10 +555,10 @@
  */
 static void exit_nicely(PGconn *conn, int code)
 {
-	if(beginTransaction == TRUE)
+
+	if(code != 0)
 	{
-		res = PQexec(conn, "ROLLBACK");
-		PQclear(res);
+		_CleanUpDemo();
 	}
 
 	/* Close GeoTIFF File */
@@ -1303,27 +1301,203 @@
 	TIFFSetField(tif,TIFFTAG_ROWSPERSTRIP,  rowsperstrip);
 	TIFFSetField(tif,TIFFTAG_FILLORDER, 	fillorder);
 	TIFFSetField(tif,TIFFTAG_GEOPIXELSCALE, 3,pixscale);
+	TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
 }
 
 //XXX: NOT FINISHED
 void _SetUpGeoKeys(GTIF *gtif)
 {
-	// Should we read information from spatial_ref_sys 
-	// and parase them from the text???
-	GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelGeographic);
-	GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
-	GTIFKeySet(gtif, GTCitationGeoKey, TYPE_ASCII, 0, "Unknown GTCitationGeoKey");
-	GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT,  1, KvUserDefined);
-	GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII, 0, "Unknow GeogCitationGeoKey");
-	GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT,  1, Angular_Degree);
-	GTIFKeySet(gtif, GeogLinearUnitsGeoKey, TYPE_SHORT,  1, Linear_Meter);
-	GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT,     1, KvUserDefined);
-	GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT,     1, Ellipse_Everest_1830_1967_Definition);
-	GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, (double)6377298.556);
-	GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017);
 
-	//
+
+	short nCode = SRID;  // 4127
+	char* pszEPSGName = NULL;
+	short pnUOMLengthCode = -1;
+	short pnGeogCS = -1;
+	short pnProjectionCSCode = -1;
+	int result = GTIFGetPCSInfo ( nCode, &pszEPSGName,
+                            &pnProjectionCSCode, 
+                            &pnUOMLengthCode, &pnGeogCS );
+
+#ifdef DEBUG
+	printf("nCode: %d, pszEPSGName: %s, pnProjectionCSCode: %d, pnGeogCS: %d \n", nCode,pszEPSGName,pnProjectionCSCode, (int)pnGeogCS);
+#endif
+
+	if(	pnProjectionCSCode != -1 || pszEPSGName != NULL) // Projection CS
+	{
+		GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelProjected);
+		GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
 		
+		// Set Projection CS information
+		{
+			char* pszUOMName = NULL;
+			double dfInMeters = -1.0f;
+			//char* pszProjTRFName = NULL;
+			//short nProjectMethod = -1;
+			//double adfProjParms[7];
+			
+			GTIFKeySet(gtif, ProjectedCSTypeGeoKey, TYPE_SHORT, 1, nCode);
+			GTIFKeySet(gtif, PCSCitationGeoKey, TYPE_ASCII, 0, pszEPSGName);
+			GTIFKeySet(gtif, ProjectionGeoKey, TYPE_SHORT, 1, pnProjectionCSCode); 
+
+			result = GTIFGetUOMLengthInfo( pnUOMLengthCode,
+                                 			&pszUOMName,
+                                  			&dfInMeters );
+			GTIFKeySet(gtif, ProjLinearUnitsGeoKey, TYPE_SHORT, 1, pnUOMLengthCode);
+			GTIFKeySet(gtif, ProjLinearUnitSizeGeoKey, TYPE_DOUBLE, 1, 	dfInMeters);
+
+			/*
+			result = GTIFGetProjTRFInfo( pnProjectionCSCode,
+                                	 &pszProjTRFName,
+                                	 &nProjectMethod,
+                                	 adfProjParms );
+			GTIFKeySet(gtif, ProjCoordTransGeoKey, TYPE_SHORT, 1, nProjectMethod);
+			*/
+			
+			//Free memeory
+			GTIFFreeMemory(pszUOMName);
+			//GTIFFreeMemory(pszProjTRFName);
+		}
+
+		// Set Geographic CS Information.
+		{
+			char *pszName = NULL;
+        	short pnDatum = -1;
+			short pnPM = -1;
+			short pnUOMAngle = -1;
+			char* pszDatumName = NULL;
+			short nEllipsoid = -1;
+			char* pszEllipsoidName = NULL;
+			double pdfSemiMajor = -1.0f;
+			double pdfSemiMinor = -1.0f;
+			char* pszUOMName = NULL;
+			double dfInDegrees = 1.0f;
+
+			result = GTIFGetGCSInfo ( pnGeogCS, &pszName, &pnDatum, &pnPM, &pnUOMAngle );
+
+			if(pnDatum < 0 || pszName != NULL) 
+			{
+				//GTIFGetGCSInfo	
+				{					
+					GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT,  1, pnGeogCS);
+					GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII, 0, pszName);
+					GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, pnDatum);
+					GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT,  1, pnUOMAngle);
+					GTIFKeySet(gtif, GeogPrimeMeridianGeoKey, TYPE_SHORT, 1, pnPM);
+				}
+
+				// How to set GeogLinearUnitsGeoKey (By Default)
+				{
+					GTIFKeySet(gtif, GeogLinearUnitsGeoKey, TYPE_SHORT,  1, Linear_Meter);
+					GTIFKeySet(gtif, GeogLinearUnitSizeGeoKey, TYPE_DOUBLE,  1, 1.0);
+
+					result = GTIFGetUOMAngleInfo( pnUOMAngle,
+                                 &pszUOMName,
+                                 &dfInDegrees );
+					GTIFKeySet(gtif, GeogAngularUnitSizeGeoKey, TYPE_DOUBLE,  1, dfInDegrees);
+				}
+		
+				// GTIFGetDatumInfo & GTIFGetEllipsoidInfo  
+				{				
+					result = GTIFGetDatumInfo( pnDatum, &pszDatumName, &nEllipsoid );
+					GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1, nEllipsoid);
+				
+					result = GTIFGetEllipsoidInfo( nEllipsoid, &pszEllipsoidName,
+                                  &pdfSemiMajor,
+                                  &pdfSemiMinor );
+					GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, pdfSemiMajor);
+					GTIFKeySet(gtif, GeogSemiMinorAxisGeoKey, TYPE_DOUBLE, 1, pdfSemiMinor);
+				}
+				
+				// Others
+				{
+					//GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017);
+				}			
+			}
+			else 
+			{			
+				if(outmode != MODE_QUIET)
+					fprintf(stderr, "User defined geographic coordinate system.!\n");
+			}
+
+			// Free Memory
+			GTIFFreeMemory(pszName);
+			GTIFFreeMemory(pszEllipsoidName);
+			GTIFFreeMemory(pszDatumName);
+			GTIFFreeMemory(pszUOMName);
+		}
+	}
+	else
+	{
+		char *pszName = NULL;
+        short pnDatum = -1;
+		short pnPM = -1;
+		short pnUOMAngle = -1;
+		char* pszDatumName = NULL;
+		short nEllipsoid = -1;
+		char* pszEllipsoidName = NULL;
+		double pdfSemiMajor = -1.0f;
+		double pdfSemiMinor = -1.0f;
+		char* pszUOMName = NULL;
+		double dfInDegrees = 1.0f;
+
+		result = GTIFGetGCSInfo ( nCode, &pszName, &pnDatum, &pnPM, &pnUOMAngle );
+
+		if(pszName != NULL) // Geographic CS
+		{
+			//GTIFGetGCSInfo	
+			{
+				GTIFKeySet(gtif, GTModelTypeGeoKey, TYPE_SHORT, 1, ModelGeographic);
+				GTIFKeySet(gtif, GTRasterTypeGeoKey, TYPE_SHORT, 1, RasterPixelIsArea);
+				GTIFKeySet(gtif, GTCitationGeoKey, TYPE_ASCII, 0, pszName);
+				GTIFKeySet(gtif, GeographicTypeGeoKey, TYPE_SHORT,  1, nCode);
+				GTIFKeySet(gtif, GeogCitationGeoKey, TYPE_ASCII, 0, pszName);
+				GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT, 1, pnDatum);
+				GTIFKeySet(gtif, GeogAngularUnitsGeoKey, TYPE_SHORT,  1, pnUOMAngle);
+				GTIFKeySet(gtif, GeogPrimeMeridianGeoKey, TYPE_SHORT, 1, pnPM);
+			}
+			
+			// How to set GeogLinearUnitsGeoKey (By Default)
+			{
+				GTIFKeySet(gtif, GeogLinearUnitsGeoKey, TYPE_SHORT,  1, Linear_Meter);
+				GTIFKeySet(gtif, GeogLinearUnitSizeGeoKey, TYPE_DOUBLE,  1, 1.0);
+
+				result = GTIFGetUOMAngleInfo( pnUOMAngle,
+                                 &pszUOMName,
+                                 &dfInDegrees );
+				GTIFKeySet(gtif, GeogAngularUnitSizeGeoKey, TYPE_DOUBLE,  1, dfInDegrees);
+			}
+			
+			// GTIFGetDatumInfo & GTIFGetEllipsoidInfo  
+			{				
+				result = GTIFGetDatumInfo( pnDatum, &pszDatumName, &nEllipsoid );
+				GTIFKeySet(gtif, GeogEllipsoidGeoKey, TYPE_SHORT, 1, nEllipsoid);
+				
+				result = GTIFGetEllipsoidInfo( nEllipsoid, &pszEllipsoidName,
+                                  &pdfSemiMajor,
+                                  &pdfSemiMinor );
+				GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, pdfSemiMajor);
+				GTIFKeySet(gtif, GeogSemiMinorAxisGeoKey, TYPE_DOUBLE, 1, pdfSemiMinor);
+			}
+
+			// Others
+			{
+				//GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017);
+			}
+			
+		}
+		else // Invalide SRID
+		{
+			if(outmode != MODE_QUIET)
+				fprintf(stderr, "User defined geographic coordinate system.!\n");
+		}
+
+		// Free Memory
+		GTIFFreeMemory(pszName);
+		GTIFFreeMemory(pszEllipsoidName);
+		GTIFFreeMemory(pszDatumName);
+		GTIFFreeMemory(pszUOMName);
+	}
+		
 }
 
 void _WriteGeoTIFFHeader()
@@ -1383,22 +1557,13 @@
 void WriteTIFFData()
 {
 
-/*
- *	int i;
-	char buffer[WIDTH];
-	
-	memset(buffer,0,(size_t)WIDTH);
-	for (i=0;i<HEIGHT;i++)
-		if (!TIFFWriteScanline(tif, buffer, i, 0))
-			TIFFError("WriteImage","failure in WriteScanline\n");
- */
 	char *exptStmt = malloc(strlen(schema)+1+strlen(table));
 	char query[QUERY_BUF_LENGTH];
 	const char *paramValues[2];
 	int         paramLengths[2];
 	int         paramFormats[2];
 	char *buffer = NULL;
-	int i=0,j=0,k=0,n=0;
+	int i=0,j=0,k=0,n=0,m=0;
 	_uint32 curBlockRow,curBlockBand;
 	_uint32 rowsReturned = 0;
 	_uint32 rowsToRead = 0;
@@ -1415,11 +1580,6 @@
 		stripMax = rows / rowsperstrip;
 	else
 		stripMax = rows / rowsperstrip + 1;
-
-#ifdef DEBUG
-	printf("nTIFFBytePerPixel:%d, rowsperstrip: %d, stripMax: %d, stripsize: %d\n", 
-			nTIFFBytePerPixel, rowsperstrip,stripMax,  stripsize);
-#endif
 	
 	memcpy(exptStmt, schema, strlen(schema));
 	exptStmt[strlen(schema)] = '_';
@@ -1496,15 +1656,11 @@
 			for(k = 0; k < rowsReturned; k++)
 			{
 				_uint32 realBlockColumnNumber = _ntohl(*((_uint32*)PQgetvalue(res,k,4)));
-				_uint32 realBlockBandSize = _ntohl(*((_uint32*)PQgetvalue(res,k,5)));
+				//_uint32 realBlockBandSize = _ntohl(*((_uint32*)PQgetvalue(res,k,5)));
 				_uint32 realBlockRowSize = _ntohl(*((_uint32*)PQgetvalue(res,k,6)));
 				_uint32 realBlockColumnSize = _ntohl(*((_uint32*)PQgetvalue(res,k,7)));
-				byte* pQData = PQgetvalue(res,k,9);
-#ifdef DEBUG
-				printf("realBlockColumnNumber: %d    ", realBlockColumnNumber);
-				printf("realBlockBandSize: %d    ", realBlockBandSize);
-				printf("realBlockRowSize: %d    \n", realBlockRowSize);
-#endif
+				byte* pQData = (byte*)(PQgetvalue(res,k,9));
+
 				for(n=0; n < realBlockRowSize; n++)
 				{
 					//fill data buffer
@@ -1515,17 +1671,22 @@
 			PQclear(res);
 		}
 
-		// flush data buffer to TIFF scanline
-		if( TIFFWriteEncodedStrip( tif, i, buffer,
-                                   nTIFFBytePerPixel * rowsToRead * cols ) == -1 )
+		
+		for (m=0; m < rowsToRead;m++)
 		{
-			// Write Failed.
-			if(outmode != MODE_QUIET)
-				fprintf(stderr, "**Error** when trying to write raster data to GeoTIFF file.");
-			exit_nicely(conn, 1);
+			if (!TIFFWriteScanline(tif, buffer+m*cols*nTIFFBytePerPixel, m+i*rowsperstrip, 0))
+			{
+				if(outmode != MODE_QUIET)
+				{
+					fprintf(stderr, "**Error** when writing TIFF data to file.\n");
+				}
+				exit_nicely(conn,1);
+			}
 		}
 	}
 
+	// Free Data Buffer
+	free(buffer);
 }
 
 void Cleanup()
@@ -1541,6 +1702,9 @@
 
 void PrintResultMessage(int sucessful)
 {
+	if(outmode == MODE_QUIET)
+		return;
+
 	if(sucessful == 1)
 	{
 		//sucessful

Added: branches/gSoC2007_raster/pgraster/win32/build/SP27GTIF.TIF
===================================================================
(Binary files differ)


Property changes on: branches/gSoC2007_raster/pgraster/win32/build/SP27GTIF.TIF
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: branches/gSoC2007_raster/pgraster/win32/build/cea.tif
===================================================================
(Binary files differ)


Property changes on: branches/gSoC2007_raster/pgraster/win32/build/cea.tif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: branches/gSoC2007_raster/pgraster/win32/build/geotiff2pgraster.exe
===================================================================
(Binary files differ)

Modified: branches/gSoC2007_raster/pgraster/win32/build/pgraster2geotiff.exe
===================================================================
(Binary files differ)



More information about the postgis-commits mailing list