本文整理了Java中org.geotools.styling.Rule.setSymbolizers
方法的一些代码示例,展示了Rule.setSymbolizers
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.setSymbolizers
方法的具体详情如下:
包路径:org.geotools.styling.Rule
类名称:Rule
方法名:setSymbolizers
[英]The symbolizers contain the actual styling information for different geometry types. A single feature may be rendered by more than one of the symbolizers returned by this method. It is important that the symbolizers be applied in the order in which they are returned if the end result is to be as intended. All symbolizers should be applied to all features which make it through the filters in this rule regardless of the features' geometry. For example, a polygon symbolizer should be applied to line geometries and even points. If this is not the desired beaviour, ensure that either the filters block inappropriate features or that the FeatureTypeStyler which contains this rule has its FeatureTypeName or SemanticTypeIdentifier set appropriately.
[中]符号器包含不同几何体类型的实际样式信息。单个特征可以由该方法返回的多个符号呈现。如果最终结果如预期的那样,则必须按照返回符号的顺序应用符号。所有符号都应应用于通过本规则中过滤器的所有特征,无论特征的几何结构如何。例如,多边形符号器应应用于直线几何图形和偶数点。如果这不是所需的beaviour,请确保过滤器阻止不适当的功能,或者包含此规则的FeatureTypeStyler的FeatureTypeName或SemanticTypeIdentifier设置正确。
代码示例来源:origin: geotools/geotools
/**
* create a simple styling rule, see the SLD Spec for more details of scaleDenominators
*
* @param symbolizers - an array of symbolizers to use
* @param minScaleDenominator - the minimim scale to draw the feature at
* @param maxScaleDenominator - the maximum scale to draw the feature at
* @return the new rule
*/
public Rule createRule(
Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator) {
Rule r = sf.createRule();
r.setSymbolizers(symbolizers);
if (!Double.isNaN(maxScaleDenominator)) {
r.setMaxScaleDenominator(maxScaleDenominator);
} else {
r.setMaxScaleDenominator(Double.POSITIVE_INFINITY);
}
if (!Double.isNaN(minScaleDenominator)) {
r.setMinScaleDenominator(minScaleDenominator);
} else {
r.setMinScaleDenominator(0.0);
}
return r;
}
代码示例来源:origin: geotools/geotools
rule.setSymbolizers(symbolizers.toArray(new Symbolizer[0]));
代码示例来源:origin: geotools/geotools
rules[0].setSymbolizers(new Symbolizer[] {symb1});
LOGGER.fine("added low class " + breaks[0] + " " + colors[0]);
rules[i].setSymbolizers(new Symbolizer[] {symb});
rules[i].setFilter(cf);
rules[colors.length - 1].setSymbolizers(new Symbolizer[] {symb2});
LOGGER.fine(
"added upper class "
rules[colors.length].setSymbolizers(new Symbolizer[] {elsePoly});
rules[colors.length].setElseFilter(true);
代码示例来源:origin: geotools/geotools
copy.setSymbolizers(symsCopy);
copy.setDescription(descCopy);
copy.setLegendGraphic(legendCopy);
代码示例来源:origin: geotools/geotools
public void testRule() throws Exception {
Symbolizer symb1 =
styleFactory.createLineSymbolizer(styleFactory.getDefaultStroke(), "geometry");
Symbolizer symb2 =
styleFactory.createPolygonSymbolizer(
styleFactory.getDefaultStroke(), styleFactory.getDefaultFill(), "shape");
Rule rule = styleFactory.createRule();
rule.setSymbolizers(new Symbolizer[] {symb1, symb2});
Rule clone = (Rule) ((Cloneable) rule).clone();
assertClone(rule, clone);
symb2 =
styleFactory.createPolygonSymbolizer(
styleFactory.getDefaultStroke(), styleFactory.getDefaultFill(), "shape");
Rule notEq = styleFactory.createRule();
notEq.setSymbolizers(new Symbolizer[] {symb2});
assertEqualsContract(clone, notEq, rule);
symb1 = styleFactory.createLineSymbolizer(styleFactory.getDefaultStroke(), "geometry");
clone.setSymbolizers(new Symbolizer[] {symb1});
assertTrue(!rule.equals(clone));
}
代码示例来源:origin: geotools/geotools
public void testRule() throws Exception {
Symbolizer symb1 = sf.createLineSymbolizer(sf.getDefaultStroke(), "geometry");
Symbolizer symb2 =
sf.createPolygonSymbolizer(sf.getDefaultStroke(), sf.getDefaultFill(), "shape");
Rule rule = sf.createRule();
rule.setSymbolizers(new Symbolizer[] {symb1, symb2});
rule.accept(visitor);
Rule clone = (Rule) visitor.getCopy();
assertCopy(rule, clone);
assertEqualsContract(rule, clone);
symb2 = sf.createPolygonSymbolizer(sf.getDefaultStroke(), sf.getDefaultFill(), "shape");
Rule notEq = sf.createRule();
notEq.setSymbolizers(new Symbolizer[] {symb2});
assertEqualsContract(clone, notEq, rule);
symb1 = sf.createLineSymbolizer(sf.getDefaultStroke(), "geometry");
clone.setSymbolizers(new Symbolizer[] {symb1});
assertTrue(!rule.equals(clone));
}
代码示例来源:origin: geotools/geotools
rule.setSymbolizers((Symbolizer[]) syms.toArray(new Symbolizer[syms.size()]));
代码示例来源:origin: geotools/geotools
rule.setSymbolizers(new Symbolizer[] {polysym(sFac)});
FeatureTypeStyle fts = sFac.createFeatureTypeStyle(new Rule[] {rule});
fts.setFeatureTypeName("polygonfeature");
rule.setSymbolizers(new Symbolizer[] {polysym(sFac)});
FeatureTypeStyle fts1 = sFac.createFeatureTypeStyle(new Rule[] {rule1});
fts1.setFeatureTypeName("polygonfeature");
rule2.setSymbolizers(new Symbolizer[] {linesym(sFac)});
FeatureTypeStyle fts2 = sFac.createFeatureTypeStyle();
fts2.setRules(new Rule[] {rule2});
rule3.setSymbolizers(new Symbolizer[] {pointsym});
FeatureTypeStyle fts3 = sFac.createFeatureTypeStyle();
fts3.setRules(new Rule[] {rule3});
rule4.setSymbolizers(new Symbolizer[] {polysym(sFac), linesym(sFac)});
FeatureTypeStyle fts4 = sFac.createFeatureTypeStyle();
fts4.setRules(new Rule[] {rule4});
rule5.setSymbolizers(new Symbolizer[] {linesym(sFac)});
FeatureTypeStyle fts5 = sFac.createFeatureTypeStyle();
fts5.setRules(new Rule[] {rule5});
代码示例来源:origin: geotools/geotools
@Test
public void testRule() throws Exception {
Symbolizer symb1 = sf.createLineSymbolizer(sf.getDefaultStroke(), "geometry");
Symbolizer symb2 =
sf.createPolygonSymbolizer(sf.getDefaultStroke(), sf.getDefaultFill(), "shape");
RasterSymbolizer symb3 = sf.createRasterSymbolizer();
Rule rule = sf.createRule();
rule.setSymbolizers(new Symbolizer[] {symb1, symb2, symb3});
rule.accept(visitor);
Rule clone = (Rule) visitor.getCopy();
assertNotNull(clone);
}
代码示例来源:origin: geotools/geotools
rulep.setSymbolizers(new Symbolizer[] {pointsym});
FeatureTypeStyle ftsP = sFac.createFeatureTypeStyle();
ftsP.setRules(new Rule[] {rulep});
rule2.setSymbolizers(new Symbolizer[] {linesym});
FeatureTypeStyle ftsL = sFac.createFeatureTypeStyle();
ftsL.setRules(new Rule[] {rule2});
polysym.setStroke(sFac.getDefaultStroke());
Rule rule = sFac.createRule();
rule.setSymbolizers(new Symbolizer[] {polysym});
FeatureTypeStyle ftsPoly = sFac.createFeatureTypeStyle(new Rule[] {rule});
代码示例来源:origin: org.geoserver.community/gs-sldservice
color = colors.next();
rule = it.next();
rule.setSymbolizers(new Symbolizer[] {sb.createLineSymbolizer(color)});
代码示例来源:origin: org.geotools/gt2-main
/**
* create a simple styling rule, see the SLD Spec for more details of scaleDenominators
*
* @param symbolizers - an array of symbolizers to use
* @param minScaleDenominator - the minimim scale to draw the feature at
* @param maxScaleDenominator - the maximum scale to draw the feature at
*
* @return the new rule
*/
public Rule createRule(
Symbolizer[] symbolizers,
double minScaleDenominator,
double maxScaleDenominator) {
Rule r = sf.createRule();
r.setSymbolizers(symbolizers);
if (!Double.isNaN(maxScaleDenominator)) {
r.setMaxScaleDenominator(maxScaleDenominator);
} else {
r.setMaxScaleDenominator(Double.MAX_VALUE);
}
if (!Double.isNaN(minScaleDenominator)) {
r.setMinScaleDenominator(minScaleDenominator);
} else {
r.setMinScaleDenominator(0.0);
}
return r;
}
代码示例来源:origin: org.geotools/gt-main
/**
* create a simple styling rule, see the SLD Spec for more details of scaleDenominators
*
* @param symbolizers - an array of symbolizers to use
* @param minScaleDenominator - the minimim scale to draw the feature at
* @param maxScaleDenominator - the maximum scale to draw the feature at
*
* @return the new rule
*/
public Rule createRule(
Symbolizer[] symbolizers,
double minScaleDenominator,
double maxScaleDenominator) {
Rule r = sf.createRule();
r.setSymbolizers(symbolizers);
if (!Double.isNaN(maxScaleDenominator)) {
r.setMaxScaleDenominator(maxScaleDenominator);
} else {
r.setMaxScaleDenominator(Double.POSITIVE_INFINITY);
}
if (!Double.isNaN(minScaleDenominator)) {
r.setMinScaleDenominator(minScaleDenominator);
} else {
r.setMinScaleDenominator(0.0);
}
return r;
}
代码示例来源:origin: org.geotools.demo/gt-mappane-use
public void setDefaultStyle() {
RasterSymbolizer symbolizer = factory.createRasterSymbolizer();
// SLDParser stylereader = new SLDParser(factory,sld);
// org.geotools.styling.Style[] style = stylereader.readXML();
Style style = factory.createStyle();
Rule[] rules = new Rule[1];
rules[0] = factory.createRule();
rules[0].setSymbolizers(new Symbolizer[] { symbolizer });
FeatureTypeStyle type = factory.createFeatureTypeStyle(rules);
style.addFeatureTypeStyle(type);
setStyle(style);
}
代码示例来源:origin: org.geotools.demo/gt2-demo-mappane
public void setDefaultStyle() {
RasterSymbolizer symbolizer = factory.createRasterSymbolizer();
// SLDParser stylereader = new SLDParser(factory,sld);
// org.geotools.styling.Style[] style = stylereader.readXML();
Style style = factory.createStyle();
Rule[] rules = new Rule[1];
rules[0] = factory.createRule();
rules[0].setSymbolizers(new Symbolizer[] { symbolizer });
FeatureTypeStyle type = factory.createFeatureTypeStyle(rules);
style.addFeatureTypeStyle(type);
setStyle(style);
}
代码示例来源:origin: org.geotools/gt-main
copy.setSymbolizers(symsCopy);
copy.setDescription(descCopy);
copy.setLegendGraphic(legendCopy);
代码示例来源:origin: org.geotools/gt2-main
copy.setName(rule.getName());
copy.setTitle(rule.getTitle());
copy.setSymbolizers(symbolizerCopy);
代码示例来源:origin: org.geotools/gt2-main
copy.setName(rule.getName());
copy.setTitle(rule.getTitle());
copy.setSymbolizers(symbolizerCopy);
代码示例来源:origin: bcdev/beam
@SuppressWarnings({"deprecation"})
private static Style createStyle() {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
PolygonSymbolizer symbolizer = styleFactory.createPolygonSymbolizer();
Fill fill = styleFactory.createFill(
filterFactory.literal("#FFAA00"),
filterFactory.literal(0.5)
);
symbolizer.setFill(fill);
Rule rule = styleFactory.createRule();
rule.setSymbolizers(new Symbolizer[]{symbolizer});
FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle();
fts.setRules(new Rule[]{rule});
Style style = styleFactory.createStyle();
style.addFeatureTypeStyle(fts);
return style;
}
代码示例来源:origin: senbox-org/snap-desktop
@SuppressWarnings({"deprecation"})
private static Style createStyle() {
StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null);
FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);
PolygonSymbolizer symbolizer = styleFactory.createPolygonSymbolizer();
Fill fill = styleFactory.createFill(
filterFactory.literal("#FFAA00"),
filterFactory.literal(0.5)
);
symbolizer.setFill(fill);
Rule rule = styleFactory.createRule();
rule.setSymbolizers(new Symbolizer[]{symbolizer});
FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle();
fts.setRules(new Rule[]{rule});
Style style = styleFactory.createStyle();
style.addFeatureTypeStyle(fts);
return style;
}
内容来源于网络,如有侵权,请联系作者删除!