[mapserver-commits] r9901 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Feb 24 18:08:55 EST 2010
Author: warmerdam
Date: 2010-02-24 18:08:55 -0500 (Wed, 24 Feb 2010)
New Revision: 9901
Modified:
trunk/mapserver/mapproject.c
Log:
fixed problem with projectrectaspolygon
Modified: trunk/mapserver/mapproject.c
===================================================================
--- trunk/mapserver/mapproject.c 2010-02-24 23:07:28 UTC (rev 9900)
+++ trunk/mapserver/mapproject.c 2010-02-24 23:08:55 UTC (rev 9901)
@@ -818,7 +818,7 @@
msProjectShapeLine( in, out, &polygonObj, 0 );
/* If no points reprojected, try a grid sampling */
- if( ring.numpoints == 0 )
+ if( polygonObj.numlines == 0 || polygonObj.line[0].numpoints == 0 )
{
msFreeShape( &polygonObj );
return msProjectRectGrid( in, out, rect );
@@ -827,15 +827,17 @@
/* -------------------------------------------------------------------- */
/* Collect bounds. */
/* -------------------------------------------------------------------- */
- rect->minx = rect->maxx = ringPoints[0].x;
- rect->miny = rect->maxy = ringPoints[0].y;
+ rect->minx = rect->maxx = polygonObj.line[0].point[0].x;
+ rect->miny = rect->maxy = polygonObj.line[0].point[0].y;
- for( ix = 1; ix < ring.numpoints; ix++ )
+ for( ix = 1; ix < polygonObj.line[0].numpoints; ix++ )
{
- rect->minx = MS_MIN(rect->minx,ringPoints[ix].x);
- rect->maxx = MS_MAX(rect->maxx,ringPoints[ix].x);
- rect->miny = MS_MIN(rect->miny,ringPoints[ix].y);
- rect->maxy = MS_MAX(rect->maxy,ringPoints[ix].y);
+ pointObj *pnt = polygonObj.line[0].point + ix;
+
+ rect->minx = MS_MIN(rect->minx,pnt->x);
+ rect->maxx = MS_MAX(rect->maxx,pnt->x);
+ rect->miny = MS_MIN(rect->miny,pnt->y);
+ rect->maxy = MS_MAX(rect->maxy,pnt->y);
}
msFreeShape( &polygonObj );
More information about the mapserver-commits
mailing list