Package com.esri.gpt.framework.geometry

Examples of com.esri.gpt.framework.geometry.Envelope


          String names = xpath.evaluate("consider/text()",ndProp);
          ((PropertyMeaning.AnyText)meaning).getNamesToConsider().addDelimited(names);
         
        } else if (meaning.getMeaningType().equals(PropertyMeaningType.GEOMETRY)) {
          meaning = new PropertyMeaning.Geometry();
          Envelope envelope = null;
          String tokens = xpath.evaluate("defaultEnvelope/text()",ndProp);
          String[] coords = Val.tokenize(tokens," ");
          if (coords.length == 4) {
            envelope = new Envelope();
            envelope.put(coords[0],coords[1],coords[2],coords[3]);
            if (envelope.isValid()) {
              ((PropertyMeaning.Geometry)meaning).setDefaultEnvelope(envelope);
            }
          }
         
        }
View Full Code Here


      if (upperCornerPts != null && upperCornerPts.length >= 2) {
        maxY = Utils.chkDbl(upperCornerPts[1], maxY);
        maxX = Utils.chkDbl(upperCornerPts[0], maxX);
      }
    }
    record.setEnvelope(new Envelope(minX, minY, maxX, maxY));
            
    // Attempting to see if this is a livedata record
    record.setLiveDataOrMap(false);
    Iterator<DcList.Value> iter = record.getTypes().iterator();
    while (iter.hasNext()) {
View Full Code Here

   * @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()) {
          envelope = envelopes.get(0);
         
          StringBuilder thumbnailURL = new StringBuilder();
          thumbnailURL.append(serviceInfo.getSoapUrl());
          thumbnailURL.append("?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/png&TRANSPARENT=TRUE&STYLES=&VERSION=1.3.0");
          thumbnailURL.append("&layers=");
         
          StringBuilder liSB = new StringBuilder();
          for (LayerInfo li : serviceInfo.getLayersInfo()) {
            if (liSB.length()>0) {
              liSB.append(",");
            }
            liSB.append(li.getName());
          }
            thumbnailURL.append(liSB);
         
          thumbnailURL.append("&WIDTH=200&HEIGHT=133&CRS=EPSG:4326");

          StringBuilder bboxSB = new StringBuilder();
          bboxSB.append(envelope.getMinY()).append(",").append(envelope.getMinX()).append(",").append(envelope.getMaxY()).append(",").append(envelope.getMaxX());
         
          thumbnailURL.append("&BBOX=").append(bboxSB);
         
          return thumbnailURL.toString();
        }
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.geometry.Envelope

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.