Package com.esri.arcgisws

Examples of com.esri.arcgisws.EnvelopeN


    sb.append("\n  creator=").append(this.getCreator());
    sb.append("\n  description=").append(this.getDescription());
    sb.append("\n  keywords=").append(this.getKeywords());
    if (this.getEnvelope() != null) {
      if (this.getEnvelope() instanceof EnvelopeN) {
        EnvelopeN envn = (EnvelopeN)this.getEnvelope();
        sb.append("\n  envelope=");
        sb.append(envn.getXMin()).append(", ").append(envn.getYMin()).append(", ");
        sb.append(envn.getXMax()).append(", ").append(envn.getYMax());
        if (envn.getSpatialReference() != null) {
          sb.append(" wkid=").append(envn.getSpatialReference().getWKID());
        }
      }
    }
    return sb.toString();
  }
View Full Code Here


    // initialize envelope properties
    if ((env == null) || !(env instanceof EnvelopeN)) {
      return null;
    }
    EnvelopeN envn = (EnvelopeN)env;
    SpatialReference spref = envn.getSpatialReference();
    if ((spref == null) || (spref.getWKID() == null)) {
      return null;
    }
    int wkid = spref.getWKID().intValue();
    double xmin = envn.getXMin();
    double ymin = envn.getYMin();
    double xmax = envn.getXMax();
    double ymax = envn.getYMax();

    // project if required
    if (wkid == 4326) {
      return new double[]{xmin,ymin,xmax,ymax};
    //} else if (spref instanceof GeographicCoordinateSystem) {
View Full Code Here

   * @param E envelope
   * @return string definition
   */
  private String envelopeToString(com.esri.arcgisws.Envelope E) {
    if (E instanceof EnvelopeN) {
      EnvelopeN e = (EnvelopeN) E;

      // project envelope
      Envelope gptEnvelope = new Envelope(e.getXMin(), e.getYMin(), e.getXMax(), e.getYMax());
      if (e.getSpatialReference()!=null && e.getSpatialReference().getWKID()!=null) {
        gptEnvelope.setWkid(e.getSpatialReference().getWKID().toString());
        List<Envelope> envelopes = Arrays.asList(new Envelope[]{gptEnvelope});
        try {
          List<Envelope> projectedEnvelopes = gs.project(envelopes, "4326");
          if (projectedEnvelopes!=null && !projectedEnvelopes.isEmpty()) {
            Envelope pe = projectedEnvelopes.get(0);
View Full Code Here

    ti.append("\"copyright\":\"").append(serviceInfo.getCopyright()).append("\",");
   
    ti.append("\"spatialReferences\":[");
    ti.append("4326");
    if (serviceInfo.getEnvelope() instanceof EnvelopeN) {
      EnvelopeN e = (EnvelopeN) serviceInfo.getEnvelope();
      if (e.getSpatialReference()!=null && e.getSpatialReference().getWKID()!=null && e.getSpatialReference().getWKID()!=4326) {
        ti.append(",").append(e.getSpatialReference().getWKID().toString());
      }
    }
    ti.append("],");
   
    ti.append("\"format\":").append("null");
View Full Code Here

   * @param serviceInfo service info
   * @return thumbnail URL
   */
  private String createThumbnailUrl(ServiceInfo serviceInfo) {
    if (serviceInfo.getEnvelope() instanceof EnvelopeN) {
      EnvelopeN e = (EnvelopeN) serviceInfo.getEnvelope();
      Envelope envelope = new Envelope(e.getXMin(), e.getYMin(), e.getXMax(), e.getYMax());
      envelope.setWkid(e.getSpatialReference()!=null && e.getSpatialReference().getWKID()!=null? e.getSpatialReference().getWKID().toString(): "4326");
     
      GeometryService gs = GeometryService.createDefaultInstance();
      try {
        List<Envelope> envelopes = gs.project(Arrays.asList(new Envelope[]{envelope}), "4326");
        if (!envelopes.isEmpty()) {
View Full Code Here

TOP

Related Classes of com.esri.arcgisws.EnvelopeN

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.