use of io.jawg.osmcontributor.rest.dtos.osm.OsmDto in project osm-contributor by jawg.
the class PoiLoader method loadAndSavePoisFromBackend.
private void loadAndSavePoisFromBackend(MapArea toLoadArea, boolean clean) {
loadingStatus = LOADING_FROM_SERVER;
publishProgress();
loadedElements = 0L;
nodeDtos.clear();
osmDtos = backend.getPoisDtosInBox(toLoadArea.getBox());
for (OsmDto osmDto : osmDtos) {
killIfNeeded();
if (osmDto != null) {
List<NodeDto> nodeDtoList = osmDto.getNodeDtoList();
if (nodeDtoList != null) {
nodeDtos.addAll(nodeDtoList);
}
List<WayDto> wayDtoList = osmDto.getWayDtoList();
if (wayDtoList != null) {
nodeDtos.addAll(wayDtoList);
}
}
}
osmDtos.clear();
loadingStatus = MAPPING_POIS;
totalsElements = nodeDtos.size();
if (clean) {
cleanArea(toLoadArea);
}
savePoisInDB();
}
Aggregations