Package org.geoserver.w3ds.utilities

Examples of org.geoserver.w3ds.utilities.X3DInfoExtract


      throw new IllegalArgumentException(
          "Error parsing the parameter LAYERS (no layers given): "
              + layersstr);
    }
    Iterator it = unparsed.iterator();
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract(catalog, false);
    while (it.hasNext()) {
      // The method getLayerByName handle this patter "prefix:resource".
      String n = (String) it.next();
      LayerInfo li = catalog.getLayerByName(n);
      if (li == null) {
        // If the layer cannot be found we just put a warning, is this
        // the right thing to do ?
        LOGGER.warning("The layer [" + n + "] cannot be found");
      } else {
        x3dInfoExtract.setLayerInfo(li);
        if (x3dInfoExtract.isAX3DLayer()) {
          if (x3dInfoExtract.isQueryable()) {
            if (!x3dInfoExtract.isTiled()) {
              layers.add(new W3DSLayerInfo(li, n));
            } else {
              LOGGER.warning("The layer [" + n + "] is tiled.");
            }
          } else {
View Full Code Here


      // If the layer cannot be found we just put a warning, is this
      // the right thing to do ?
      LOGGER.warning("The layer [" + layerstr + "] cannot be found");
    }
    // Test if the layer is tiled or not
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract(catalog, false);
    x3dInfoExtract.setLayerInfo(li);
    if (!x3dInfoExtract.isTiled()) {
      throw new IllegalArgumentException("The layer '" + layerstr
          + "' is not tiled, so the GetTile operation is unvailable");
    }
    return new W3DSLayerInfo(li, layerstr);
  }
View Full Code Here

  }

  public static void parseStyles(List<W3DSLayerInfo> layers,
      String stylesstr, Catalog catalog) throws IOException,
      ParserConfigurationException, SAXException {
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract(catalog, false);
    String[] stylesNames = W3DSUtils.parseStrArray(stylesstr, "\\s*,\\s*");
    if (stylesNames.length != layers.size()) {
      throw new IllegalArgumentException(
          "Styles list length don't correspond to layers list lenght.");
    }
    int i = 0;
    for (W3DSLayerInfo wl : layers) {
      x3dInfoExtract.setLayerInfo(wl.getLayerInfo());
      String styleName = stylesNames[i];
      if (!styleName.isEmpty()) {
        if (x3dInfoExtract.containsStyle(styleName)) {
          StyleInfo styleInfo = catalog.getStyleByName(styleName);
          if (styleInfo != null) {
            wl.setRequestStyle(styleInfo);
            i++;
            continue;
          }
        }
      }
      StyleInfo styleInfo = x3dInfoExtract.getDefaultStyle();
      if (styleInfo != null) {
        wl.setRequestStyle(styleInfo);
      }
      i++;
    }
View Full Code Here

  }

  public static void parseStyle(W3DSLayerInfo layer, String styleName,
      Catalog catalog) throws IOException, ParserConfigurationException,
      SAXException {
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract(catalog, false);
    x3dInfoExtract.setLayerInfo(layer.getLayerInfo());
    if (!styleName.isEmpty()) {
      if (x3dInfoExtract.containsStyle(styleName)) {
        StyleInfo styleInfo = catalog.getStyleByName(styleName);
        if (styleInfo != null) {
          layer.setRequestStyle(styleInfo);
          return;
        }
      }
    }
    StyleInfo styleInfo = x3dInfoExtract.getDefaultStyle();
    if (styleInfo != null) {
      layer.setRequestStyle(styleInfo);
    }
  }
View Full Code Here

    }
  }

  public static void setDefaultStyle(W3DSLayerInfo layer, Catalog catalog)
      throws IOException, ParserConfigurationException, SAXException {
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract(catalog, false);
    x3dInfoExtract.setLayerInfo(layer.getLayerInfo());
    StyleInfo styleInfo = x3dInfoExtract.getDefaultStyle();
    if (styleInfo != null) {
      layer.setRequestStyle(styleInfo);
    }
  }
View Full Code Here

  public W3DSLayer(W3DSLayerInfo layerInfo,
      FeatureCollection<? extends FeatureType, ? extends Feature> features, Catalog catalog) throws IOException {
    this.layerInfo = layerInfo;
    this.features = features;
    X3DInfoExtract x3dInfoExtract = new X3DInfoExtract();
    x3dInfoExtract.setLayerInfo(layerInfo.getLayerInfo());
   
    this.haveLODs = x3dInfoExtract.haveLODS();
   
    if(x3dInfoExtract.haveObjectID()) {
      this.hasObjectID = true;
      this.objectID = x3dInfoExtract.getObjectID();
    }
    else {
      this.hasObjectID = false;
      this.objectID = "";
    }
    if(x3dInfoExtract.haveObjectClass()) {
      this.hasObjectClass = true;
      this.objectClass = x3dInfoExtract.getObjectClass();
    }
    else {
      this.hasObjectClass = false;
      this.objectClass = new ArrayList<String>();
    }
View Full Code Here

TOP

Related Classes of org.geoserver.w3ds.utilities.X3DInfoExtract

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.