Codota Logo
StyleAttributeExtractor
Code IndexAdd Codota to your IDE (free)

How to use
StyleAttributeExtractor
in
org.geotools.styling

Best Java code snippets using org.geotools.styling.StyleAttributeExtractor (Showing top 16 results out of 315)

  • Common ways to obtain StyleAttributeExtractor
private void myMethod () {
StyleAttributeExtractor s =
  • Codota Iconnew StyleAttributeExtractor()
  • Smart code suggestions by Codota
}
origin: org.geoserver/wms

/**
 * Checks to make sure that the style passed in can process the FeatureType.
 * 
 * @param style
 *            The style to check
 * @param fType
 *            The source requested.
 * 
 * @throws WmsException
 *             DOCUMENT ME!
 */
private void checkStyle(Style style, SimpleFeatureType fType) throws WmsException {
  StyleAttributeExtractor sae = new StyleAttributeExtractor();
  sae.visit(style);
  String[] styleAttributes = sae.getAttributeNames();
  String attName;
  final int length = styleAttributes.length;
  for (int i = 0; i < length; i++) {
    attName = styleAttributes[i];
    if (fType.getDescriptor(attName) == null) {
      throw new WmsException(
          "The requested Style can not be used with "
              + "this featureType.  The style specifies an attribute of "
              + attName
              + " and the featureType definition is: "
              + fType);
    }
  }
}
origin: org.geoserver/gs-wms

private String[] getDynamicProperties(List<Rule> dynamicRules) {
  StyleAttributeExtractor extractor = new StyleAttributeExtractor();
  for (Rule rule : dynamicRules) {
    rule.accept(extractor);
  }
  return extractor.getAttributeNames();
}
origin: org.geotools/gt-render

final StyleAttributeExtractor sae = new StyleAttributeExtractor();
  rulesLength = rules.length;
  for (int j = 0; j < rulesLength; j++) {
    sae.visit(rules[j]);
    sae.visit(rules[j]);
if(sae.isUsingDynamincProperties()) {
  return null;
Set<PropertyName> attributes = sae.getAttributes();
Set<String> attributeNames = sae.getAttributeNameSet();
  if (sae.getDefaultGeometryUsed()
      && (!attributeNames.contains(schema.getGeometryDescriptor().getName().toString()))
      ) {
origin: org.geotools/gt2-render

final StyleAttributeExtractor sae = new StyleAttributeExtractor();
  rulesLength = rules.length;
  for (int j = 0; j < rulesLength; j++) {
    sae.visit(rules[j]);
    sae.visit(rules[j]);
String[] ftsAttributes = sae.getAttributeNames();
  if (sae.getDefaultGeometryUsed()
      && (!atts.contains(schema.getDefaultGeometry().getName()))) {
    atts.add(schema.getDefaultGeometry().getName());
origin: org.geotools/gt-shapefile-renderer

/**
 * Inspects the <code>MapLayer</code>'s style and retrieves it's needed attribute names,
 * returning at least the default geometry attribute name.
 * 
 * @param query DOCUMENT ME!
 * @param style the <code>Style</code> to determine the needed attributes from
 * @param schema the SimpleFeatureSource schema
 * @return the minimun set of attribute names needed to render <code>layer</code>
 */
private String[] findStyleAttributes( final Query query, Style style, SimpleFeatureType schema ) {
  StyleAttributeExtractor sae = new StyleAttributeExtractor();
  sae.visit(style);
  
  FilterAttributeExtractor qae = new FilterAttributeExtractor();
  query.getFilter().accept(qae,null);
  Set ftsAttributes = new LinkedHashSet(sae.getAttributeNameSet());
  ftsAttributes.addAll(qae.getAttributeNameSet());
  if (sae.getDefaultGeometryUsed()
      && (!ftsAttributes.contains(schema.getGeometryDescriptor().getLocalName()))) {
    ftsAttributes.add(schema.getGeometryDescriptor().getLocalName());
  } else {
    // the code following assumes the geometry column is the last one
    // make sure it's the last for good
    ftsAttributes.remove(schema.getGeometryDescriptor().getLocalName());
    ftsAttributes.add(schema.getGeometryDescriptor().getLocalName());
  }
  return (String[]) ftsAttributes.toArray(new String[0]);
}
origin: org.geoserver/gs-wms

StyleAttributeExtractor sae = new StyleAttributeExtractor();
sae.visit(style);
Set<PropertyName> styleAttributes = sae.getAttributes();
origin: org.geotools/gt-render

StyleAttributeExtractor extractor = new StyleAttributeExtractor();
FeatureType featureType = layer.getFeatureSource().getSchema();
Set<String> plainGeometries = new java.util.HashSet<String>();
      } else {
        Expression g = s.getGeometry();
        extractor.clear();
        g.accept(extractor, null);
        Set<String> attributes = extractor.getAttributeNameSet();
        for (String attribute : attributes) {
          if(plainGeometries.contains(attribute))
origin: org.geotools/gt2-shapefile-renderer

/**
 * Inspects the <code>MapLayer</code>'s style and retrieves it's needed attribute names,
 * returning at least the default geometry attribute name.
 * 
 * @param query DOCUMENT ME!
 * @param style the <code>Style</code> to determine the needed attributes from
 * @param schema the featuresource schema
 * @return the minimun set of attribute names needed to render <code>layer</code>
 */
private String[] findStyleAttributes( final Query query, Style style, FeatureType schema ) {
  StyleAttributeExtractor sae = new StyleAttributeExtractor(){
    public void visit( Rule rule ) {
      DuplicatingStyleVisitor dupeStyleVisitor = new DuplicatingStyleVisitor();
      dupeStyleVisitor.visit(rule);
      Rule clone = (Rule) dupeStyleVisitor.getCopy();
      super.visit(clone);
    }
  };
  sae.visit(style);
  
  FilterAttributeExtractor qae = new FilterAttributeExtractor();
  query.getFilter().accept(qae,null);
  Set ftsAttributes=new HashSet(sae.getAttributeNameSet());
  ftsAttributes.addAll(qae.getAttributeNameSet());
  // the code following assumes we won't extract the default geometry, and that's
  // most of the time true, but fails if the filter or the style uses it.
  ftsAttributes.remove(schema.getDefaultGeometry().getLocalName());
  return (String[]) ftsAttributes.toArray(new String[0]);
}
origin: org.geotools/gt-render

public Object visit(org.opengis.filter.expression.Function expression, Object data) {
  usingVolatileFunctions |= (expression instanceof VolatileFunction);
  return super.visit(expression, data);
};
origin: org.geoserver.importer/gs-importer-core

Style style = info.getStyle();
StyleAttributeExtractor atts = new StyleAttributeExtractor();
style.accept(atts);
assertTrue(atts.getAttributeNameSet().contains("CAT_ID"));
origin: org.geotools/gt-render

  return getAttributeCRS(null, schema);
} else {
  StyleAttributeExtractor attExtractor = new StyleAttributeExtractor();
  geometry.accept(attExtractor, null);
  for(PropertyName name : attExtractor.getAttributes()) {
    if(name.evaluate(schema) instanceof GeometryDescriptor) {
      return getAttributeCRS(name, schema);
origin: org.geotools/gt2-shapefile

StyleAttributeExtractor extractor = new StyleAttributeExtractor();
Filter filter = query.getFilter();
filter.accept(extractor, null);
String[] filterAttnames = extractor.getAttributeNames();
origin: org.geotools/gt2-main

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Symbolizer)
 */
public void visit(Symbolizer sym) {
  if (sym instanceof PointSymbolizer) {
    visit((PointSymbolizer) sym);
  }
  if (sym instanceof LineSymbolizer) {
    visit((LineSymbolizer) sym);
  }
  if (sym instanceof PolygonSymbolizer) {
    visit((PolygonSymbolizer) sym);
  }
  if (sym instanceof TextSymbolizer) {
    visit((TextSymbolizer) sym);
  }
  if (sym instanceof RasterSymbolizer) {
    visit((RasterSymbolizer) sym);
  }
}
origin: org.geoserver/wms

StyleAttributeExtractor sae = new StyleAttributeExtractor();
sae.visit(style);
String[] styleAttributes = sae.getAttributeNames();
origin: org.geotools/gt-render

/**
 * @see org.geotools.styling.StyleVisitor#visit(org.geotools.styling.Symbolizer)
 */
public void visit(Symbolizer sym) {
  if (sym instanceof PointSymbolizer) {
    visit((PointSymbolizer) sym);
  }
  if (sym instanceof LineSymbolizer) {
    visit((LineSymbolizer) sym);
  }
  if (sym instanceof PolygonSymbolizer) {
    visit((PolygonSymbolizer) sym);
  }
  if (sym instanceof TextSymbolizer) {
    visit((TextSymbolizer) sym);
  }
  if (sym instanceof RasterSymbolizer) {
    visit((RasterSymbolizer) sym);
  }
}
origin: org.geotools/gt2-shapefile-renderer

  public void visit( Rule rule ) {
    DuplicatingStyleVisitor dupeStyleVisitor = new DuplicatingStyleVisitor();
    dupeStyleVisitor.visit(rule);
    Rule clone = (Rule) dupeStyleVisitor.getCopy();
    super.visit(clone);
  }
};
org.geotools.stylingStyleAttributeExtractor

Javadoc

=========================================================================== if you're modifying this, you probably should also take a look at StyleAttributeExtractorTruncated ===========================================================================

Most used methods

  • <init>
  • visit
  • getAttributeNameSet
  • getAttributeNames
  • getDefaultGeometryUsed
    reads the read-only-property. See GEOS-469
  • getAttributes
    Returns PropertyNames rather than strings (includes namespace info)
  • clear
  • isUsingDynamincProperties
  • visitCqlExpression
    Handles the special CQL expressions embedded in the style markers since the time

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now