[mapserver-commits] r8723 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Mar 9 15:29:39 EDT 2009


Author: warmerdam
Date: 2009-03-09 15:29:36 -0400 (Mon, 09 Mar 2009)
New Revision: 8723

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapgdal.c
Log:
added resolution to GDAL writing support (2891)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-03-09 19:27:55 UTC (rev 8722)
+++ trunk/mapserver/HISTORY.TXT	2009-03-09 19:29:36 UTC (rev 8723)
@@ -14,6 +14,8 @@
 
 - Added resolution writing in image files (#2891)
 
+- Try to save resolution values to GeoTIFF via GDAL (#2891)
+
 - Refactor legend icon drawing (remove renderer specific versions)
   Add label styling or markers for annotation layer legend icons (#2917)
 

Modified: trunk/mapserver/mapgdal.c
===================================================================
--- trunk/mapserver/mapgdal.c	2009-03-09 19:27:55 UTC (rev 8722)
+++ trunk/mapserver/mapgdal.c	2009-03-09 19:29:36 UTC (rev 8723)
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id:$
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Implementation of support for output using GDAL.
@@ -402,6 +402,19 @@
     }
 
 /* -------------------------------------------------------------------- */
+/*  Try to save resolution in the output file.                          */
+/* -------------------------------------------------------------------- */
+    if( image->resolution <= 0 )
+    {
+      char res[30];
+
+      sprintf( res, "%d", image->resolution );
+      GDALSetMetadataItem( hMemDS, "TIFFTAG_XRESOLUTION", res, NULL );
+      GDALSetMetadataItem( hMemDS, "TIFFTAG_YRESOLUTION", res, NULL );
+      GDALSetMetadataItem( hMemDS, "TIFFTAG_RESOLUTIONUNIT", "2", NULL );
+    }
+    
+/* -------------------------------------------------------------------- */
 /*      Create a disk image in the selected output format from the      */
 /*      memory image.                                                   */
 /* -------------------------------------------------------------------- */



More information about the mapserver-commits mailing list