use of org.wikivoyage.listings.utils.XMLSimpleNodeException in project wikivoyage-listings by baturin.
the class NavigationXMLOutputFormat method write.
@Override
public void write(Iterable<Listing> pois, String outputFilename, String dumpDate) throws WriteOutputException {
try {
LinkedList<Listing> filteredPois = new LinkedList<>();
for (Listing poi : pois) {
if (!poi.isPositionalDataEmpty()) {
// POIs with no positional data are useless for navigation - do not add them
// to reduce size of output file
filteredPois.add(poi);
}
}
Listing[] filteredPoisArr = filteredPois.toArray(new Listing[filteredPois.size()]);
XMLSimpleNode rootNode = createXml(filteredPoisArr, dumpDate);
rootNode.writeToFile(outputFilename);
} catch (XMLSimpleNodeException e) {
throw new WriteOutputException();
}
}
Aggregations