doc.appendChild(root);
for (QuadTreeData geo : filterList) {
Element item = doc.createElement("item");
Element id = doc.createElement("id");
Text idText = doc.createTextNode(geo.getFileName());
id.appendChild(idText);
item.appendChild(id);
Element lat = doc.createElement("lat");
Text latText = doc.createTextNode(Double.toString(geo.getLatLon()
.getLat()));
lat.appendChild(latText);
item.appendChild(lat);
Element lon = doc.createElement("lon");
Text lonText = doc.createTextNode(Double.toString(geo.getLatLon()
.getLon()));
lon.appendChild(lonText);
item.appendChild(lon);
root.appendChild(item);
}
Element timeElem = doc.createElement("time");
Text timeText = doc.createTextNode(Long.toString(time));
timeElem.appendChild(timeText);
root.appendChild(timeElem);
if (timeToLoad != null) {
Element indexLoadTimeElem = doc.createElement("indexLoadTime");
Text indexLoadTimeText = doc.createTextNode(timeToLoad);
indexLoadTimeElem.appendChild(indexLoadTimeText);
root.appendChild(indexLoadTimeElem);
timeToLoad = null; // Only need to send this over to the client
// on initial load
}
Element query = doc.createElement("query");
root.appendChild(query);
for (String rStr : regions) {
Element region = doc.createElement("region");
Text regionText = doc.createTextNode(rStr);
region.appendChild(regionText);
query.appendChild(region);
}
try {
TransformerFactory transfac = TransformerFactory.newInstance();