assertEquals("circle", SLD.wellKnownName(SLD.mark(point))); assertEquals(color("CC3300"), SLD.color(SLD.fill(point))); assertEquals(12, SLD.pointSize(point)); assertEquals("circle", SLD.wellKnownName(SLD.mark(point))); assertEquals(color("CC3300"), SLD.color(SLD.fill(point))); assertEquals(8, SLD.pointSize(point)); assertEquals("circle", SLD.wellKnownName(SLD.mark(point))); assertEquals(color("CC3300"), SLD.color(SLD.fill(point))); assertEquals(4, SLD.pointSize(point));
setFillColorItems(SLD.pointFill(pointSym)); setFillOpacityItems(SLD.pointOpacity(pointSym)); setPointSizeItems(SLD.pointSize(pointSym)); setPointSymbolItems(SLD.pointWellKnownName(pointSym));
@Test public void testPointSimple() throws Exception { // <UserStyle> // <Title>SLD Cook Book: Simple Point With Stroke</Title> // <FeatureTypeStyle> // <Rule> // <PointSymbolizer> // <Graphic> // <Mark> // <WellKnownName>circle</WellKnownName> // <Fill> // <CssParameter name="fill">#FF0000</CssParameter> // </Fill> // </Mark> // <Size>6</Size> // </Graphic> // </PointSymbolizer> // </Rule> // </FeatureTypeStyle> // </UserStyle> Style style = parse("point", "simple.sld"); assertEquals("SLD Cook Book: Simple Point With Stroke", style.getTitle()); PointSymbolizer point = SLD.pointSymbolizer(style); assertEquals("circle", SLD.wellKnownName(SLD.mark(point))); assertEquals(1, point.getGraphic().graphicalSymbols().size()); assertEquals(Color.red, SLD.color(SLD.fill(point))); assertEquals(6, SLD.pointSize(point)); }
assertEquals(1, point.getGraphic().graphicalSymbols().size()); assertEquals(Color.red, SLD.color(SLD.fill(point))); assertEquals(6, SLD.pointSize(point));
@Test public void testPointWithRotation() throws Exception { // <UserStyle> // <Title>GeoServer SLD Cook Book: Rotated square</Title> // <FeatureTypeStyle> // <Rule> // <PointSymbolizer> // <Graphic> // <Mark> // <WellKnownName>square</WellKnownName> // <Fill> // <CssParameter name="fill">#009900</CssParameter> // </Fill> // </Mark> // <Size>12</Size> // <Rotation>45</Rotation> // </Graphic> // </PointSymbolizer> // </Rule> // </FeatureTypeStyle> // </UserStyle> Style style = parse("point", "rotated-square.sld"); PointSymbolizer point = SLD.pointSymbolizer(style); assertEquals("square", SLD.wellKnownName(SLD.mark(point))); assertEquals(color("009900"), SLD.color(SLD.fill(point))); assertEquals(12, SLD.pointSize(point)); assertEquals(45, Filters.asInt(SLD.graphic(point).getRotation())); }
assertEquals(6, SLD.pointSize(point));
assertEquals(Color.black, SLD.color(SLD.stroke(point))); assertEquals(2, SLD.width(SLD.stroke(point))); assertEquals(12, SLD.pointSize(point));
setFillColorItems( SLD.pointFill(pointSym) ); setFillOpacityItems( SLD.pointOpacity(pointSym) ); setPointSizeItems( SLD.pointSize(pointSym) ); setPointSymbolItems( SLD.pointWellKnownName(pointSym) );