Issue Type: Bug Bug
Assignee: Andrea Aime
Components: render
Created: 10/Oct/12 12:51 AM
Description:

I found an issue where the SDL renderer gets into an infinite loop when
using a GraphicStroke line simbolyzer with the uom extension. To
reproduce, consider the following SDL fragment:

<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/metre">
<sld:Stroke>
<sld:GraphicStroke>
<sld:Graphic>
<sld:Mark>
<sld:WellKnownName>shape://vertline</sld:WellKnownName>
<sld:Stroke>
<sld:CssParameter
name="stroke">#000000</sld:CssParameter>
<sld:CssParameter
name="stroke-width">1</sld:CssParameter>
</sld:Stroke>
</sld:Mark>
<sld:Size>12</sld:Size>
</sld:Graphic>
</sld:GraphicStroke>
<sld:CssParameter name="stroke-dasharray">12 18</sld:CssParameter>
</sld:Stroke>
</sld:LineSymbolizer>

when trying to render, say lines of an OSM database with the above,
geoserver gets into an infinite loop.

I looked at the code, and found the following, although I'm not sure how
to fix the issue. the infinite loop is this one, in StyledShapePainter,
starting at line 466:

for (dist = remainder; dist < len; dist += imageSize) { renderGraphicsStroke(graphics, x, y, graphicStroke, rotation, 1, isLabelObstacle); x += dx; y += dy; }

and the reason is that imageSize == 0, thus dist does not increase.

looking at the code, it turns out that imageSize comes from a
MarkStyle2D object's size attribute, which is 0. it is set to 0 in
SLDStyleFactory.createPointStyle(), line 647:

ms2d.setSize((int) size);

where this size value is set at line 542 in the same function:

size = evalToDouble(sldGraphic.getSize(), feature, 0);

now, the (double) size value is calculated to less than 1 (but still
greater than 0), and casting to int will turn it into 0.

Environment: geoserver, JDK 1.6
Project: GeoTools
Priority: Minor Minor
Reporter: Ákos Maróy
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to