use of org.activityinfo.geoadmin.model.NewLocation in project activityinfo by bedatadriven.
the class LocationImportWindow method doImport.
private void doImport() {
int nameIndex = importForm.getNameAttributeIndex();
List<NewLocation> newLocations = Lists.newArrayList();
for (LocationFeature location : locations) {
Point point = location.getPoint();
NewLocation newLocation = new NewLocation();
newLocation.setName(truncate(location.getFeature().getAttributeStringValue(nameIndex)));
newLocation.setLongitude(point.getX());
newLocation.setLatitude(point.getY());
for (AdminEntity entity : location.getEntities().values()) {
newLocation.getAdminEntityIds().add(entity.getId());
}
newLocations.add(newLocation);
}
client.postNewLocations(locationTypeId, newLocations);
setVisible(false);
}
Aggregations