[mapserver-commits] r9458 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Oct 14 15:38:21 EDT 2009


Author: sdlime
Date: 2009-10-14 15:38:17 -0400 (Wed, 14 Oct 2009)
New Revision: 9458

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapfile.c
Log:
Make sure layer extent (if set) is written when a mapfile is saved. Also made sure all extent and feature points writing in mapfile.c uses the same printf format to avoid scientific notation. (#2969)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-10-14 17:49:18 UTC (rev 9457)
+++ trunk/mapserver/HISTORY.TXT	2009-10-14 19:38:17 UTC (rev 9458)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Make sure layer extents are saved when a mapfile is written (#2969)
+
 - Fixed CurvePolygons from oracle not drawn (#2772)
 
 - Fixed raster queries (broken by RFC 52 changes) (#3166)

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2009-10-14 17:49:18 UTC (rev 9457)
+++ trunk/mapserver/mapfile.c	2009-10-14 19:38:17 UTC (rev 9458)
@@ -743,7 +743,7 @@
   for(i=0; i<shape->numlines; i++) {
     fprintf(stream, "      POINTS\n");
     for(j=0; j<shape->line[i].numpoints; j++)
-      fprintf(stream, "        %g %g\n", shape->line[i].point[j].x, shape->line[i].point[j].y);
+      fprintf(stream, "        %.15g %.15g\n", shape->line[i].point[j].x, shape->line[i].point[j].y);
     fprintf(stream, "      END\n");
   }
 
@@ -3429,6 +3429,9 @@
   }
   if(layer->debug) fprintf(stream, "    DEBUG %d\n", layer->debug);
   if(layer->dump) fprintf(stream, "    DUMP TRUE\n");
+  
+  if(layer->extent.minx != -1 && layer->extent.maxx != -1 && layer->extent.miny != -1 && layer->extent.maxy != -1)
+    fprintf(stream, "    EXTENT %.15g %.15g %.15g %.15g\n", layer->extent.minx, layer->extent.miny, layer->extent.maxx, layer->extent.maxy);  
 
   if(layer->filter.string) {
     fprintf(stream, "      FILTER ");
@@ -3648,7 +3651,7 @@
 
   fprintf(stream, "  REFERENCE\n");
   fprintf(stream, "    COLOR %d %d %d\n", ref->color.red, ref->color.green, ref->color.blue);
-  fprintf(stream, "    EXTENT %g %g %g %g\n", ref->extent.minx, ref->extent.miny, ref->extent.maxx, ref->extent.maxy);
+  fprintf(stream, "    EXTENT %.15g %.15g %.15g %.15g\n", ref->extent.minx, ref->extent.miny, ref->extent.maxx, ref->extent.maxy);
   fprintf(stream, "    IMAGE \"%s\"\n", ref->image);
   fprintf(stream, "    OUTLINECOLOR %d %d %d\n", ref->outlinecolor.red, ref->outlinecolor.green, ref->outlinecolor.blue);
   fprintf(stream, "    SIZE %d %d\n", ref->width, ref->height);
@@ -4310,7 +4313,7 @@
   if(web->error) fprintf(stream, "    ERROR \"%s\"\n", web->error);
 
   if(MS_VALID_EXTENT(web->extent)) 
-    fprintf(stream, "  EXTENT %g %g %g %g\n", web->extent.minx, web->extent.miny, web->extent.maxx, web->extent.maxy);
+    fprintf(stream, "  EXTENT %.15g %.15g %.15g %.15g\n", web->extent.minx, web->extent.miny, web->extent.maxx, web->extent.maxy);
 
   if(web->footer) fprintf(stream, "    FOOTER \"%s\"\n", web->footer);
   if(web->header) fprintf(stream, "    HEADER \"%s\"\n", web->header);



More information about the mapserver-commits mailing list