Package de.lmu.ifi.dbs.elki.data.spatial

Examples of de.lmu.ifi.dbs.elki.data.spatial.PolygonsObject


        writeNewlineOnDebug(out);
      }
    }
    for(DBID id : outlierResult.getOrdering().iter(ids)) {
      Double score = scores.get(id);
      PolygonsObject poly = polys.get(id);
      String label = labels.get(id);
      if(score == null) {
        logger.warning("No score for object " + id);
      }
      if(poly == null) {
        logger.warning("No polygon for object " + id + " - skipping.");
        continue;
      }
      out.writeStartElement("Placemark");
      {
        out.writeStartElement("name");
        out.writeCharacters(score + " " + label);
        out.writeEndElement(); // name
        StringBuffer buf = makeDescription(otherrel, id);
        out.writeStartElement("description");
        out.writeCData("<div>" + buf.toString() + "</div>");
        out.writeEndElement(); // description
        out.writeStartElement("styleUrl");
        int style = (int) (scaling.getScaled(score) * NUMSTYLES);
        style = Math.max(0, Math.min(style, NUMSTYLES - 1));
        out.writeCharacters("#s" + style);
        out.writeEndElement(); // styleUrl
      }
      {
        out.writeStartElement("Polygon");
        writeNewlineOnDebug(out);
        if(compat) {
          out.writeStartElement("altitudeMode");
          out.writeCharacters("relativeToGround");
          out.writeEndElement(); // close altitude mode
          writeNewlineOnDebug(out);
        }
        // First polygon clockwise?
        boolean first = true;
        for(Polygon p : poly.getPolygons()) {
          if(first) {
            out.writeStartElement("outerBoundaryIs");
          }
          else {
            out.writeStartElement("innerBoundaryIs");
View Full Code Here


    svgp.updateStyleElement();

    // draw data
    for(DBID id : rep.iterDBIDs()) {
      try {
        PolygonsObject poly = rep.get(id);
        if(poly == null) {
          continue;
        }
        SVGPath path = new SVGPath();
        for(Polygon ppoly : poly.getPolygons()) {
          Vector first = ppoly.get(0);
          double[] f = proj.fastProjectDataToRenderSpace(first);
          path.moveTo(f[0], f[1]);
          for(Vector v : ppoly) {
            if(v == first) {
View Full Code Here

    svgp.updateStyleElement();

    // draw data
    for(DBID id : rep.iterDBIDs()) {
      try {
        PolygonsObject poly = rep.get(id);
        if(poly == null) {
          continue;
        }
        SVGPath path = new SVGPath();
        for(Polygon ppoly : poly.getPolygons()) {
          Vector first = ppoly.get(0);
          double[] f = proj.fastProjectDataToRenderSpace(first.getArrayRef());
          path.moveTo(f[0], f[1]);
          for(Vector v : ppoly) {
            if(v == first) {
View Full Code Here

        writeNewlineOnDebug(out);
      }
    }
    for(DBID id : outlierResult.getOrdering().iter(ids)) {
      Double score = scores.get(id);
      PolygonsObject poly = polys.get(id);
      String label = labels.get(id);
      if(score == null) {
        logger.warning("No score for object " + id);
      }
      if(poly == null) {
        logger.warning("No polygon for object " + id + " - skipping.");
        continue;
      }
      out.writeStartElement("Placemark");
      {
        out.writeStartElement("name");
        out.writeCharacters(score + " " + label);
        out.writeEndElement(); // name
        StringBuffer buf = makeDescription(otherrel, id);
        out.writeStartElement("description");
        out.writeCData("<div>" + buf.toString() + "</div>");
        out.writeEndElement(); // description
        out.writeStartElement("styleUrl");
        int style = (int) (scaling.getScaled(score) * NUMSTYLES);
        style = Math.max(0, Math.min(style, NUMSTYLES - 1));
        out.writeCharacters("#s" + style);
        out.writeEndElement(); // styleUrl
      }
      {
        out.writeStartElement("Polygon");
        writeNewlineOnDebug(out);
        if(compat) {
          out.writeStartElement("altitudeMode");
          out.writeCharacters("relativeToGround");
          out.writeEndElement(); // close altitude mode
          writeNewlineOnDebug(out);
        }
        // First polygon clockwise?
        boolean first = true;
        for(Polygon p : poly.getPolygons()) {
          if(first) {
            out.writeStartElement("outerBoundaryIs");
          }
          else {
            out.writeStartElement("innerBoundaryIs");
View Full Code Here

    if(coords.size() > 0) {
      polys.add(new Polygon(coords));
    }
    // Use first label as eternal ID
    ExternalID eid = labels.size() > 0 ? new ExternalID(labels.remove(0)) : null;
    return new Object[] { new PolygonsObject(polys), labels, eid };
  }
View Full Code Here

    }
    // Complete polygon
    if(coords.size() > 0) {
      polys.add(new Polygon(coords));
    }
    return new Object[] { new PolygonsObject(polys), labels, eid };
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.data.spatial.PolygonsObject

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.