Examples of GetSceneRequest


Examples of org.geoserver.w3ds.types.GetSceneRequest

  }

  public boolean canHandle(Operation operation) {
    Object o = operation.getParameters()[0];
    if (o instanceof GetSceneRequest) {
      GetSceneRequest gs = (GetSceneRequest) operation.getParameters()[0];
      return "GetScene".equalsIgnoreCase(operation.getId())
          && operation.getService().getId().equals("w3ds")
          && gs.getFormat()
              .getMimeType()
              .equalsIgnoreCase(
                  org.geoserver.w3ds.utilities.Format.KML
                      .getMimeType());
    }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

  }

  public void write(Object o, OutputStream output, Operation operation)
      throws IOException {
    Object request = operation.getParameters()[0];
    GetSceneRequest gs = (GetSceneRequest) request;
    writeGetScene((Scene) o, output, gs);
  }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

    // Check if request format is supported by this implementation
    if (requestObject instanceof GetTileRequest) {
        return false;
    } else if (requestObject instanceof GetSceneRequest) {
        GetSceneRequest getSceneRequest = (GetSceneRequest) requestObject;
        if (getSceneRequest.getFormat() == Format.XML3D) {
            return true;
        } else if (getSceneRequest.getFormat() == Format.OCTET_STREAM) {
            return true;
        } else {
            return false;
        }
    }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

@Override
public String getAttachmentFileName(Object value, Operation operation) {
    StringBuilder fileName = new StringBuilder();
    Object requestObject = operation.getParameters()[0];
    if (requestObject instanceof GetSceneRequest) {
        GetSceneRequest getSceneRequest = (GetSceneRequest) requestObject;
        for (W3DSLayerInfo w3dsLayerInfo : getSceneRequest.getLayers()) {
            fileName.append(w3dsLayerInfo.getLayerInfo().getName());
        }
    }
    // if (requestObject instanceof GetTileRequest) {
    // GetTileRequest getTileRequest = (GetTileRequest) requestObject;
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

public void write(Object content, OutputStream outputStream, Operation operation)
        throws IOException {
    Object requestObject = operation.getParameters()[0];

    if (requestObject instanceof GetSceneRequest) {
        GetSceneRequest getSceneRequest = (GetSceneRequest) requestObject;
        writeGetScene((Scene) content, outputStream, getSceneRequest);
    } else {
        throw new ServiceException("The request is not recognised!");
    }
}
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

            .equalsIgnoreCase(
                org.geoserver.w3ds.utilities.Format.HTML
                    .getMimeType());
      }
      if(o instanceof GetSceneRequest) {
      GetSceneRequest gs = (GetSceneRequest) operation.getParameters()[0];
        return "GetScene".equalsIgnoreCase(operation.getId()) &&
                operation.getService().getId().equals("w3ds") &&
                gs.getFormat()
        .getMimeType()
        .equalsIgnoreCase(
            org.geoserver.w3ds.utilities.Format.HTML
                .getMimeType());
      }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

    Object request = operation.getParameters()[0];
    if (request instanceof GetTileRequest) {
      GetTileRequest gt = (GetTileRequest) request;
      writeGetTile((Scene) o, output, gt);
    } else if (request instanceof GetSceneRequest) {
      GetSceneRequest gs = (GetSceneRequest) request;
      writeGetScene((Scene) o, output, gs);
    } else {
      throw new ServiceException("Don't reconize the request");
    }
  }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

    this.catalog = catalog;
    this.geoServer = geoServer;
  }

  public GetSceneRequest read(Object request, Map kvp, Map rawKvp) throws Exception {
    GetSceneRequest gsr = (GetSceneRequest) super.read(request, kvp, rawKvp);
    String aux = (String) rawKvp.get("SERVICE");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter SERVICE is missing: "
              + rawKvp.toString());
     
    }
    // TODO: Test service validity.
    String service = "W3DS";
    aux = (String) rawKvp.get("VERSION");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter VERSION is missing: "
              + rawKvp.toString());
    }
    // TODO: Test version validity.
    String version = "0.4.0";
    aux = (String) rawKvp.get("REQUEST");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter REQUEST is missing: "
              + rawKvp.toString());
    }
    // TODO: Test request validity.
    Operation requestStr = Operation.GETSCENE;
    aux = (String) rawKvp.get("FORMAT");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter FORMAT is missing: "
              + rawKvp.toString());
    }
    Format format = KVPUtils.parseFormat(aux, gsr);
    aux = (String) rawKvp.get("CRS");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter CRS is missing: " + rawKvp.toString());
    }
    CoordinateReferenceSystem crs = KVPUtils.parseCRS(aux);
    aux = (String) rawKvp.get("BOUNDINGBOX");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter BOUNDINGBOX is missing: "
              + rawKvp.toString());
    }
    Envelope bbox = KVPUtils.parseBbox(aux, crs, LOGGER);
    aux = (String) rawKvp.get("LAYERS");
    if (aux == null) {
      throw new IllegalArgumentException(
          "Mandatory parameter LAYERS is missing: "
              + rawKvp.toString());
    }
    List<W3DSLayerInfo> layers = KVPUtils.parseLayers(aux, catalog, LOGGER);
    aux = (String) rawKvp.get("STYLES");
    if (aux != null) {
      KVPUtils.parseStyles(layers, aux, catalog);
    }
    else {
      KVPUtils.setDefaultStyles(layers, catalog);
    }
    // TODO: Handle the baseURL parameter.
    String baseUrl = "geoserver/w3ds?";
    aux = (String) rawKvp.get("OFFSET");
    Coordinate offset = KVPUtils.parseOffset(aux, bbox);
    gsr.setMandatoryParameters(service, requestStr, version, baseUrl, rawKvp, crs, bbox, format, layers);
    gsr.setOffset(offset);
    // Hacking to use WMS to generate KML(provisory)
    gsr.setGeoServer(geoServer);
    return gsr;
  }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

              .equalsIgnoreCase(
                  org.geoserver.w3ds.utilities.Format.X3D
                      .getMimeType());
    }
    if (o instanceof GetSceneRequest) {
      GetSceneRequest gs = (GetSceneRequest) operation.getParameters()[0];
      return "GetScene".equalsIgnoreCase(operation.getId())
          && operation.getService().getId().equals("w3ds")
          && gs.getFormat()
              .getMimeType()
              .equalsIgnoreCase(
                  org.geoserver.w3ds.utilities.Format.X3D
                      .getMimeType());
    }
View Full Code Here

Examples of org.geoserver.w3ds.types.GetSceneRequest

    Object request = operation.getParameters()[0];
    if (request instanceof GetTileRequest) {
      GetTileRequest gt = (GetTileRequest) request;
      writeGetTile((Scene) o, output, gt);
    } else if (request instanceof GetSceneRequest) {
      GetSceneRequest gs = (GetSceneRequest) request;
      writeGetScene((Scene) o, output, gs);
    } else {
      throw new ServiceException("Don't reconize the request");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.