Hello all. Excuse me if this topic has been dealt with before, but I couldn't find any relevant information on this.
I have a case where I want to display an external graphic on top of a line geometry. The grahpic is used to indicate certain properties of the line. Anyways: I quickly found out that, for labels (i.e. textSymbolizers) this was easy, make a rule with both a LineSymbolizer and a TextSymbolizers. The label seems to be drawn on the centerpoint of the visible part of the line (and, most important: on _top_ of the line). Following this line of thought i tried using the same approach with a PointSymbolizer (in this case with a Graphic, but the plan is an ExternalGraphic). In this case however, with a LineSymbolizer and a PointSymbolizer in the same rule, the graphic is drawn at what seems to be the center if the line is converted to a polygon: i.e. for curved lines not on top of the line, but in the vinciity. See the attached image for how the PointSymolizer and TextSymbolizer places its content relative to the line (the x is a TextSymbolizerm the dot is a PointSymbolizer). The SLD I'm currently using is atteched beneath. So, the question is if it is possible to use a PointSymbolizer to draw it's content in the same position (relative to a line) as the TextSymbolizer does. The easy solution would of course be to use a TextSymbolizer instead, but we kinda require an icon on the, which calls for a PointSymbolizer. And, more out of interest: another question is wether the difference between Points and Text relative to lines are on purpose, or just something that noone has thought of? best regards Atle Sveen Geomatikk IKT <?xml version="1.0" encoding="ISO-8859-1"?> <StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"> <NamedLayer> <Name>Message and incident Lines</Name> <UserStyle> <Name>Message and incident Lines</Name> <Title>Points</Title> <Abstract>Lines for message and incidents</Abstract> <FeatureTypeStyle> <Rule> <Title>Line</Title> <ogc:Filter> <ogc:And> <ogc:PropertyIsEqualTo> <ogc:PropertyName>type</ogc:PropertyName> <ogc:Literal>message</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>case</ogc:PropertyName> <ogc:Literal>17</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:And> </ogc:Filter> <LineSymbolizer> <Stroke> <CssParameter name="stroke">#CC00CC</CssParameter> <CssParameter name="stroke-width">3</CssParameter> </Stroke> </LineSymbolizer> <PointSymbolizer> <Graphic> <Mark> <WellKnownName>circle</WellKnownName> <Fill> <CssParameter name="fill">#FF0000</CssParameter> </Fill> </Mark> <Size>6</Size> </Graphic> </PointSymbolizer> <TextSymbolizer> <Label> <ogc:Literal>x</ogc:Literal> </Label> <Fill> <CssParameter name="fill">#FF0000</CssParameter> </Fill> </TextSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor> -- Atle Frenvik Sveen Utvikler Geomatikk IKT AS tlf: 45 27 86 89 [email protected]
<<attachment: geoserver_label_point_on_line.png>>
------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
