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");