Problem with cartoline

Mathieu Bertrand mjbertrand at GMAIL.COM
Fri Nov 11 13:30:03 EST 2005


Hi,

here is the shapefile and the complete mapfile.

Maybe you would have to change the path in the mapfile...

Thank you,
-Mathieu

On 11/10/05, Steve Lime <steve.lime at dnr.state.mn.us> wrote:
> What would really help in this case is the source data (as a shapefile).
>
> Steve
>
> >>> Mathieu Bertrand <mjbertrand at GMAIL.COM> 11/10/05 2:39 PM >>>
> Hi,
>
> I have a problem when I come to draw a cartoline with many points very close.
>
> Please see the original .png attach with this message.  You will see
> that sometime, the perpendicular line is drawn twice and not with the
> same angle, the problem always appear in the curve of the line where
> the points are very close.
>
> Here is my style define in my .map:
> --------------
> --------------
>         CLASSITEM "TYPE"
>                 CLASS
>                 NAME "Secondary Road - Paved"
>                 STYLE
>                         COLOR 0 0 0
>                         SYMBOL "circle"
>                         SIZE 1
>                         ANTIALIAS TRUE
>                 END
>                 STYLE
>                         COLOR 0 0 0
>                         SYMBOL "test"
>                         SIZE 10
>                         OFFSET -6 -99
>                         ANTIALIAS TRUE
>                 END
> -------------
> -------------
>
> and my symbol (also define in my .map):
> -------------
> -------------
> SYMBOL
>   NAME 'test'
>   TYPE CARTOLINE
>   LINECAP BUTT
>   LINEJOIN none
>   STYLE 1 20 END
> END
> ----------
> ----------
>
> I played a little bit with the source code and discover that the
> problem come from the last part of the function "RenderCartoLine"
> (mapgd.c)
>
> ------
>   if (drawpoly) {
>     if (gox)
>     {
>       poly_points[2].x = MS_NINT(bn+db_pxn*size);
>       poly_points[2].y = MS_NINT(an+da_pxn*size);
>       poly_points[3].x = MS_NINT(bn);
>       poly_points[3].y = MS_NINT(an);
>     }
>     else
>     {
>       poly_points[2].x = MS_NINT(an+da_pxn*size);
>       poly_points[2].y = MS_NINT(bn+db_pxn*size);
>       poly_points[3].x = MS_NINT(an);
>       poly_points[3].y = MS_NINT(bn);
>     }
>
>         if (antialias) {
>         /* gdImageSetAntiAliased(img, color); */
>           gdImageSetAntiAliasedDontBlend(img, color, color);
>           if (size > 1)
>           {
>                 gdImageFilledPolygon(img, poly_points, 4, gdAntiAliased);
>           }
>           else
>           {
>                 gdImageLine(img, poly_points[0].x, poly_points[0].y,
> poly_points[3].x, poly_points[3].y, gdAntiAliased);
>           }
>         }
>         else
>         {
>           if (size > 1)
>           {
>                 gdImageFilledPolygon(img, poly_points, 4, color);
>           }
>           else
>           {
>                 gdImageLine(img, poly_points[0].x, poly_points[0].y,
> poly_points[3].x, poly_points[3].y, color);
>           }
>         }
>   }
> ---------
>
> What is the objective of that code, it's seem that it's only repeating
> the code above (but I know that it's not)... If I set drawpoly = 0
> just before "if (drawpoly)", it's resolve the problem, but then there
> is problem when drawing a cartoline with a style like "4 10" (width of
> the perpendicular line more than 1)
>
> Anybody could help me with that problem ? Anybody with idea ?
>
> Thank you
> -Mathieu Bertrand
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestMB3_polyline.dbf
Type: application/octet-stream
Size: 3734 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20051111/cb133c9d/TestMB3_polyline.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestMB3_polyline.prj
Type: application/octet-stream
Size: 555 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20051111/cb133c9d/TestMB3_polyline-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestMB3_polyline.shp
Type: application/octet-stream
Size: 4132 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20051111/cb133c9d/TestMB3_polyline-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestMB3_polyline.shx
Type: application/octet-stream
Size: 180 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20051111/cb133c9d/TestMB3_polyline-0003.obj
-------------- next part --------------
#'''''''''''''''''''''''''''''''''''''
#'MapServer Map File
#'Created using WriteMapServerMapFile.mbx Version 1.17
#'Dany Bouchard, Benjamin Campin, DBx GEOMATICS INC.
#'September 2005
#'''''''''''''''''''''''''''''''''''''

NAME DBXMAP
IMAGECOLOR 255 255 255
RESOLUTION 72
SIZE 570 400
STATUS ON
EXTENT 1767936.86 91571.61 1769831.12 92634.25
UNITS FEET
SHAPEPATH ""
FONTSET fonts.list
SYMBOLSET symbols.list

QUERYMAP
	STATUS ON
	STYLE HILITE
	COLOR 255 0 0
END

WEB
	IMAGEPATH "C:\Inetpub\wwwroot\mapserver_csharp\tmp\"
	IMAGEURL "tmp/"
END

#'''''''''''''''''''''''''''''''''''''
#'Start of Layers...
#'''''''''''''''''''''''''''''''''''''

#=============================================================
LAYER
  NAME "TestMB3_polyline"
	TYPE LINE
	CONNECTIONTYPE OGR
 	CONNECTION "C:\Projects\Nantucket\TestMB3_polyline.shp"
 	PROCESSING "CLOSE_CONNECTION=DEFER"	
 	STATUS ON
	CLASSITEM "TYPE"
		CLASS
		NAME "Secondary Road - Paved"
		STYLE
			COLOR 0 0 0
			SYMBOL "circle"
			SIZE 1
			ANTIALIAS TRUE
		END
		STYLE
			COLOR 0 0 0
			SYMBOL "mipen29_1"
			SIZE 10
			OFFSET -6 -99
			PARALLELOFFSET 0
			ANTIALIAS TRUE
		END
	END
	TEMPLATE 'DUMMY.HTML' # This is required for info tool...
	TRANSPARENCY 100
END

#'''''''''''''''''''''''''''''''''''''
#'End of Layers...
#'''''''''''''''''''''''''''''''''''''

OUTPUTFORMAT
	NAME png
	DRIVER "GD/PNG"
	MIMETYPE "image/png"
	IMAGEMODE PC256
	EXTENSION "png"
END

#'''''''''''''''''''''''''''''''''''''
#'Symbol definitions...
#'''''''''''''''''''''''''''''''''''''
SYMBOL
  NAME 'mipen29_1'
  TYPE CARTOLINE
  LINECAP BUTT
  LINEJOIN none
  STYLE 1 20 END
END
#'''''''''''''''''''''''''''''''''''''
#'End of symbol definitions...
#'''''''''''''''''''''''''''''''''''''
END


More information about the mapserver-dev mailing list