Search in sources :

Example 1 with SitePointDTO

use of org.activityinfo.shared.dto.SitePointDTO in project activityinfo by bedatadriven.

the class GetSitePointsHandler method toPointList.

protected SitePointList toPointList(List<SiteDTO> sites) {
    Extents bounds = Extents.empty();
    List<SitePointDTO> points = new ArrayList<SitePointDTO>(sites.size());
    for (SiteDTO site : sites) {
        if (site.hasLatLong()) {
            points.add(new SitePointDTO(site.getId(), site.getLongitude(), site.getLatitude()));
            bounds.grow(site.getLatitude(), site.getLongitude());
        }
    }
    return new SitePointList(bounds, points);
}
Also used : SitePointList(org.activityinfo.shared.command.result.SitePointList) ArrayList(java.util.ArrayList) SitePointDTO(org.activityinfo.shared.dto.SitePointDTO) SiteDTO(org.activityinfo.shared.dto.SiteDTO) Extents(org.activityinfo.shared.util.mapping.Extents)

Aggregations

ArrayList (java.util.ArrayList)1 SitePointList (org.activityinfo.shared.command.result.SitePointList)1 SiteDTO (org.activityinfo.shared.dto.SiteDTO)1 SitePointDTO (org.activityinfo.shared.dto.SitePointDTO)1 Extents (org.activityinfo.shared.util.mapping.Extents)1