Package com.esri.gpt.framework.geometry

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


                   
          ESRI_ItemInformation itemInfo = new ESRI_ItemInformation();
                    itemInfo.setType("Map Service");
                    itemInfo.setTags(Arrays.asList(new String[]{"ArcGIS","Server map","service"}));
                   
          Envelope extent = new Envelope();
          for (Fieldable fld : flds) {
            String fieldName = fld.name();
            String[] vals = document.getValues(fieldName);
                        if (fieldName.contains("uuid")) {
                          itemInfo.setId(vals[0].replaceAll("^\\{|\\}$|\\-", ""));
                        } else if (fieldName.contains("title")) {
              itemInfo.setTitle(vals[0]);
              itemInfo.setName(vals[0]);
            } else if (fieldName.contains("resource.url")) {
              itemInfo.setUrl(vals[0]);
              String type = Val.chkStr(guessServiceTypeFromUrl(vals[0]));
              if (type.length() > 0) {
                itemInfo.setType(type);
              }
            } else if (fieldName.contains("contentType")) {
            } else if (fieldName.contains("keywords")) {
              itemInfo.setTypeKeywords(Arrays.asList(vals));
              itemInfo.setTags(Arrays.asList(vals));
            } else if (fieldName.contains("dataTheme")) {
              itemInfo.setTags(Arrays.asList(vals));
            } else if (fieldName.contains("abstract")) {
              itemInfo.setDescription(vals[0]);
//            } else if (fieldName.contains("xml")) {
//              itemInfo.setXml(vals[0]);
            } else if (fieldName.contains("minx")) {
              extent.setMinX(vals[0]);
            } else if (fieldName.contains("miny")) {
              extent.setMinY(vals[0]);
            } else if (fieldName.contains("maxx")) {
              extent.setMaxX(vals[0]);
            } else if (fieldName.contains("maxy")) {
              extent.setMaxY(vals[0]);
            } else if (fieldName.contains("thumbnail.url")) {
              itemInfo.setThumbnailUrl(vals[0]);
            }
          }
          itemInfo.setExtent(extent);
View Full Code Here


      }
      if (upperCorner!=null && upperCorner.length==2) {
        maxx = Val.chkDbl(upperCorner[0], maxx);
        maxy = Val.chkDbl(upperCorner[1], maxy);
      }
      itemInfo.setExtent(new Envelope(minx, miny, maxx, maxy));
    }
   
    String sModifiedDate = Val.chkStr(jsonObject.getString("modified"));
    itemInfo.setModifiedDate(formatDate(sModifiedDate));
   
View Full Code Here

      if (itemInfo.getThumbnailUrl().length() > 0) {
        content += "&thumbnailurl="
            + URLEncoder.encode(itemInfo.getThumbnailUrl(), "UTF-8");
      }

      Envelope extent = itemInfo.getExtent();
      if (extent != null && !extent.isEmpty()) {
        content += "&extent=" + extent.getMinX() + "," + extent.getMinY() + ","
            + extent.getMaxX() + "," + extent.getMaxY();
      }
      HttpClientRequest httpClient = new HttpClientRequest();
      httpClient.setContentProvider(new StringProvider(content,
          "application/x-www-form-urlencoded"));
      httpClient.setUrl(this.addItemUrl);
View Full Code Here

  /**
   * Sets extent.
   * @param extent extent
   */
  public void setExtent(Envelope extent) {
    this.extent = extent!=null? extent: new Envelope();
  }
View Full Code Here

    // handle geometries
    if ((meaning != null) && (meaning.getValueType() != null)) {
      if (meaning.getValueType().equals(PropertyValueType.GEOMETRY)) {
        if (hasChildren) {
          hasChildren = false;
          Envelope envelope = new Envelope();
          for (IndexableProperty child: this.getChildren()) {
            String mn = Val.chkStr(child.getMeaningName());
            String ev = Val.chkStr(child.getEvaluatedValue());
            if (ev.length() > 0) {
              if (mn.equalsIgnoreCase("envelope.west")) {
                envelope.setMinX(ev);
              } else if (mn.equalsIgnoreCase("envelope.south")) {
                envelope.setMinY(ev);
              } else if (mn.equalsIgnoreCase("envelope.east")) {
                envelope.setMaxX(ev);
              } else if (mn.equalsIgnoreCase("envelope.north")) {
                envelope.setMaxY(ev);
              } else if (mn.equalsIgnoreCase("envelope.lowerCorner")) {
                String[] pt = ev.split(" ");
                if (pt.length == 2) {
                  envelope.setMinX(pt[0]);
                  envelope.setMinY(pt[1]);
                }
              } else if (mn.equalsIgnoreCase("envelope.upperCorner")) {
                String[] pt = ev.split(" ");
                if (pt.length == 2) {
                  envelope.setMaxX(pt[0]);
                  envelope.setMaxY(pt[1]);
                }
              }
            }
          }
          if (!envelope.isEmpty()) {
            context.addStoreableValue(meaning,envelope);
          }
        }
        return;
      }
View Full Code Here

  /**
   * Creates extent definition.
   * @return extent definition
   */
  protected String createExtentDef() {
    Envelope e = getExtent();
    return e!=null? "new esri.geometry.Extent({" +
      "xmin:" +e.getMinX()+ "," +
      "ymin:" +e.getMinY()+ "," +
      "xmax:" +e.getMaxX()+ "," +
      "ymax:" +e.getMaxY()+ "," +
      "spatialReference:{wkid:" +e.getWkid()+ "}})": null;
  }
View Full Code Here

          try {
            XPathFactory xPathFactory = XPathFactory.newInstance();
            XPath xPath = xPathFactory.newXPath();

            if (xPath.evaluate("/ARCXML/RESPONSE/ERROR", docContent, XPathConstants.NODE) == null) {
              Envelope env = null;
              Node ndEnvelope = (Node) xPath.evaluate("/ARCXML/RESPONSE/SERVICEINFO/PROPERTIES/ENVELOPE", docContent, XPathConstants.NODE);
              if (ndEnvelope != null) {
                String minx = Val.chkStr((String) xPath.evaluate("@minx", ndEnvelope, XPathConstants.STRING));
                String maxx = Val.chkStr((String) xPath.evaluate("@maxx", ndEnvelope, XPathConstants.STRING));
                String miny = Val.chkStr((String) xPath.evaluate("@miny", ndEnvelope, XPathConstants.STRING));
                String maxy = Val.chkStr((String) xPath.evaluate("@maxy", ndEnvelope, XPathConstants.STRING));
                String wkid = Val.chkStr((String) xPath.evaluate("/ARCXML/RESPONSE/SERVICEINFO/PROPERTIES/FEATURECOORDSYS/@id", docContent, XPathConstants.STRING), "4326");
                env = makeExtent(minx, miny, maxx, maxy, wkid);
              }
              final Envelope envelope = env;

              final String servUrl = url;

              setter.set(new ArcIMSRenderer() {
View Full Code Here

    if (sMinX.length() > 0 && sMaxX.length() > 0 && sMinY.length() > 0 && sMaxY.length() > 0) {
      double minx = Val.chkDbl(sMinX, -180.0);
      double maxx = Val.chkDbl(sMaxX, 180.0);
      double miny = Val.chkDbl(sMinY, -90.0);
      double maxy = Val.chkDbl(sMaxY, 90.0);
      Envelope envelope = new Envelope(minx, miny, maxx, maxy);
      envelope.setWkid(wkid);
      return envelope;
    }
    return null;
  }
View Full Code Here

      getMeaning().setTitle("Untitled");
    }
    if (!getMeaning().getEnvelope().isValid()) {
      PropertyMeaning meaning = this.getPropertyMeanings().get("geometry");
      if ((meaning != null) && (meaning instanceof PropertyMeaning.Geometry)) {
        Envelope def = ((PropertyMeaning.Geometry)meaning).getDefaultEnvelope();
        if ((def != null) && def.isValid()) {
          getMeaning().getEnvelope().put(def.getMinX(),def.getMinY(),def.getMaxX(),def.getMaxY());
        }
      }
    }
    String contentType = Val.chkStr(getMeaning().getArcIMSContentType());
    if (contentType.length() == 0) {
View Full Code Here

* Gets the user selected envelope.
* @return the envelope (never null)
*/
public Envelope getSelectedEnvelope() {
  if(this._selectedEnvelope == null) {
    this.setSelectedEnvelope(new Envelope());
  }
  return _selectedEnvelope;
}
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.