[Git][debian-gis-team/mapserver][upstream] New upstream version 7.6.2

Bas Couwenberg gitlab at salsa.debian.org
Tue Dec 8 05:02:05 GMT 2020



Bas Couwenberg pushed to branch upstream at Debian GIS Project / mapserver


Commits:
55896115 by Bas Couwenberg at 2020-12-08T05:18:43+01:00
New upstream version 7.6.2
- - - - -


26 changed files:

- + .github/workflows/check-crlf.yml
- CMakeLists.txt
- HISTORY.TXT
- INSTALL.CMAKE
- MIGRATION_GUIDE.txt
- README.rst
- cmake/FindOracle.cmake
- cmake/FindProj.cmake
- fontcache.c
- mapcontour.c
- mapgdal.c
- + mapgdal.h
- mapproject.c
- mapscript/csharp/Makefile.vc
- mapscript/csharp/examples/drawmapDirect.cs
- mapscript/csharp/examples/drawmapDirectPrint.cs
- mapscript/csharp/examples/inline.cs
- maptemplate.c
- maptile.h
- mapwcs11.c
- mapwcs20.c
- mapwmslayer.c
- renderers/agg/include/agg_conv_clipper.h
- renderers/agg/include/clipper.hpp
- renderers/agg/src/clipper.cpp
- version.rc.in


Changes:

=====================================
.github/workflows/check-crlf.yml
=====================================
@@ -0,0 +1,20 @@
+# check for Windows CRLF in files
+# homepage: https://github.com/marketplace/actions/check-crlf
+
+name: Check CRLF
+
+on: [push, pull_request]
+
+jobs:
+  Check-CRLF:
+    name: verify that only LF linefeeds are used
+    runs-on: ubuntu-18.04
+
+    steps:
+      - name: Checkout repository contents
+        uses: actions/checkout at v1
+
+      - name: Use action to check for CRLF endings
+        uses: erclu/check-crlf at v1.1.2
+        with: # ignore directories containing *.pdf and *.tab
+          exclude: msautotest/misc/data/ /msautotest/renderers/expected/
\ No newline at end of file


=====================================
CMakeLists.txt
=====================================
@@ -17,7 +17,7 @@ include(CheckCSourceCompiles)
 
 set (MapServer_VERSION_MAJOR 7)
 set (MapServer_VERSION_MINOR 6)
-set (MapServer_VERSION_REVISION 1)
+set (MapServer_VERSION_REVISION 2)
 set (MapServer_VERSION_SUFFIX "")
 
 # Set C++ version


=====================================
HISTORY.TXT
=====================================
@@ -12,6 +12,11 @@ For a complete change history, please see the Git log comments.  For more
 details about recent point releases, please see the online changelog at:
 http://mapserver.org/development/changelog/
 
+7.6.2 release (2020-12-07)
+-------------------------
+
+- No major changes, see detailed changelog for bug fixes
+
 7.6.1 release (2020-07-31)
 -------------------------
 


=====================================
INSTALL.CMAKE
=====================================
@@ -12,9 +12,8 @@ build utilities (make on unixes, visual studio on windows, xcode on osx, etc...)
 Install CMake
 -------------
 
-MapServer requires at least CMake version 2.6.0, although the build process with
-such an old version has not been thouroughly tested. 2.8.0 and above are 
-recommended.
+MapServer now requires at least CMake version 3.0, although the CMake process was
+first implemented in MapServer 6.4 with CMake 2.6.0.
 
 Distro Packaged Version
 .......................


=====================================
MIGRATION_GUIDE.txt
=====================================
@@ -3,12 +3,13 @@ MapServer Migration Guide
 *****************************************************************************
 
 The current version of the MapServer Migration Guide is available online
-at http://www.mapserver.org/MIGRATION_GUIDE.html.
+at https://mapserver.org/MIGRATION_GUIDE.html.
 
 
 For developers:
 
 The master copy of the MIGRATION_GUIDE is now located in the root of the 
-mapserver/docs source tree (https://github.com/mapserver/docs). Developers
-are welcome and encouraged to edit/update the guide in the docs tree directly.
+/MapServer/MapServer-documentation source tree ( https://github.com/MapServer/MapServer-documentation ). 
+Developers are welcome and encouraged to edit/update the guide in the documentation 
+tree directly.
 


=====================================
README.rst
=====================================
@@ -13,9 +13,9 @@ respond to a variety of spatial requests like making maps, scalebars,
 and point, area and feature queries. Virtually all aspects of an 
 application, from web interface to map appearance can be developed 
 without any programming. For the more ambitious user, MapServer 
-applications can be enhanced using Java, JavaScript or many other web 
-technologies. For more  information and complete documentation please 
-visit:
+applications can be enhanced using Python, PHP, Java, JavaScript or 
+many other web technologies. For more  information and complete 
+documentation please visit:
 
   https://mapserver.org/
 
@@ -23,7 +23,7 @@ Bug reports and enhancement submissions can be reported in the MapServer
 issue tracker at the following url.   If you do make changes and/or enhancements, 
 please let us know so that they might be incorporated into future releases.
 
-  https://github.com/mapserver/mapserver/issues
+  https://github.com/MapServer/MapServer/issues
 
 
 Join the MapServer user mailing list online at:
@@ -91,8 +91,8 @@ License
   SOFTWARE.
 
 
-.. |Build Status| image:: https://travis-ci.org/mapserver/mapserver.svg?branch=master
-   :target: https://travis-ci.org/mapserver/mapserver
+.. |Build Status| image:: https://travis-ci.com/MapServer/MapServer.svg?branch=master
+   :target: https://travis-ci.com/MapServer/MapServer
 
 .. |Appveyor Build Status| image:: https://ci.appveyor.com/api/projects/status/vw1n07095a8bg23u?svg=true
    :target: https://ci.appveyor.com/project/mapserver/mapserver


=====================================
cmake/FindOracle.cmake
=====================================
@@ -37,7 +37,7 @@ if(DEFINED ENV{ORACLE_HOME})
     ${ORACLE_HOME}/OCI/include) # Oracle XE on Windows
 
   set(ORACLE_OCI_NAMES clntsh libclntsh oci)
-  set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 nnz12 libnnz12 nnz18 libnnz18 ociw32)
+  set(ORACLE_NNZ_NAMES nnz10 libnnz10 nnz11 libnnz11 nnz12 libnnz12 nnz18 libnnz18 ociw32 nnz19 libnnz19)
   set(ORACLE_OCCI_NAMES libocci occi oraocci10 oraocci11 oraocci12)
 
   set(ORACLE_LIB_DIR 


=====================================
cmake/FindProj.cmake
=====================================
@@ -1,40 +1,40 @@
-# Find Proj
-#
-# If it's found it sets PROJ_FOUND to TRUE
-# and following variables are set:
-#    PROJ_INCLUDE_DIR
-#    PROJ_LIBRARY
-
-
-FIND_PATH(PROJ_INCLUDE_DIR proj_api.h)
-
-FIND_LIBRARY(PROJ_LIBRARY NAMES proj proj_i)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PROJ DEFAULT_MSG PROJ_LIBRARY PROJ_INCLUDE_DIR)
-mark_as_advanced(PROJ_LIBRARY PROJ_INCLUDE_DIR)
-
-
-IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
-   SET(PROJ_FOUND TRUE)
-ENDIF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
-
-IF (PROJ_FOUND)
-   IF (EXISTS ${PROJ_INCLUDE_DIR}/proj.h)
-     FILE(READ ${PROJ_INCLUDE_DIR}/proj.h proj_version)
-     STRING(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${proj_version}")
-     STRING(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${proj_version}")
-     STRING(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${proj_version}")
-
-     MESSAGE(STATUS "Found Proj ${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}")
-
-     IF ((PROJ_VERSION_MAJOR EQUAL 6) AND (PROJ_VERSION_MINOR EQUAL 3) AND (PROJ_VERSION_PATCH EQUAL 0))
-        MESSAGE (FATAL_ERROR "MapServer known to crash with PROJ 6.3.0. Use 6.3.1 or higher.")
-     ENDIF ((PROJ_VERSION_MAJOR EQUAL 6) AND (PROJ_VERSION_MINOR EQUAL 3) AND (PROJ_VERSION_PATCH EQUAL 0))
-
-     ADD_DEFINITIONS(-DPROJ_VERSION_MAJOR=${PROJ_VERSION_MAJOR})
-  ELSE()
-     MESSAGE(STATUS "Found Proj 4.x")
-     ADD_DEFINITIONS(-DPROJ_VERSION_MAJOR=4)
-  ENDIF()
-ENDIF (PROJ_FOUND)
+# Find Proj
+#
+# If it's found it sets PROJ_FOUND to TRUE
+# and following variables are set:
+#    PROJ_INCLUDE_DIR
+#    PROJ_LIBRARY
+
+
+FIND_PATH(PROJ_INCLUDE_DIR proj_api.h)
+
+FIND_LIBRARY(PROJ_LIBRARY NAMES proj proj_i)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PROJ DEFAULT_MSG PROJ_LIBRARY PROJ_INCLUDE_DIR)
+mark_as_advanced(PROJ_LIBRARY PROJ_INCLUDE_DIR)
+
+
+IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
+   SET(PROJ_FOUND TRUE)
+ENDIF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
+
+IF (PROJ_FOUND)
+   IF (EXISTS ${PROJ_INCLUDE_DIR}/proj.h)
+     FILE(READ ${PROJ_INCLUDE_DIR}/proj.h proj_version)
+     STRING(REGEX REPLACE "^.*PROJ_VERSION_MAJOR +([0-9]+).*$" "\\1" PROJ_VERSION_MAJOR "${proj_version}")
+     STRING(REGEX REPLACE "^.*PROJ_VERSION_MINOR +([0-9]+).*$" "\\1" PROJ_VERSION_MINOR "${proj_version}")
+     STRING(REGEX REPLACE "^.*PROJ_VERSION_PATCH +([0-9]+).*$" "\\1" PROJ_VERSION_PATCH "${proj_version}")
+
+     MESSAGE(STATUS "Found Proj ${PROJ_VERSION_MAJOR}.${PROJ_VERSION_MINOR}")
+
+     IF ((PROJ_VERSION_MAJOR EQUAL 6) AND (PROJ_VERSION_MINOR EQUAL 3) AND (PROJ_VERSION_PATCH EQUAL 0))
+        MESSAGE (FATAL_ERROR "MapServer known to crash with PROJ 6.3.0. Use 6.3.1 or higher.")
+     ENDIF ((PROJ_VERSION_MAJOR EQUAL 6) AND (PROJ_VERSION_MINOR EQUAL 3) AND (PROJ_VERSION_PATCH EQUAL 0))
+
+     ADD_DEFINITIONS(-DPROJ_VERSION_MAJOR=${PROJ_VERSION_MAJOR})
+  ELSE()
+     MESSAGE(STATUS "Found Proj 4.x")
+     ADD_DEFINITIONS(-DPROJ_VERSION_MAJOR=4)
+  ENDIF()
+ENDIF (PROJ_FOUND)


=====================================
fontcache.c
=====================================
@@ -194,6 +194,10 @@ unsigned int msGetGlyphIndex(face_element *face, unsigned int unicode) {
   if(face->face->charmap && face->face->charmap->encoding == FT_ENCODING_MS_SYMBOL) {
     unicode |= 0xf000; /* why? */
   }
+#ifdef USE_THREAD
+  if (use_global_ft_cache)
+	  msAcquireLock(TLOCK_TTF);
+#endif   
   UT_HASH_FIND_INT(face->index_cache,&unicode,ic);
   if(!ic) {
     ic = msSmallMalloc(sizeof(index_element));
@@ -201,6 +205,10 @@ unsigned int msGetGlyphIndex(face_element *face, unsigned int unicode) {
     ic->unicode = unicode;
     UT_HASH_ADD_INT(face->index_cache,unicode,ic);
   }
+#ifdef USE_THREAD
+  if (use_global_ft_cache)
+	  msReleaseLock(TLOCK_TTF);
+#endif  
   return ic->codepoint;
 }
 
@@ -267,6 +275,10 @@ glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned
   memset(&key,0,sizeof(glyph_element_key));
   key.codepoint = codepoint;
   key.size = size;
+#ifdef USE_THREAD
+  if (use_global_ft_cache)
+    msAcquireLock(TLOCK_TTF);
+#endif   
   UT_HASH_FIND(hh,face->glyph_cache,&key,sizeof(glyph_element_key),gc);
   if(!gc) {
     FT_Error error;
@@ -278,6 +290,10 @@ glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned
     if(error) {
       msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphByIndex()",key.codepoint, face->font);
       free(gc);
+#ifdef USE_THREAD
+      if (use_global_ft_cache)
+        msReleaseLock(TLOCK_TTF);
+#endif      
       return NULL;
     }
     gc->metrics.minx = face->face->glyph->metrics.horiBearingX / 64.0;
@@ -288,6 +304,10 @@ glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned
     gc->key = key;
     UT_HASH_ADD(hh,face->glyph_cache,key,sizeof(glyph_element_key), gc);
   }
+#ifdef USE_THREAD
+  if (use_global_ft_cache)
+    msReleaseLock(TLOCK_TTF);
+#endif  
   return gc;
 }
 


=====================================
mapcontour.c
=====================================
@@ -446,6 +446,17 @@ static int msContourLayerReadRaster(layerObj *layer, rectObj rect)
     return MS_FAILURE;
   }
 
+  {
+      // Copy nodata value from source dataset to memory dataset
+      int bHasNoData = FALSE;
+      double dfNoDataValue = GDALGetRasterNoDataValue(hBand, &bHasNoData);
+      if( bHasNoData )
+      {
+          GDALSetRasterNoDataValue(GDALGetRasterBand(clinfo->hDS, 1),
+                                   dfNoDataValue);
+      }
+  }
+
   adfGeoTransform[0] = copyRect.minx;
   adfGeoTransform[1] = dst_cellsize_x;
   adfGeoTransform[2] = 0;
@@ -533,6 +544,8 @@ static int msContourLayerGenerateContour(layerObj *layer)
   int levelCount = 0;
   GDALRasterBandH hBand = NULL;
   CPLErr eErr;
+  int bHasNoData = FALSE;
+  double dfNoDataValue;
 
   contourLayerInfo *clinfo = (contourLayerInfo *) layer->layerinfo;
 
@@ -613,10 +626,12 @@ static int msContourLayerGenerateContour(layerObj *layer)
     CSLDestroy(levelsTmp);
     free(option);
   }
-    
+
+  dfNoDataValue = GDALGetRasterNoDataValue(hBand, &bHasNoData);
+
   eErr = GDALContourGenerate( hBand, interval, 0.0,
                               levelCount, levels,
-                              FALSE, 0.0, hLayer,
+                              bHasNoData, dfNoDataValue, hLayer,
                               OGR_FD_GetFieldIndex(OGR_L_GetLayerDefn( hLayer),
                                                     "ID" ),
                               (elevItem == NULL) ? -1 :


=====================================
mapgdal.c
=====================================
@@ -29,6 +29,7 @@
 
 #include "mapserver.h"
 #include "mapthread.h"
+#include "mapgdal.h"
 #include <assert.h>
 
 
@@ -184,11 +185,7 @@ int msSaveImageGDAL( mapObj *map, imageObj *image, const char *filenameIn )
       pszExtension = "img.tmp";
 
     if( bUseXmp == MS_FALSE &&
-        GDALGetMetadataItem( hOutputDriver, GDAL_DCAP_VIRTUALIO, NULL ) != NULL &&
-        /* We need special testing here for the netCDF driver, since recent */
-        /* GDAL versions advertize VirtualIO support, but this is only for the */
-        /* read-side of the driver, not the write-side. */
-        !EQUAL(gdal_driver_shortname, "netCDF") ) {
+        msGDALDriverSupportsVirtualIOOutput(hOutputDriver) ) {
       msCleanVSIDir( "/vsimem/msout" );
       filenameToFree = msTmpFile(map, NULL, "/vsimem/msout/", pszExtension );
     }
@@ -653,4 +650,15 @@ char *msProjectionObj2OGCWKT( projectionObj *projection )
     return NULL;
 }
 
+/************************************************************************/
+/*                    msGDALDriverSupportsVirtualIOOutput()             */
+/************************************************************************/
 
+int msGDALDriverSupportsVirtualIOOutput( GDALDriverH hDriver )
+{
+    /* We need special testing here for the netCDF driver, since recent */
+    /* GDAL versions advertize VirtualIO support, but this is only for the */
+    /* read-side of the driver, not the write-side. */
+    return GDALGetMetadataItem( hDriver, GDAL_DCAP_VIRTUALIO, NULL ) != NULL &&
+           !EQUAL(GDALGetDescription(hDriver), "netCDF");
+}


=====================================
mapgdal.h
=====================================
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * $Id$
+ *
+ * Project:  MapServer
+ * Purpose:  GDAL interface
+ * Author:   Even Rouault <even.rouault at spatialys.com>
+ *
+ ******************************************************************************
+ * Copyright (c) 2020, Even Rouault <even.rouault at spatialys.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies of this Software or works derived from this Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ****************************************************************************/
+
+#ifndef MAPGDAL_H
+#define MAPGDAL_H
+
+#include "mapserver.h"
+#include "gdal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int msGDALDriverSupportsVirtualIOOutput( GDALDriverH hDriver );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* MAPGDAL_H */


=====================================
mapproject.c
=====================================
@@ -36,6 +36,8 @@
 #include <sys/stat.h>
 #include "mapaxisorder.h"
 
+#include "ogr_srs_api.h"
+
 static char *ms_proj_lib = NULL;
 #if PROJ_VERSION_MAJOR >= 6
 static unsigned ms_proj_lib_change_counter = 0;
@@ -2399,6 +2401,14 @@ void msSetPROJ_LIB( const char *proj_lib, const char *pszRelToPath )
 #endif
   msReleaseLock( TLOCK_PROJ );
 
+#if GDAL_VERSION_MAJOR >= 3
+  if( ms_proj_lib != NULL )
+  {
+    const char* const apszPaths[] = { ms_proj_lib, NULL };
+    OSRSetPROJSearchPaths(apszPaths);
+  }
+#endif
+
   if ( extended_path )
     msFree( extended_path );
 }


=====================================
mapscript/csharp/Makefile.vc
=====================================
@@ -13,7 +13,7 @@
 
 
 # Flag indicating to the option files that this is the build of C#/MapScript
-!INCLUDE ../../nmake.opt
+#!INCLUDE ../../nmake.opt
 
 # Be aware when setting different options for libmap.dll and mapscript.dll (Bug 1476)
 # To change the options for mapscript.dll uncomment the following line


=====================================
mapscript/csharp/examples/drawmapDirect.cs
=====================================
@@ -1,100 +1,100 @@
-/******************************************************************************
- * $Id$
- *
- * Project:  MapServer
- * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
- *           device context.
- * Author:   Tamas Szekeres, szekerest at gmail.com
- *
- ******************************************************************************
- * Copyright (c) 1996-2008 Regents of the University of Minnesota.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in 
- * all copies of this Software or works derived from this Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-using System;
-using System.Drawing;
-using System.Drawing.Imaging;
-using OSGeo.MapServer;	
-
-/// <summary>
-/// A C# based mapscript example to draw the map directly onto a GDI device context.
-/// </summary>
-class DrawMap
-{
-  public static void usage() 
-  { 
-	Console.WriteLine("usage: DrawMapDirect {mapfile} {outfile}");
-	System.Environment.Exit(-1);
-  }
-		  
-  public static void Main(string[] args)
-  {
-    Console.WriteLine("");
-	if (args.Length < 2) usage();
-    
-	mapObj map = new mapObj(args[0]);
-
-    Console.WriteLine("# Map layers " + map.numlayers + "; Map name = " + map.name);
-    for (int i = 0; i < map.numlayers; i++) 
-	{
-        Console.WriteLine("Layer [" + i + "] name: " + map.getLayer(i).name);
-	}
-
-    try
-    {
-        // Create the output format
-        outputFormatObj of = new outputFormatObj("CAIRO/WINGDI", "cairowinGDI");
-        map.appendOutputFormat(of);
-        map.selectOutputFormat("cairowinGDI");
-
-        Bitmap mapImage = new Bitmap(map.width, map.height, PixelFormat.Format32bppRgb);
-
-        using (Graphics g = Graphics.FromImage(mapImage))
-        {
-            IntPtr hdc = g.GetHdc();
-            try
-            {
-                // Attach the device to the outputformat for drawing
-                of.attachDevice(hdc);
-                // Drawing directly to the GDI context
-                using (imageObj image = map.draw()) { };
-            }
-            finally
-            {
-                of.attachDevice(IntPtr.Zero);
-                g.ReleaseHdc(hdc);
-            }
-        }
-
-        mapImage.Save(args[1]);
-    } 
-	catch (Exception ex) 
-	{
-                Console.WriteLine( "\nMessage ---\n{0}", ex.Message );
-                Console.WriteLine( 
-                    "\nHelpLink ---\n{0}", ex.HelpLink );
-                Console.WriteLine( "\nSource ---\n{0}", ex.Source );
-                Console.WriteLine( 
-                    "\nStackTrace ---\n{0}", ex.StackTrace );
-                Console.WriteLine( 
-                    "\nTargetSite ---\n{0}", ex.TargetSite );	}	
-  }
-}
-
+/******************************************************************************
+ * $Id$
+ *
+ * Project:  MapServer
+ * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
+ *           device context.
+ * Author:   Tamas Szekeres, szekerest at gmail.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1996-2008 Regents of the University of Minnesota.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in 
+ * all copies of this Software or works derived from this Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *****************************************************************************/
+
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+using OSGeo.MapServer;	
+
+/// <summary>
+/// A C# based mapscript example to draw the map directly onto a GDI device context.
+/// </summary>
+class DrawMap
+{
+  public static void usage() 
+  { 
+	Console.WriteLine("usage: DrawMapDirect {mapfile} {outfile}");
+	System.Environment.Exit(-1);
+  }
+		  
+  public static void Main(string[] args)
+  {
+    Console.WriteLine("");
+	if (args.Length < 2) usage();
+    
+	mapObj map = new mapObj(args[0]);
+
+    Console.WriteLine("# Map layers " + map.numlayers + "; Map name = " + map.name);
+    for (int i = 0; i < map.numlayers; i++) 
+	{
+        Console.WriteLine("Layer [" + i + "] name: " + map.getLayer(i).name);
+	}
+
+    try
+    {
+        // Create the output format
+        outputFormatObj of = new outputFormatObj("CAIRO/WINGDI", "cairowinGDI");
+        map.appendOutputFormat(of);
+        map.selectOutputFormat("cairowinGDI");
+
+        Bitmap mapImage = new Bitmap(map.width, map.height, PixelFormat.Format32bppRgb);
+
+        using (Graphics g = Graphics.FromImage(mapImage))
+        {
+            IntPtr hdc = g.GetHdc();
+            try
+            {
+                // Attach the device to the outputformat for drawing
+                of.attachDevice(hdc);
+                // Drawing directly to the GDI context
+                using (imageObj image = map.draw()) { };
+            }
+            finally
+            {
+                of.attachDevice(IntPtr.Zero);
+                g.ReleaseHdc(hdc);
+            }
+        }
+
+        mapImage.Save(args[1]);
+    } 
+	catch (Exception ex) 
+	{
+                Console.WriteLine( "\nMessage ---\n{0}", ex.Message );
+                Console.WriteLine( 
+                    "\nHelpLink ---\n{0}", ex.HelpLink );
+                Console.WriteLine( "\nSource ---\n{0}", ex.Source );
+                Console.WriteLine( 
+                    "\nStackTrace ---\n{0}", ex.StackTrace );
+                Console.WriteLine( 
+                    "\nTargetSite ---\n{0}", ex.TargetSite );	}	
+  }
+}
+


=====================================
mapscript/csharp/examples/drawmapDirectPrint.cs
=====================================
@@ -1,116 +1,116 @@
-/******************************************************************************
- * $Id$
- *
- * Project:  MapServer
- * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
- *           printing device context.
- * Author:   Tamas Szekeres, szekerest at gmail.com
- *
- ******************************************************************************
- * Copyright (c) 1996-2008 Regents of the University of Minnesota.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in 
- * all copies of this Software or works derived from this Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-using System;
-using System.Drawing;
-using System.Drawing.Printing;
-using OSGeo.MapServer;	
-
-/// <summary>
-/// A C# based mapscript example to draw the map directly onto a GDI printing device context.
-/// </summary>
-class DrawMap
-{
-  public static void usage() 
-  { 
-	Console.WriteLine("usage: DrawMapDirectPrint {mapfile} {printername}");
-	System.Environment.Exit(-1);
-  }
-
-  static mapObj map;
-		  
-  public static void Main(string[] args)
-  {
-    Console.WriteLine("");
-	if (args.Length < 2) usage();
-    
-	map = new mapObj(args[0]);
-
-    Console.WriteLine("# Map layers " + map.numlayers + "; Map name = " + map.name);
-    for (int i = 0; i < map.numlayers; i++) 
-    {
-        Console.WriteLine("Layer [" + i + "] name: " + map.getLayer(i).name);
-    }
-
-    try
-    {
-        PrintDocument doc = new PrintDocument();
-
-        doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
-
-        // Specify the printer to use.
-        doc.PrinterSettings.PrinterName = args[1];
-
-        doc.Print();
-    } 
-    catch (Exception ex) 
-    {
-                Console.WriteLine( "\nMessage ---\n{0}", ex.Message );
-                Console.WriteLine( 
-                    "\nHelpLink ---\n{0}", ex.HelpLink );
-                Console.WriteLine( "\nSource ---\n{0}", ex.Source );
-                Console.WriteLine( 
-                    "\nStackTrace ---\n{0}", ex.StackTrace );
-                Console.WriteLine( 
-                    "\nTargetSite ---\n{0}", ex.TargetSite );	}	
-    }
-
-    static void doc_PrintPage(object sender, PrintPageEventArgs e)
-    {
-        // Create the output format
-        outputFormatObj of = new outputFormatObj("CAIRO/WINGDIPRINT", "cairowinGDIPrint");
-        map.appendOutputFormat(of);
-        map.selectOutputFormat("cairowinGDIPrint");
-        map.resolution = e.Graphics.DpiX;
-        Console.WriteLine("map resolution = " + map.resolution.ToString() + "DPI  defresolution = " + map.defresolution.ToString() + " DPI");
-        // Calculating the desired image size to cover the entire area; 
-        map.width = Convert.ToInt32(e.PageBounds.Width * e.Graphics.DpiX / 100);
-        map.height = Convert.ToInt32(e.PageBounds.Height * e.Graphics.DpiY / 100);
-
-        Console.WriteLine("map size = " + map.width.ToString() + " * " + map.height.ToString() + " pixels");
-
-        IntPtr hdc = e.Graphics.GetHdc();
-        try
-        {
-            // Attach the device to the outputformat for drawing
-            of.attachDevice(hdc);
-            // Drawing directly to the GDI context
-            using (imageObj image = map.draw()) { };
-        }
-        finally
-        {
-            of.attachDevice(IntPtr.Zero);
-            e.Graphics.ReleaseHdc(hdc);
-        }
-
-        e.HasMorePages = false;
-    }
-}
-
+/******************************************************************************
+ * $Id$
+ *
+ * Project:  MapServer
+ * Purpose:  A C# based mapscript example to draw the map directly onto a GDI
+ *           printing device context.
+ * Author:   Tamas Szekeres, szekerest at gmail.com
+ *
+ ******************************************************************************
+ * Copyright (c) 1996-2008 Regents of the University of Minnesota.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in 
+ * all copies of this Software or works derived from this Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *****************************************************************************/
+
+using System;
+using System.Drawing;
+using System.Drawing.Printing;
+using OSGeo.MapServer;	
+
+/// <summary>
+/// A C# based mapscript example to draw the map directly onto a GDI printing device context.
+/// </summary>
+class DrawMap
+{
+  public static void usage() 
+  { 
+	Console.WriteLine("usage: DrawMapDirectPrint {mapfile} {printername}");
+	System.Environment.Exit(-1);
+  }
+
+  static mapObj map;
+		  
+  public static void Main(string[] args)
+  {
+    Console.WriteLine("");
+	if (args.Length < 2) usage();
+    
+	map = new mapObj(args[0]);
+
+    Console.WriteLine("# Map layers " + map.numlayers + "; Map name = " + map.name);
+    for (int i = 0; i < map.numlayers; i++) 
+    {
+        Console.WriteLine("Layer [" + i + "] name: " + map.getLayer(i).name);
+    }
+
+    try
+    {
+        PrintDocument doc = new PrintDocument();
+
+        doc.PrintPage += new PrintPageEventHandler(doc_PrintPage);
+
+        // Specify the printer to use.
+        doc.PrinterSettings.PrinterName = args[1];
+
+        doc.Print();
+    } 
+    catch (Exception ex) 
+    {
+                Console.WriteLine( "\nMessage ---\n{0}", ex.Message );
+                Console.WriteLine( 
+                    "\nHelpLink ---\n{0}", ex.HelpLink );
+                Console.WriteLine( "\nSource ---\n{0}", ex.Source );
+                Console.WriteLine( 
+                    "\nStackTrace ---\n{0}", ex.StackTrace );
+                Console.WriteLine( 
+                    "\nTargetSite ---\n{0}", ex.TargetSite );	}	
+    }
+
+    static void doc_PrintPage(object sender, PrintPageEventArgs e)
+    {
+        // Create the output format
+        outputFormatObj of = new outputFormatObj("CAIRO/WINGDIPRINT", "cairowinGDIPrint");
+        map.appendOutputFormat(of);
+        map.selectOutputFormat("cairowinGDIPrint");
+        map.resolution = e.Graphics.DpiX;
+        Console.WriteLine("map resolution = " + map.resolution.ToString() + "DPI  defresolution = " + map.defresolution.ToString() + " DPI");
+        // Calculating the desired image size to cover the entire area; 
+        map.width = Convert.ToInt32(e.PageBounds.Width * e.Graphics.DpiX / 100);
+        map.height = Convert.ToInt32(e.PageBounds.Height * e.Graphics.DpiY / 100);
+
+        Console.WriteLine("map size = " + map.width.ToString() + " * " + map.height.ToString() + " pixels");
+
+        IntPtr hdc = e.Graphics.GetHdc();
+        try
+        {
+            // Attach the device to the outputformat for drawing
+            of.attachDevice(hdc);
+            // Drawing directly to the GDI context
+            using (imageObj image = map.draw()) { };
+        }
+        finally
+        {
+            of.attachDevice(IntPtr.Zero);
+            e.Graphics.ReleaseHdc(hdc);
+        }
+
+        e.HasMorePages = false;
+    }
+}
+


=====================================
mapscript/csharp/examples/inline.cs
=====================================
@@ -1,136 +1,136 @@
-/******************************************************************************
- * $Id: shapeinfo.cs 7418 2008-02-29 00:02:49Z nsavard $
- *
- * Project:  MapServer
- * Purpose:  A C# based based mapscript example to dump information from 
- *           a shapefile.
- * Author:   Tamas Szekeres, szekerest at gmail.com 
- *
- ******************************************************************************
- * Copyright (c) 1996-2008 Regents of the University of Minnesota.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in 
- * all copies of this Software or works derived from this Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *****************************************************************************/
-
-using System;
-using System.Collections;
-using OSGeo.MapServer;
-
-/// <summary>
-/// A MapScript application for creating inline layers with annotations.
-/// </summary> 
-class Inline {
-
-  public static void usage()
-  {
-      Console.WriteLine("usage: inline [outformat] [outfile]");
-      System.Environment.Exit(-1);
-  }
-  	
-  public static void Main(string[] args) 
-  {
-
-      if (args.Length < 2) usage();
-
-      // creating a new map from scratch
-      mapObj map = new mapObj(null);
-      // adding a layer
-      layerObj layer = new layerObj(map);
-      layer.type = MS_LAYER_TYPE.MS_LAYER_POINT;
-      layer.status = mapscript.MS_ON;
-      layer.connectiontype = MS_CONNECTION_TYPE.MS_INLINE;
-      // define the attribute names from the inline layer
-      layer.addProcessing("ITEMS=attribute1,attribute2,attribute3");
-      // define the class
-      classObj classobj = new classObj(layer);
-      classobj.template = "query";   // making the layer queryable
-      // setting up the text based on multiple attributes
-      classobj.setText("('Shape:' + '[attribute1]' + ' Color:' + '[attribute2]' + ' Size:' + '[attribute3]')");
-      // define the label
-      classobj.label.outlinecolor = new colorObj(255, 255, 255, 0);
-      classobj.label.force = mapscript.MS_TRUE;
-      classobj.label.size = (double)MS_BITMAP_FONT_SIZES.MS_MEDIUM;
-      classobj.label.position = (int)MS_POSITIONS_ENUM.MS_LC;
-      classobj.label.wrap = ' ';
-      // set up attribute binding
-      classobj.label.setBinding((int)MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_COLOR, "attribute2");
-      // define the style
-      styleObj style = new styleObj(classobj);
-      style.color = new colorObj(0, 255, 255, 0);
-      style.setBinding((int)MS_STYLE_BINDING_ENUM.MS_STYLE_BINDING_COLOR, "attribute2");
-      style.setBinding((int)MS_STYLE_BINDING_ENUM.MS_STYLE_BINDING_SIZE, "attribute3");
-
-      Random rand = new Random((int)DateTime.Now.ToFileTime()); ;
-
-      // creating the shapes
-      for (int i = 0; i < 10; i++)
-      {
-          shapeObj shape = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT);
-
-          // setting the shape attributes
-          shape.initValues(4);
-          shape.setValue(0, Convert.ToString(i));
-          shape.setValue(1, new colorObj(rand.Next(255), rand.Next(255), rand.Next(255), 0).toHex());
-          shape.setValue(2, Convert.ToString(rand.Next(25) + 5));
-
-          lineObj line = new lineObj();
-          line.add(new pointObj(rand.Next(400) + 25, rand.Next(400) + 25, 0, 0));
-          shape.add(line);
-          layer.addFeature(shape);
-      }
-
-      map.width = 500;
-      map.height = 500;
-      map.setExtent(0,0,450,450);
-      map.selectOutputFormat(args[0]);
-      imageObj image = map.draw();
-      image.save(args[1], map);
-
-      //perform a query
-      layer.queryByRect(map, new rectObj(0, 0, 450, 450, 0));
-
-      resultObj res;
-      shapeObj feature;
-      using (resultCacheObj results = layer.getResults())
-      {
-          if (results != null && results.numresults > 0)
-          {
-              // extracting the features found
-              layer.open();
-              for (int j = 0; j < results.numresults; j++)
-              {
-                  res = results.getResult(j);
-                  feature = layer.getShape(res);
-                  if (feature != null)
-                  {
-                      Console.WriteLine("  Feature: shapeindex=" + res.shapeindex + " tileindex=" + res.tileindex);
-                      for (int k = 0; k < layer.numitems; k++)
-                      {
-                          Console.Write("     " + layer.getItem(k));
-                          Console.Write(" = ");
-                          Console.Write(feature.getValue(k));
-                          Console.WriteLine();
-                      }
-                  }
-              }
-              layer.close();
-          }
-      }
-  }
+/******************************************************************************
+ * $Id: shapeinfo.cs 7418 2008-02-29 00:02:49Z nsavard $
+ *
+ * Project:  MapServer
+ * Purpose:  A C# based based mapscript example to dump information from 
+ *           a shapefile.
+ * Author:   Tamas Szekeres, szekerest at gmail.com 
+ *
+ ******************************************************************************
+ * Copyright (c) 1996-2008 Regents of the University of Minnesota.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in 
+ * all copies of this Software or works derived from this Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *****************************************************************************/
+
+using System;
+using System.Collections;
+using OSGeo.MapServer;
+
+/// <summary>
+/// A MapScript application for creating inline layers with annotations.
+/// </summary> 
+class Inline {
+
+  public static void usage()
+  {
+      Console.WriteLine("usage: inline [outformat] [outfile]");
+      System.Environment.Exit(-1);
+  }
+  	
+  public static void Main(string[] args) 
+  {
+
+      if (args.Length < 2) usage();
+
+      // creating a new map from scratch
+      mapObj map = new mapObj(null);
+      // adding a layer
+      layerObj layer = new layerObj(map);
+      layer.type = MS_LAYER_TYPE.MS_LAYER_POINT;
+      layer.status = mapscript.MS_ON;
+      layer.connectiontype = MS_CONNECTION_TYPE.MS_INLINE;
+      // define the attribute names from the inline layer
+      layer.addProcessing("ITEMS=attribute1,attribute2,attribute3");
+      // define the class
+      classObj classobj = new classObj(layer);
+      classobj.template = "query";   // making the layer queryable
+      // setting up the text based on multiple attributes
+      classobj.setText("('Shape:' + '[attribute1]' + ' Color:' + '[attribute2]' + ' Size:' + '[attribute3]')");
+      // define the label
+      classobj.label.outlinecolor = new colorObj(255, 255, 255, 0);
+      classobj.label.force = mapscript.MS_TRUE;
+      classobj.label.size = (double)MS_BITMAP_FONT_SIZES.MS_MEDIUM;
+      classobj.label.position = (int)MS_POSITIONS_ENUM.MS_LC;
+      classobj.label.wrap = ' ';
+      // set up attribute binding
+      classobj.label.setBinding((int)MS_LABEL_BINDING_ENUM.MS_LABEL_BINDING_COLOR, "attribute2");
+      // define the style
+      styleObj style = new styleObj(classobj);
+      style.color = new colorObj(0, 255, 255, 0);
+      style.setBinding((int)MS_STYLE_BINDING_ENUM.MS_STYLE_BINDING_COLOR, "attribute2");
+      style.setBinding((int)MS_STYLE_BINDING_ENUM.MS_STYLE_BINDING_SIZE, "attribute3");
+
+      Random rand = new Random((int)DateTime.Now.ToFileTime()); ;
+
+      // creating the shapes
+      for (int i = 0; i < 10; i++)
+      {
+          shapeObj shape = new shapeObj((int)MS_SHAPE_TYPE.MS_SHAPE_POINT);
+
+          // setting the shape attributes
+          shape.initValues(4);
+          shape.setValue(0, Convert.ToString(i));
+          shape.setValue(1, new colorObj(rand.Next(255), rand.Next(255), rand.Next(255), 0).toHex());
+          shape.setValue(2, Convert.ToString(rand.Next(25) + 5));
+
+          lineObj line = new lineObj();
+          line.add(new pointObj(rand.Next(400) + 25, rand.Next(400) + 25, 0, 0));
+          shape.add(line);
+          layer.addFeature(shape);
+      }
+
+      map.width = 500;
+      map.height = 500;
+      map.setExtent(0,0,450,450);
+      map.selectOutputFormat(args[0]);
+      imageObj image = map.draw();
+      image.save(args[1], map);
+
+      //perform a query
+      layer.queryByRect(map, new rectObj(0, 0, 450, 450, 0));
+
+      resultObj res;
+      shapeObj feature;
+      using (resultCacheObj results = layer.getResults())
+      {
+          if (results != null && results.numresults > 0)
+          {
+              // extracting the features found
+              layer.open();
+              for (int j = 0; j < results.numresults; j++)
+              {
+                  res = results.getResult(j);
+                  feature = layer.getShape(res);
+                  if (feature != null)
+                  {
+                      Console.WriteLine("  Feature: shapeindex=" + res.shapeindex + " tileindex=" + res.tileindex);
+                      for (int k = 0; k < layer.numitems; k++)
+                      {
+                          Console.Write("     " + layer.getItem(k));
+                          Console.Write(" = ");
+                          Console.Write(feature.getValue(k));
+                          Console.WriteLine();
+                      }
+                  }
+              }
+              layer.close();
+          }
+      }
+  }
 }
\ No newline at end of file


=====================================
maptemplate.c
=====================================
@@ -47,8 +47,10 @@ static char *olUrl = "//www.mapserver.org/lib/OpenLayers-ms60.js";
 static char *olTemplate = \
                           "<html>\n"
                           "<head>\n"
+                          "<meta content=\"text/html;charset=utf-8\" http-equiv=\"Content-Type\">\n"
                           "  <title>MapServer Simple Viewer</title>\n"
                           "    <script type=\"text/javascript\" src=\"[openlayers_js_url]\"></script>\n"
+                          "    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"//www.mapserver.org/_static/mapserver.ico\"/>\n"
                           "    </head>\n"
                           "    <body>\n"
                           "      <div style=\"width:[mapwidth]; height:[mapheight]\" id=\"map\"></div>\n"
@@ -4610,6 +4612,7 @@ mapservObj *msAllocMapServObj()
   mapserv->ShapeIndex=-1;
   mapserv->TileIndex=-1;
   mapserv->TileMode=TILE_GMAP;
+  mapserv->TileCoords=NULL;
   mapserv->QueryCoordSource=NONE;
   mapserv->ZoomSize=0; /* zoom absolute magnitude (i.e. > 0) */
 
@@ -4649,6 +4652,8 @@ void msFreeMapServObj(mapservObj* mapserv)
     msFree(mapserv->SelectLayer);
     msFree(mapserv->QueryFile);
 
+    msFree(mapserv->TileCoords);
+
     msFree(mapserv);
   }
 }


=====================================
maptile.h
=====================================
@@ -30,9 +30,7 @@
 #include "mapserver.h"
 #include "maptemplate.h"
 
-#ifdef USE_PROJ
 #define USE_TILE_API 1
-#endif
 
 #define SPHEREMERC_PROJ4 "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +units=m +k=1.0 +nadgrids=@null"
 #define SPHEREMERC_GROUND_SIZE (20037508.34*2)


=====================================
mapwcs11.c
=====================================
@@ -35,7 +35,7 @@
 #include "mapthread.h"
 #include "mapows.h"
 #include "mapwcs.h"
-
+#include "mapgdal.h"
 
 
 #if defined(USE_WCS_SVR)
@@ -1188,8 +1188,7 @@ int  msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map,
     if( pszExtension == NULL )
       pszExtension = "img.tmp";
 
-    if( GDALGetMetadataItem( hDriver, GDAL_DCAP_VIRTUALIO, NULL )
-        != NULL ) {
+    if( msGDALDriverSupportsVirtualIOOutput(hDriver) ) {
       base_dir = msTmpFile(map, map->mappath, "/vsimem/wcsout", NULL);
       if( fo_filename )
         filename = msStrdup(CPLFormFilename(base_dir,


=====================================
mapwcs20.c
=====================================
@@ -38,6 +38,7 @@
 #include "mapthread.h"
 #include "mapows.h"
 #include "mapwcs.h"
+#include "mapgdal.h"
 #include <float.h>
 #include "gdal.h"
 #include "cpl_port.h"
@@ -2328,8 +2329,7 @@ static int msWCSWriteFile20(mapObj* map, imageObj* image, wcs20ParamsObjPtr para
     if( pszExtension == NULL )
       pszExtension = "img.tmp";
 
-    if( GDALGetMetadataItem( hDriver, GDAL_DCAP_VIRTUALIO, NULL )
-        != NULL ) {
+    if( msGDALDriverSupportsVirtualIOOutput(hDriver) ) {
       base_dir = msTmpFile(map, map->mappath, "/vsimem/wcsout", NULL);
       if( fo_filename )
         filename = msStrdup(CPLFormFilename(base_dir,


=====================================
mapwmslayer.c
=====================================
@@ -1414,7 +1414,6 @@ int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
    * to attach a "VSI" name to this buffer.
    * ------------------------------------------------------------------ */
   if( pasReqInfo[iReq].pszOutputFile == NULL ) {
-    msCleanVSIDir( "/vsimem/msout" );
     mem_filename = msTmpFile(map, NULL, "/vsimem/msout/", "img.tmp" );
 
     VSIFCloseL(
@@ -1496,7 +1495,7 @@ int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
       if (msDrawLayer(map, lp, img) != 0)
         status = MS_FAILURE;
 
-      if (!lp->debug)
+      if (!lp->debug || mem_filename != NULL)
         VSIUnlink( wldfile );
     } else {
       msSetError(MS_WMSCONNERR,
@@ -1508,7 +1507,7 @@ int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
   }
 
   /* We're done with the remote server's response... delete it. */
-  if (!lp->debug)
+  if (!lp->debug || mem_filename != NULL)
     VSIUnlink(lp->data);
 
   /* restore prveious type */


=====================================
renderers/agg/include/agg_conv_clipper.h
=====================================
@@ -1,299 +1,299 @@
-/*******************************************************************************
-*                                                                              *
-* Author    :  Angus Johnson                                                   *
-* Version   :  1.1                                                             *
-* Date      :  4 April 2011                                                    *
-* Website   :  http://www.angusj.com                                           *
-* Copyright :  Angus Johnson 2010-2011                                         *
-*                                                                              *
-* License:                                                                     *
-* Use, modification & distribution is subject to Boost Software License Ver 1. *
-* http://www.boost.org/LICENSE_1_0.txt                                         *
-*                                                                              *
-*******************************************************************************/
-
-#ifndef AGG_CONV_CLIPPER_INCLUDED
-#define AGG_CONV_CLIPPER_INCLUDED
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1800)
-#include <algorithm>
-#endif
-
-#include <cmath>
-#include "agg_basics.h"
-#include "agg_array.h"
-#include "clipper.hpp"
-
-namespace mapserver
-{
-  enum clipper_op_e { clipper_or,
-    clipper_and, clipper_xor, clipper_a_minus_b, clipper_b_minus_a };
-  enum clipper_PolyFillType {clipper_even_odd, clipper_non_zero, clipper_positive, clipper_negative};
-
-  template<class VSA, class VSB> class conv_clipper
-  {
-    enum status { status_move_to, status_line_to, status_stop };
-    typedef VSA source_a_type;
-    typedef VSB source_b_type;
-    typedef conv_clipper<source_a_type, source_b_type> self_type;
-
-  private:
-    source_a_type*							m_src_a;
-    source_b_type*							m_src_b;
-    status									m_status;
-    int										m_vertex;
-    int										m_contour;
-	int										m_scaling_factor;
-    clipper_op_e							m_operation;
-    pod_bvector<ClipperLib::IntPoint, 8>		m_vertex_accumulator;
-    ClipperLib::Polygons						m_poly_a;
-    ClipperLib::Polygons						m_poly_b;
-    ClipperLib::Polygons						m_result;
-    ClipperLib::Clipper						m_clipper;
-    clipper_PolyFillType					m_subjFillType;
-    clipper_PolyFillType					m_clipFillType;
-
-    int Round(double val)
-    {
-    if ((val < 0)) return (int)(val - 0.5); else return (int)(val + 0.5);
-    }
-
-  public:
-    conv_clipper(source_a_type &a, source_b_type &b,
-      clipper_op_e op = clipper_or,
-      clipper_PolyFillType subjFillType = clipper_even_odd,
-      clipper_PolyFillType clipFillType = clipper_even_odd,
-	  int scaling_factor = 2) :
-        m_src_a(&a),
-        m_src_b(&b),
-        m_status(status_move_to),
-        m_vertex(-1),
-        m_contour(-1),
-        m_operation(op),
-        m_subjFillType(subjFillType),
-        m_clipFillType(clipFillType)
-    {
-		m_scaling_factor = std::max(std::min(scaling_factor, 6),0);
-		m_scaling_factor = Round(std::pow((double)10, m_scaling_factor));
-	}
-
-    ~conv_clipper()
-    {
-    }
-
-    void attach1(VSA &source, clipper_PolyFillType subjFillType = clipper_even_odd)
-      { m_src_a = &source; m_subjFillType = subjFillType; }
-    void attach2(VSB &source, clipper_PolyFillType clipFillType = clipper_even_odd)
-      { m_src_b = &source; m_clipFillType = clipFillType; }
-
-    void operation(clipper_op_e v) { m_operation = v; }
-
-    void rewind(unsigned path_id);
-    unsigned vertex(double* x, double* y);
-  
-    bool next_contour();
-    bool next_vertex(double* x, double* y);
-    void start_extracting();
-    void add_vertex_(double &x, double &y);
-    void end_contour(ClipperLib::Polygons &p);
-
-	template<class VS> void add(VS &src, ClipperLib::Polygons &p){
-		unsigned cmd;
-		double x; double y; double start_x; double start_y;
-		bool starting_first_line;
-
-		start_x = 0.0;
-		start_y = 0.0;
-		starting_first_line = true;
-		p.resize(0);
-
-		cmd = src->vertex( &x , &y );
-		while(!is_stop(cmd))
-		{
-		  if(is_vertex(cmd))
-		  {
-			if(is_move_to(cmd))
-			{
-			  if(!starting_first_line ) end_contour(p);
-			  start_x = x;
-			  start_y = y;
-			}
-			add_vertex_( x, y );
-			starting_first_line = false;
-		  }
-		  else if(is_end_poly(cmd))
-		  {
-			if(!starting_first_line && is_closed(cmd))
-			  add_vertex_( start_x, start_y );
-		  }
-		  cmd = src->vertex( &x, &y );
-		}
-		end_contour(p);
-	}
-  };
-
-  //------------------------------------------------------------------------
-
-  template<class VSA, class VSB> 
-  void conv_clipper<VSA, VSB>::start_extracting()
-  {
-    m_status = status_move_to;
-    m_contour = -1;
-    m_vertex = -1;
-  }
-  //------------------------------------------------------------------------------
-
-  template<class VSA, class VSB>
-  void conv_clipper<VSA, VSB>::rewind(unsigned path_id)
-  {
-    m_src_a->rewind( path_id );
-    m_src_b->rewind( path_id );
-
-    add( m_src_a , m_poly_a );
-    add( m_src_b , m_poly_b );
-    m_result.resize(0);
-
-    ClipperLib::PolyFillType pftSubj, pftClip;
-    switch (m_subjFillType)
-    {
-      case clipper_even_odd: pftSubj = ClipperLib::pftEvenOdd; break;
-      case clipper_non_zero: pftSubj = ClipperLib::pftNonZero; break;
-      case clipper_positive: pftSubj = ClipperLib::pftPositive; break;
-      default: pftSubj = ClipperLib::pftNegative;
-    }
-    switch (m_clipFillType)
-    {
-      case clipper_even_odd: pftClip = ClipperLib::pftEvenOdd; break;
-      case clipper_non_zero: pftClip = ClipperLib::pftNonZero; break;
-      case clipper_positive: pftClip = ClipperLib::pftPositive; break;
-      default: pftClip = ClipperLib::pftNegative;
-    }
-
-    m_clipper.Clear();
-    switch( m_operation ) {
-      case clipper_or:
-        {
-        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
-        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
-        m_clipper.Execute( ClipperLib::ctUnion , m_result , pftSubj, pftClip);
-		break;
-        }
-      case clipper_and:
-        {
-        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
-        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
-        m_clipper.Execute( ClipperLib::ctIntersection , m_result, pftSubj, pftClip );
-		break;
-        }
-      case clipper_xor:
-        {
-        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
-        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
-        m_clipper.Execute( ClipperLib::ctXor , m_result, pftSubj, pftClip );
-		break;
-        }
-      case clipper_a_minus_b:
-        {
-        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
-        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
-        m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip );
-		break;
-        }
-      case clipper_b_minus_a:
-        {
-        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptSubject );
-        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptClip );
-        m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip );
-		break;
-        }
-    }
-    start_extracting();
-  }
-  //------------------------------------------------------------------------------
-
-  template<class VSA, class VSB>
-  void conv_clipper<VSA, VSB>::end_contour( ClipperLib::Polygons &p)
-  {
-  unsigned i, len;
-
-  if( m_vertex_accumulator.size() < 3 ) return;
-  len = p.size();
-  p.resize(len+1);
-  p[len].resize(m_vertex_accumulator.size());
-  for( i = 0 ; i < m_vertex_accumulator.size() ; i++ )
-    p[len][i] = m_vertex_accumulator[i];
-  m_vertex_accumulator.remove_all();
-  }
-  //------------------------------------------------------------------------------
-
-  template<class VSA, class VSB> 
-  void conv_clipper<VSA, VSB>::add_vertex_(double &x, double &y)
-  {
-	  ClipperLib::IntPoint v;
-
-	  v.X = Round(x * m_scaling_factor);
-	  v.Y = Round(y * m_scaling_factor);
-	  m_vertex_accumulator.add( v );
-  }
-  //------------------------------------------------------------------------------
-
-  template<class VSA, class VSB> 
-  bool conv_clipper<VSA, VSB>::next_contour()
-  {   
-	m_contour++;
-	if(m_contour >= (int)m_result.size()) return false;
-	m_vertex =-1;
-	return true;
-}
-//------------------------------------------------------------------------------
-
-  template<class VSA, class VSB> 
-  bool conv_clipper<VSA, VSB>::next_vertex(double *x, double *y)
-  {
-    m_vertex++;
-    if(m_vertex >= (int)m_result[m_contour].size()) return false;
-    *x = (double)m_result[ m_contour ][ m_vertex ].X / m_scaling_factor;
-    *y = (double)m_result[ m_contour ][ m_vertex ].Y / m_scaling_factor;
-    return true;
-  }
-  //------------------------------------------------------------------------------
-
-  template<class VSA, class VSB>
-  unsigned conv_clipper<VSA, VSB>::vertex(double *x, double *y)
-{
-  if(  m_status == status_move_to )
-  {
-    if( next_contour() )
-    {
-      if(  next_vertex( x, y ) )
-      {
-        m_status =status_line_to;
-        return path_cmd_move_to;
-      }
-	  else
-	  {
-        m_status = status_stop;
-        return path_cmd_end_poly | path_flags_close;
-      }
-    }
-	else
-      return path_cmd_stop;
-  }
-  else
-  {
-    if(  next_vertex( x, y ) )
-    {
-      return path_cmd_line_to;
-    }
-	else
-    {
-      m_status = status_move_to;
-      return path_cmd_end_poly | path_flags_close;
-    }
-  }
-}
-//------------------------------------------------------------------------------
-
-
-} //namespace agg
-#endif //AGG_CONV_CLIPPER_INCLUDED
+/*******************************************************************************
+*                                                                              *
+* Author    :  Angus Johnson                                                   *
+* Version   :  1.1                                                             *
+* Date      :  4 April 2011                                                    *
+* Website   :  http://www.angusj.com                                           *
+* Copyright :  Angus Johnson 2010-2011                                         *
+*                                                                              *
+* License:                                                                     *
+* Use, modification & distribution is subject to Boost Software License Ver 1. *
+* http://www.boost.org/LICENSE_1_0.txt                                         *
+*                                                                              *
+*******************************************************************************/
+
+#ifndef AGG_CONV_CLIPPER_INCLUDED
+#define AGG_CONV_CLIPPER_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1800)
+#include <algorithm>
+#endif
+
+#include <cmath>
+#include "agg_basics.h"
+#include "agg_array.h"
+#include "clipper.hpp"
+
+namespace mapserver
+{
+  enum clipper_op_e { clipper_or,
+    clipper_and, clipper_xor, clipper_a_minus_b, clipper_b_minus_a };
+  enum clipper_PolyFillType {clipper_even_odd, clipper_non_zero, clipper_positive, clipper_negative};
+
+  template<class VSA, class VSB> class conv_clipper
+  {
+    enum status { status_move_to, status_line_to, status_stop };
+    typedef VSA source_a_type;
+    typedef VSB source_b_type;
+    typedef conv_clipper<source_a_type, source_b_type> self_type;
+
+  private:
+    source_a_type*							m_src_a;
+    source_b_type*							m_src_b;
+    status									m_status;
+    int										m_vertex;
+    int										m_contour;
+	int										m_scaling_factor;
+    clipper_op_e							m_operation;
+    pod_bvector<ClipperLib::IntPoint, 8>		m_vertex_accumulator;
+    ClipperLib::Polygons						m_poly_a;
+    ClipperLib::Polygons						m_poly_b;
+    ClipperLib::Polygons						m_result;
+    ClipperLib::Clipper						m_clipper;
+    clipper_PolyFillType					m_subjFillType;
+    clipper_PolyFillType					m_clipFillType;
+
+    int Round(double val)
+    {
+    if ((val < 0)) return (int)(val - 0.5); else return (int)(val + 0.5);
+    }
+
+  public:
+    conv_clipper(source_a_type &a, source_b_type &b,
+      clipper_op_e op = clipper_or,
+      clipper_PolyFillType subjFillType = clipper_even_odd,
+      clipper_PolyFillType clipFillType = clipper_even_odd,
+	  int scaling_factor = 2) :
+        m_src_a(&a),
+        m_src_b(&b),
+        m_status(status_move_to),
+        m_vertex(-1),
+        m_contour(-1),
+        m_operation(op),
+        m_subjFillType(subjFillType),
+        m_clipFillType(clipFillType)
+    {
+		m_scaling_factor = std::max(std::min(scaling_factor, 6),0);
+		m_scaling_factor = Round(std::pow((double)10, m_scaling_factor));
+	}
+
+    ~conv_clipper()
+    {
+    }
+
+    void attach1(VSA &source, clipper_PolyFillType subjFillType = clipper_even_odd)
+      { m_src_a = &source; m_subjFillType = subjFillType; }
+    void attach2(VSB &source, clipper_PolyFillType clipFillType = clipper_even_odd)
+      { m_src_b = &source; m_clipFillType = clipFillType; }
+
+    void operation(clipper_op_e v) { m_operation = v; }
+
+    void rewind(unsigned path_id);
+    unsigned vertex(double* x, double* y);
+  
+    bool next_contour();
+    bool next_vertex(double* x, double* y);
+    void start_extracting();
+    void add_vertex_(double &x, double &y);
+    void end_contour(ClipperLib::Polygons &p);
+
+	template<class VS> void add(VS &src, ClipperLib::Polygons &p){
+		unsigned cmd;
+		double x; double y; double start_x; double start_y;
+		bool starting_first_line;
+
+		start_x = 0.0;
+		start_y = 0.0;
+		starting_first_line = true;
+		p.resize(0);
+
+		cmd = src->vertex( &x , &y );
+		while(!is_stop(cmd))
+		{
+		  if(is_vertex(cmd))
+		  {
+			if(is_move_to(cmd))
+			{
+			  if(!starting_first_line ) end_contour(p);
+			  start_x = x;
+			  start_y = y;
+			}
+			add_vertex_( x, y );
+			starting_first_line = false;
+		  }
+		  else if(is_end_poly(cmd))
+		  {
+			if(!starting_first_line && is_closed(cmd))
+			  add_vertex_( start_x, start_y );
+		  }
+		  cmd = src->vertex( &x, &y );
+		}
+		end_contour(p);
+	}
+  };
+
+  //------------------------------------------------------------------------
+
+  template<class VSA, class VSB> 
+  void conv_clipper<VSA, VSB>::start_extracting()
+  {
+    m_status = status_move_to;
+    m_contour = -1;
+    m_vertex = -1;
+  }
+  //------------------------------------------------------------------------------
+
+  template<class VSA, class VSB>
+  void conv_clipper<VSA, VSB>::rewind(unsigned path_id)
+  {
+    m_src_a->rewind( path_id );
+    m_src_b->rewind( path_id );
+
+    add( m_src_a , m_poly_a );
+    add( m_src_b , m_poly_b );
+    m_result.resize(0);
+
+    ClipperLib::PolyFillType pftSubj, pftClip;
+    switch (m_subjFillType)
+    {
+      case clipper_even_odd: pftSubj = ClipperLib::pftEvenOdd; break;
+      case clipper_non_zero: pftSubj = ClipperLib::pftNonZero; break;
+      case clipper_positive: pftSubj = ClipperLib::pftPositive; break;
+      default: pftSubj = ClipperLib::pftNegative;
+    }
+    switch (m_clipFillType)
+    {
+      case clipper_even_odd: pftClip = ClipperLib::pftEvenOdd; break;
+      case clipper_non_zero: pftClip = ClipperLib::pftNonZero; break;
+      case clipper_positive: pftClip = ClipperLib::pftPositive; break;
+      default: pftClip = ClipperLib::pftNegative;
+    }
+
+    m_clipper.Clear();
+    switch( m_operation ) {
+      case clipper_or:
+        {
+        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
+        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
+        m_clipper.Execute( ClipperLib::ctUnion , m_result , pftSubj, pftClip);
+		break;
+        }
+      case clipper_and:
+        {
+        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
+        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
+        m_clipper.Execute( ClipperLib::ctIntersection , m_result, pftSubj, pftClip );
+		break;
+        }
+      case clipper_xor:
+        {
+        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
+        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
+        m_clipper.Execute( ClipperLib::ctXor , m_result, pftSubj, pftClip );
+		break;
+        }
+      case clipper_a_minus_b:
+        {
+        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptSubject );
+        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptClip );
+        m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip );
+		break;
+        }
+      case clipper_b_minus_a:
+        {
+        m_clipper.AddPolygons( m_poly_b , ClipperLib::ptSubject );
+        m_clipper.AddPolygons( m_poly_a , ClipperLib::ptClip );
+        m_clipper.Execute( ClipperLib::ctDifference , m_result, pftSubj, pftClip );
+		break;
+        }
+    }
+    start_extracting();
+  }
+  //------------------------------------------------------------------------------
+
+  template<class VSA, class VSB>
+  void conv_clipper<VSA, VSB>::end_contour( ClipperLib::Polygons &p)
+  {
+  unsigned i, len;
+
+  if( m_vertex_accumulator.size() < 3 ) return;
+  len = p.size();
+  p.resize(len+1);
+  p[len].resize(m_vertex_accumulator.size());
+  for( i = 0 ; i < m_vertex_accumulator.size() ; i++ )
+    p[len][i] = m_vertex_accumulator[i];
+  m_vertex_accumulator.remove_all();
+  }
+  //------------------------------------------------------------------------------
+
+  template<class VSA, class VSB> 
+  void conv_clipper<VSA, VSB>::add_vertex_(double &x, double &y)
+  {
+	  ClipperLib::IntPoint v;
+
+	  v.X = Round(x * m_scaling_factor);
+	  v.Y = Round(y * m_scaling_factor);
+	  m_vertex_accumulator.add( v );
+  }
+  //------------------------------------------------------------------------------
+
+  template<class VSA, class VSB> 
+  bool conv_clipper<VSA, VSB>::next_contour()
+  {   
+	m_contour++;
+	if(m_contour >= (int)m_result.size()) return false;
+	m_vertex =-1;
+	return true;
+}
+//------------------------------------------------------------------------------
+
+  template<class VSA, class VSB> 
+  bool conv_clipper<VSA, VSB>::next_vertex(double *x, double *y)
+  {
+    m_vertex++;
+    if(m_vertex >= (int)m_result[m_contour].size()) return false;
+    *x = (double)m_result[ m_contour ][ m_vertex ].X / m_scaling_factor;
+    *y = (double)m_result[ m_contour ][ m_vertex ].Y / m_scaling_factor;
+    return true;
+  }
+  //------------------------------------------------------------------------------
+
+  template<class VSA, class VSB>
+  unsigned conv_clipper<VSA, VSB>::vertex(double *x, double *y)
+{
+  if(  m_status == status_move_to )
+  {
+    if( next_contour() )
+    {
+      if(  next_vertex( x, y ) )
+      {
+        m_status =status_line_to;
+        return path_cmd_move_to;
+      }
+	  else
+	  {
+        m_status = status_stop;
+        return path_cmd_end_poly | path_flags_close;
+      }
+    }
+	else
+      return path_cmd_stop;
+  }
+  else
+  {
+    if(  next_vertex( x, y ) )
+    {
+      return path_cmd_line_to;
+    }
+	else
+    {
+      m_status = status_move_to;
+      return path_cmd_end_poly | path_flags_close;
+    }
+  }
+}
+//------------------------------------------------------------------------------
+
+
+} //namespace agg
+#endif //AGG_CONV_CLIPPER_INCLUDED


=====================================
renderers/agg/include/clipper.hpp
=====================================
@@ -1,302 +1,302 @@
-/*******************************************************************************
-*                                                                              *
-* Author    :  Angus Johnson                                                   *
-* Version   :  4.6.3                                                           *
-* Date      :  11 November 2011                                                *
-* Website   :  http://www.angusj.com                                           *
-* Copyright :  Angus Johnson 2010-2011                                         *
-*                                                                              *
-* License:                                                                     *
-* Use, modification & distribution is subject to Boost Software License Ver 1. *
-* http://www.boost.org/LICENSE_1_0.txt                                         *
-*                                                                              *
-* Attributions:                                                                *
-* The code in this library is an extension of Bala Vatti's clipping algorithm: *
-* "A generic solution to polygon clipping"                                     *
-* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63.             *
-* http://portal.acm.org/citation.cfm?id=129906                                 *
-*                                                                              *
-* Computer graphics and geometric modeling: implementation and algorithms      *
-* By Max K. Agoston                                                            *
-* Springer; 1 edition (January 4, 2005)                                        *
-* http://books.google.com/books?q=vatti+clipping+agoston                       *
-*                                                                              *
-* See also:                                                                    *
-* "Polygon Offsetting by Computing Winding Numbers"                            *
-* Paper no. DETC2005-85513 pp. 565-575                                         *
-* ASME 2005 International Design Engineering Technical Conferences             *
-* and Computers and Information in Engineering Conference (IDETC/CIE2005)      *
-* September 24-28, 2005 , Long Beach, California, USA                          *
-* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf              *
-*                                                                              *
-*******************************************************************************/
-
-#ifndef clipper_hpp
-#define clipper_hpp
-
-#include <vector>
-#include <stdexcept>
-#include <cstring>
-#include <cstdlib>
-#include <ostream>
-
-namespace ClipperLib {
-
-enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
-enum PolyType { ptSubject, ptClip };
-//By far the most widely used winding rules for polygon filling are
-//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
-//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
-//see http://glprogramming.com/red/chapter11.html
-enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
-
-typedef signed long long long64;
-typedef unsigned long long ulong64;
-
-struct IntPoint {
-public:
-  long64 X;
-  long64 Y;
-  IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {};
-  friend std::ostream& operator <<(std::ostream &s, IntPoint &p);
-};
-
-typedef std::vector< IntPoint > Polygon;
-typedef std::vector< Polygon > Polygons;
-
-std::ostream& operator <<(std::ostream &s, Polygon &p);
-std::ostream& operator <<(std::ostream &s, Polygons &p);
-
-struct ExPolygon {
-  Polygon  outer;
-  Polygons holes;
-};
-typedef std::vector< ExPolygon > ExPolygons;
-
-enum JoinType { jtSquare, jtMiter, jtRound };
-
-bool Orientation(const Polygon &poly);
-double Area(const Polygon &poly);
-void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
-  double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
-
-void ReversePoints(Polygon& p);
-void ReversePoints(Polygons& p);
-
-//used internally ...
-enum EdgeSide { esLeft, esRight };
-enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 };
-
-struct TEdge {
-  long64 xbot;
-  long64 ybot;
-  long64 xcurr;
-  long64 ycurr;
-  long64 xtop;
-  long64 ytop;
-  double dx;
-  long64 tmpX;
-  PolyType polyType;
-  EdgeSide side;
-  int windDelta; //1 or -1 depending on winding direction
-  int windCnt;
-  int windCnt2; //winding count of the opposite polytype
-  int outIdx;
-  TEdge *next;
-  TEdge *prev;
-  TEdge *nextInLML;
-  TEdge *nextInAEL;
-  TEdge *prevInAEL;
-  TEdge *nextInSEL;
-  TEdge *prevInSEL;
-};
-
-struct IntersectNode {
-  TEdge          *edge1;
-  TEdge          *edge2;
-  IntPoint        pt;
-  IntersectNode  *next;
-};
-
-struct LocalMinima {
-  long64        Y;
-  TEdge        *leftBound;
-  TEdge        *rightBound;
-  LocalMinima  *next;
-};
-
-struct Scanbeam {
-  long64    Y;
-  Scanbeam *next;
-};
-
-struct OutPt; //forward declaration
-
-struct OutRec {
-  int     idx;
-  bool    isHole;
-  OutRec *FirstLeft;
-  OutRec *AppendLink;
-  OutPt  *pts;
-  OutPt  *bottomPt;
-  TEdge  *bottomE1;
-  TEdge  *bottomE2;
-};
-
-struct OutPt {
-  int     idx;
-  IntPoint pt;
-  OutPt   *next;
-  OutPt   *prev;
-};
-
-struct JoinRec {
-  IntPoint  pt1a;
-  IntPoint  pt1b;
-  int       poly1Idx;
-  IntPoint  pt2a;
-  IntPoint  pt2b;
-  int       poly2Idx;
-};
-
-struct HorzJoinRec {
-  TEdge    *edge;
-  int       savedIdx;
-};
-
-struct IntRect { long64 left; long64 top; long64 right; long64 bottom; };
-
-typedef std::vector < OutRec* > PolyOutList;
-typedef std::vector < TEdge* > EdgeList;
-typedef std::vector < JoinRec* > JoinList;
-typedef std::vector < HorzJoinRec* > HorzJoinList;
-
-//ClipperBase is the ancestor to the Clipper class. It should not be
-//instantiated directly. This class simply abstracts the conversion of sets of
-//polygon coordinates into edge objects that are stored in a LocalMinima list.
-class ClipperBase
-{
-public:
-  ClipperBase();
-  virtual ~ClipperBase();
-  bool AddPolygon(const Polygon &pg, PolyType polyType);
-  bool AddPolygons( const Polygons &ppg, PolyType polyType);
-  virtual void Clear();
-  IntRect GetBounds();
-protected:
-  void DisposeLocalMinimaList();
-  TEdge* AddBoundsToLML(TEdge *e);
-  void PopLocalMinima();
-  virtual void Reset();
-  void InsertLocalMinima(LocalMinima *newLm);
-  LocalMinima      *m_CurrentLM;
-  LocalMinima      *m_MinimaList;
-  bool              m_UseFullRange;
-  EdgeList          m_edges;
-};
-
-class Clipper : public virtual ClipperBase
-{
-public:
-  Clipper();
-  ~Clipper();
-  bool Execute(ClipType clipType,
-  Polygons &solution,
-  PolyFillType subjFillType = pftEvenOdd,
-  PolyFillType clipFillType = pftEvenOdd);
-  bool Execute(ClipType clipType,
-  ExPolygons &solution,
-  PolyFillType subjFillType = pftEvenOdd,
-  PolyFillType clipFillType = pftEvenOdd);
-  void Clear();
-  bool ReverseSolution() {return m_ReverseOutput;};
-  void ReverseSolution(bool value) {m_ReverseOutput = value;};
-protected:
-  void Reset();
-  virtual bool ExecuteInternal(bool fixHoleLinkages);
-private:
-  PolyOutList       m_PolyOuts;
-  JoinList          m_Joins;
-  HorzJoinList      m_HorizJoins;
-  ClipType          m_ClipType;
-  Scanbeam         *m_Scanbeam;
-  TEdge           *m_ActiveEdges;
-  TEdge           *m_SortedEdges;
-  IntersectNode    *m_IntersectNodes;
-  bool              m_ExecuteLocked;
-  PolyFillType      m_ClipFillType;
-  PolyFillType      m_SubjFillType;
-  bool              m_ReverseOutput;
-  void DisposeScanbeamList();
-  void SetWindingCount(TEdge& edge);
-  bool IsEvenOddFillType(const TEdge& edge) const;
-  bool IsEvenOddAltFillType(const TEdge& edge) const;
-  void InsertScanbeam(const long64 Y);
-  long64 PopScanbeam();
-  void InsertLocalMinimaIntoAEL(const long64 botY);
-  void InsertEdgeIntoAEL(TEdge *edge);
-  void AddEdgeToSEL(TEdge *edge);
-  void CopyAELToSEL();
-  void DeleteFromSEL(TEdge *e);
-  void DeleteFromAEL(TEdge *e);
-  void UpdateEdgeIntoAEL(TEdge *&e);
-  void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
-  bool IsContributing(const TEdge& edge) const;
-  bool IsTopHorz(const long64 XPos);
-  void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
-  void DoMaxima(TEdge *e, long64 topY);
-  void ProcessHorizontals();
-  void ProcessHorizontal(TEdge *horzEdge);
-  void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
-  void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
-  void AppendPolygon(TEdge *e1, TEdge *e2);
-  void DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
-  void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
-  void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
-  void IntersectEdges(TEdge *e1, TEdge *e2,
-    const IntPoint &pt, IntersectProtects protects);
-  OutRec* CreateOutRec();
-  void AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt);
-  void DisposeAllPolyPts();
-  void DisposeOutRec(PolyOutList::size_type index, bool ignorePts = false);
-  bool ProcessIntersections(const long64 botY, const long64 topY);
-  void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
-  void BuildIntersectList(const long64 botY, const long64 topY);
-  void ProcessIntersectList();
-  void ProcessEdgesAtTopOfScanbeam(const long64 topY);
-  void BuildResult(Polygons& polys);
-  void BuildResultEx(ExPolygons& polys);
-  void SetHoleState(TEdge *e, OutRec *OutRec);
-  void DisposeIntersectNodes();
-  bool FixupIntersections();
-  void FixupOutPolygon(OutRec &outRec);
-  bool IsHole(TEdge *e);
-  void FixHoleLinkage(OutRec *outRec);
-  void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
-  void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
-  void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
-  void ClearJoins();
-  void AddHorzJoin(TEdge *e, int idx);
-  void ClearHorzJoins();
-  void JoinCommonEdges(bool fixHoleLinkages);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-class clipperException : public std::exception
-{
-  public:
-    clipperException(const char* description): m_descr(description) {}
-    virtual ~clipperException() throw() {}
-    virtual const char* what() const throw() {return m_descr.c_str();}
-  private:
-    std::string m_descr;
-};
-//------------------------------------------------------------------------------
-
-} //ClipperLib namespace
-
-#endif //clipper_hpp
-
-
+/*******************************************************************************
+*                                                                              *
+* Author    :  Angus Johnson                                                   *
+* Version   :  4.6.3                                                           *
+* Date      :  11 November 2011                                                *
+* Website   :  http://www.angusj.com                                           *
+* Copyright :  Angus Johnson 2010-2011                                         *
+*                                                                              *
+* License:                                                                     *
+* Use, modification & distribution is subject to Boost Software License Ver 1. *
+* http://www.boost.org/LICENSE_1_0.txt                                         *
+*                                                                              *
+* Attributions:                                                                *
+* The code in this library is an extension of Bala Vatti's clipping algorithm: *
+* "A generic solution to polygon clipping"                                     *
+* Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63.             *
+* http://portal.acm.org/citation.cfm?id=129906                                 *
+*                                                                              *
+* Computer graphics and geometric modeling: implementation and algorithms      *
+* By Max K. Agoston                                                            *
+* Springer; 1 edition (January 4, 2005)                                        *
+* http://books.google.com/books?q=vatti+clipping+agoston                       *
+*                                                                              *
+* See also:                                                                    *
+* "Polygon Offsetting by Computing Winding Numbers"                            *
+* Paper no. DETC2005-85513 pp. 565-575                                         *
+* ASME 2005 International Design Engineering Technical Conferences             *
+* and Computers and Information in Engineering Conference (IDETC/CIE2005)      *
+* September 24-28, 2005 , Long Beach, California, USA                          *
+* http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf              *
+*                                                                              *
+*******************************************************************************/
+
+#ifndef clipper_hpp
+#define clipper_hpp
+
+#include <vector>
+#include <stdexcept>
+#include <cstring>
+#include <cstdlib>
+#include <ostream>
+
+namespace ClipperLib {
+
+enum ClipType { ctIntersection, ctUnion, ctDifference, ctXor };
+enum PolyType { ptSubject, ptClip };
+//By far the most widely used winding rules for polygon filling are
+//EvenOdd & NonZero (GDI, GDI+, XLib, OpenGL, Cairo, AGG, Quartz, SVG, Gr32)
+//Others rules include Positive, Negative and ABS_GTR_EQ_TWO (only in OpenGL)
+//see http://glprogramming.com/red/chapter11.html
+enum PolyFillType { pftEvenOdd, pftNonZero, pftPositive, pftNegative };
+
+typedef signed long long long64;
+typedef unsigned long long ulong64;
+
+struct IntPoint {
+public:
+  long64 X;
+  long64 Y;
+  IntPoint(long64 x = 0, long64 y = 0): X(x), Y(y) {};
+  friend std::ostream& operator <<(std::ostream &s, IntPoint &p);
+};
+
+typedef std::vector< IntPoint > Polygon;
+typedef std::vector< Polygon > Polygons;
+
+std::ostream& operator <<(std::ostream &s, Polygon &p);
+std::ostream& operator <<(std::ostream &s, Polygons &p);
+
+struct ExPolygon {
+  Polygon  outer;
+  Polygons holes;
+};
+typedef std::vector< ExPolygon > ExPolygons;
+
+enum JoinType { jtSquare, jtMiter, jtRound };
+
+bool Orientation(const Polygon &poly);
+double Area(const Polygon &poly);
+void OffsetPolygons(const Polygons &in_polys, Polygons &out_polys,
+  double delta, JoinType jointype = jtSquare, double MiterLimit = 2);
+
+void ReversePoints(Polygon& p);
+void ReversePoints(Polygons& p);
+
+//used internally ...
+enum EdgeSide { esLeft, esRight };
+enum IntersectProtects { ipNone = 0, ipLeft = 1, ipRight = 2, ipBoth = 3 };
+
+struct TEdge {
+  long64 xbot;
+  long64 ybot;
+  long64 xcurr;
+  long64 ycurr;
+  long64 xtop;
+  long64 ytop;
+  double dx;
+  long64 tmpX;
+  PolyType polyType;
+  EdgeSide side;
+  int windDelta; //1 or -1 depending on winding direction
+  int windCnt;
+  int windCnt2; //winding count of the opposite polytype
+  int outIdx;
+  TEdge *next;
+  TEdge *prev;
+  TEdge *nextInLML;
+  TEdge *nextInAEL;
+  TEdge *prevInAEL;
+  TEdge *nextInSEL;
+  TEdge *prevInSEL;
+};
+
+struct IntersectNode {
+  TEdge          *edge1;
+  TEdge          *edge2;
+  IntPoint        pt;
+  IntersectNode  *next;
+};
+
+struct LocalMinima {
+  long64        Y;
+  TEdge        *leftBound;
+  TEdge        *rightBound;
+  LocalMinima  *next;
+};
+
+struct Scanbeam {
+  long64    Y;
+  Scanbeam *next;
+};
+
+struct OutPt; //forward declaration
+
+struct OutRec {
+  int     idx;
+  bool    isHole;
+  OutRec *FirstLeft;
+  OutRec *AppendLink;
+  OutPt  *pts;
+  OutPt  *bottomPt;
+  TEdge  *bottomE1;
+  TEdge  *bottomE2;
+};
+
+struct OutPt {
+  int     idx;
+  IntPoint pt;
+  OutPt   *next;
+  OutPt   *prev;
+};
+
+struct JoinRec {
+  IntPoint  pt1a;
+  IntPoint  pt1b;
+  int       poly1Idx;
+  IntPoint  pt2a;
+  IntPoint  pt2b;
+  int       poly2Idx;
+};
+
+struct HorzJoinRec {
+  TEdge    *edge;
+  int       savedIdx;
+};
+
+struct IntRect { long64 left; long64 top; long64 right; long64 bottom; };
+
+typedef std::vector < OutRec* > PolyOutList;
+typedef std::vector < TEdge* > EdgeList;
+typedef std::vector < JoinRec* > JoinList;
+typedef std::vector < HorzJoinRec* > HorzJoinList;
+
+//ClipperBase is the ancestor to the Clipper class. It should not be
+//instantiated directly. This class simply abstracts the conversion of sets of
+//polygon coordinates into edge objects that are stored in a LocalMinima list.
+class ClipperBase
+{
+public:
+  ClipperBase();
+  virtual ~ClipperBase();
+  bool AddPolygon(const Polygon &pg, PolyType polyType);
+  bool AddPolygons( const Polygons &ppg, PolyType polyType);
+  virtual void Clear();
+  IntRect GetBounds();
+protected:
+  void DisposeLocalMinimaList();
+  TEdge* AddBoundsToLML(TEdge *e);
+  void PopLocalMinima();
+  virtual void Reset();
+  void InsertLocalMinima(LocalMinima *newLm);
+  LocalMinima      *m_CurrentLM;
+  LocalMinima      *m_MinimaList;
+  bool              m_UseFullRange;
+  EdgeList          m_edges;
+};
+
+class Clipper : public virtual ClipperBase
+{
+public:
+  Clipper();
+  ~Clipper();
+  bool Execute(ClipType clipType,
+  Polygons &solution,
+  PolyFillType subjFillType = pftEvenOdd,
+  PolyFillType clipFillType = pftEvenOdd);
+  bool Execute(ClipType clipType,
+  ExPolygons &solution,
+  PolyFillType subjFillType = pftEvenOdd,
+  PolyFillType clipFillType = pftEvenOdd);
+  void Clear();
+  bool ReverseSolution() {return m_ReverseOutput;};
+  void ReverseSolution(bool value) {m_ReverseOutput = value;};
+protected:
+  void Reset();
+  virtual bool ExecuteInternal(bool fixHoleLinkages);
+private:
+  PolyOutList       m_PolyOuts;
+  JoinList          m_Joins;
+  HorzJoinList      m_HorizJoins;
+  ClipType          m_ClipType;
+  Scanbeam         *m_Scanbeam;
+  TEdge           *m_ActiveEdges;
+  TEdge           *m_SortedEdges;
+  IntersectNode    *m_IntersectNodes;
+  bool              m_ExecuteLocked;
+  PolyFillType      m_ClipFillType;
+  PolyFillType      m_SubjFillType;
+  bool              m_ReverseOutput;
+  void DisposeScanbeamList();
+  void SetWindingCount(TEdge& edge);
+  bool IsEvenOddFillType(const TEdge& edge) const;
+  bool IsEvenOddAltFillType(const TEdge& edge) const;
+  void InsertScanbeam(const long64 Y);
+  long64 PopScanbeam();
+  void InsertLocalMinimaIntoAEL(const long64 botY);
+  void InsertEdgeIntoAEL(TEdge *edge);
+  void AddEdgeToSEL(TEdge *edge);
+  void CopyAELToSEL();
+  void DeleteFromSEL(TEdge *e);
+  void DeleteFromAEL(TEdge *e);
+  void UpdateEdgeIntoAEL(TEdge *&e);
+  void SwapPositionsInSEL(TEdge *edge1, TEdge *edge2);
+  bool IsContributing(const TEdge& edge) const;
+  bool IsTopHorz(const long64 XPos);
+  void SwapPositionsInAEL(TEdge *edge1, TEdge *edge2);
+  void DoMaxima(TEdge *e, long64 topY);
+  void ProcessHorizontals();
+  void ProcessHorizontal(TEdge *horzEdge);
+  void AddLocalMaxPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
+  void AddLocalMinPoly(TEdge *e1, TEdge *e2, const IntPoint &pt);
+  void AppendPolygon(TEdge *e1, TEdge *e2);
+  void DoEdge1(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
+  void DoEdge2(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
+  void DoBothEdges(TEdge *edge1, TEdge *edge2, const IntPoint &pt);
+  void IntersectEdges(TEdge *e1, TEdge *e2,
+    const IntPoint &pt, IntersectProtects protects);
+  OutRec* CreateOutRec();
+  void AddOutPt(TEdge *e, TEdge *altE, const IntPoint &pt);
+  void DisposeAllPolyPts();
+  void DisposeOutRec(PolyOutList::size_type index, bool ignorePts = false);
+  bool ProcessIntersections(const long64 botY, const long64 topY);
+  void AddIntersectNode(TEdge *e1, TEdge *e2, const IntPoint &pt);
+  void BuildIntersectList(const long64 botY, const long64 topY);
+  void ProcessIntersectList();
+  void ProcessEdgesAtTopOfScanbeam(const long64 topY);
+  void BuildResult(Polygons& polys);
+  void BuildResultEx(ExPolygons& polys);
+  void SetHoleState(TEdge *e, OutRec *OutRec);
+  void DisposeIntersectNodes();
+  bool FixupIntersections();
+  void FixupOutPolygon(OutRec &outRec);
+  bool IsHole(TEdge *e);
+  void FixHoleLinkage(OutRec *outRec);
+  void CheckHoleLinkages1(OutRec *outRec1, OutRec *outRec2);
+  void CheckHoleLinkages2(OutRec *outRec1, OutRec *outRec2);
+  void AddJoin(TEdge *e1, TEdge *e2, int e1OutIdx = -1, int e2OutIdx = -1);
+  void ClearJoins();
+  void AddHorzJoin(TEdge *e, int idx);
+  void ClearHorzJoins();
+  void JoinCommonEdges(bool fixHoleLinkages);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+class clipperException : public std::exception
+{
+  public:
+    clipperException(const char* description): m_descr(description) {}
+    virtual ~clipperException() throw() {}
+    virtual const char* what() const throw() {return m_descr.c_str();}
+  private:
+    std::string m_descr;
+};
+//------------------------------------------------------------------------------
+
+} //ClipperLib namespace
+
+#endif //clipper_hpp
+
+


=====================================
renderers/agg/src/clipper.cpp
=====================================
The diff for this file was not included because it is too large.

=====================================
version.rc.in
=====================================
@@ -1,53 +1,53 @@
-#include "winres.h"
-
-#define VER_FILEVERSION             @MapServer_VERSION_MAJOR@, at MapServer_VERSION_MINOR@, at MapServer_VERSION_REVISION@,0
-#define VER_FILEVERSION_STR         "@MapServer_VERSION_STRING@\0"
-
-#define VER_PRODUCTVERSION             @MapServer_VERSION_MAJOR@, at MapServer_VERSION_MINOR@, at MapServer_VERSION_REVISION@,0
-#define VER_PRODUCTVERSION_STR         "@MapServer_VERSION_STRING@\0"
-
-#ifndef DEBUG
-#define VER_DEBUG                   0
-#else
-#define VER_DEBUG                   VS_FF_DEBUG
-#endif
-
-VS_VERSION_INFO VERSIONINFO
-	FILEVERSION    	VER_FILEVERSION
-	PRODUCTVERSION 	VER_PRODUCTVERSION
-    FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
-	FILEFLAGS      	VER_DEBUG
-    FILEOS VOS__WINDOWS32
-    FILETYPE VFT_DLL
-    FILESUBTYPE VFT2_UNKNOWN
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904E4"
-        BEGIN
-            VALUE "CompanyName",      "MapServer"
-            VALUE "FileDescription",  "MapServer"
-            VALUE "FileVersion",      VER_FILEVERSION_STR
-            VALUE "InternalName",     ""
-            VALUE "LegalCopyright",   "Copyright (c) 2017 MapServer"
-            VALUE "LegalTrademarks1", ""
-            VALUE "LegalTrademarks2", ""
-            VALUE "OriginalFilename", ""
-            VALUE "ProductName",      "MapServer"
-            VALUE "ProductVersion",   VER_PRODUCTVERSION_STR
-        END
-    END
-
-    BLOCK "VarFileInfo"
-    BEGIN
-        /* The following line should only be modified for localized versions.     */
-        /* It consists of any number of WORD,WORD pairs, with each pair           */
-        /* describing a language,codepage combination supported by the file.      */
-        /*                                                                        */
-        /* For example, a file might have values "0x409,1252" indicating that it  */
-        /* supports English language (0x409) in the Windows ANSI codepage (1252). */
-
-        VALUE "Translation", 0x409, 1252
-
-    END
+#include "winres.h"
+
+#define VER_FILEVERSION             @MapServer_VERSION_MAJOR@, at MapServer_VERSION_MINOR@, at MapServer_VERSION_REVISION@,0
+#define VER_FILEVERSION_STR         "@MapServer_VERSION_STRING@\0"
+
+#define VER_PRODUCTVERSION             @MapServer_VERSION_MAJOR@, at MapServer_VERSION_MINOR@, at MapServer_VERSION_REVISION@,0
+#define VER_PRODUCTVERSION_STR         "@MapServer_VERSION_STRING@\0"
+
+#ifndef DEBUG
+#define VER_DEBUG                   0
+#else
+#define VER_DEBUG                   VS_FF_DEBUG
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+	FILEVERSION    	VER_FILEVERSION
+	PRODUCTVERSION 	VER_PRODUCTVERSION
+    FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+	FILEFLAGS      	VER_DEBUG
+    FILEOS VOS__WINDOWS32
+    FILETYPE VFT_DLL
+    FILESUBTYPE VFT2_UNKNOWN
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904E4"
+        BEGIN
+            VALUE "CompanyName",      "MapServer"
+            VALUE "FileDescription",  "MapServer"
+            VALUE "FileVersion",      VER_FILEVERSION_STR
+            VALUE "InternalName",     ""
+            VALUE "LegalCopyright",   "Copyright (c) 2017 MapServer"
+            VALUE "LegalTrademarks1", ""
+            VALUE "LegalTrademarks2", ""
+            VALUE "OriginalFilename", ""
+            VALUE "ProductName",      "MapServer"
+            VALUE "ProductVersion",   VER_PRODUCTVERSION_STR
+        END
+    END
+
+    BLOCK "VarFileInfo"
+    BEGIN
+        /* The following line should only be modified for localized versions.     */
+        /* It consists of any number of WORD,WORD pairs, with each pair           */
+        /* describing a language,codepage combination supported by the file.      */
+        /*                                                                        */
+        /* For example, a file might have values "0x409,1252" indicating that it  */
+        /* supports English language (0x409) in the Windows ANSI codepage (1252). */
+
+        VALUE "Translation", 0x409, 1252
+
+    END
 END
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/-/commit/55896115dbfe423b7d4302a492285d1e7596f68b

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/-/commit/55896115dbfe423b7d4302a492285d1e7596f68b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20201208/c8488e96/attachment-0001.html>


More information about the Pkg-grass-devel mailing list