=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java' --- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2012-02-07 16:03:05 +0000 +++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2012-02-11 14:22:20 +0000 @@ -31,8 +31,6 @@ import java.awt.Graphics; import java.awt.image.BufferedImage; import java.util.Collection; -import java.util.LinkedList; -import java.util.List; import org.apache.commons.lang.StringUtils; import org.hisp.dhis.aggregation.AggregatedMapValue; @@ -189,7 +187,17 @@ mapLayer.setStrokeWidth( strokeWidth ); // Build and set the internal GeoTools map objects for the layer - buildGeoToolsMapObjectsForMapLayer( mapLayer, mapValues ); + + for ( AggregatedMapValue mapValue : mapValues ) + { + // Get the org unit for this map value + OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( mapValue.getOrganisationUnitId() ); + + if ( orgUnit != null && orgUnit.hasCoordinates() && orgUnit.hasFeatureType() ) + { + buildSingleGeoToolsMapObjectForMapLayer( mapLayer, mapValue, orgUnit ); + } + } // Create an interval set for this map layer that distributes its map // objects into their respective intervals @@ -206,27 +214,6 @@ return mapLayer; } - private List buildGeoToolsMapObjectsForMapLayer( InternalMapLayer mapLayer, - Collection mapValues ) - { - // Create a list of map objects - List mapObjects = new LinkedList(); - - // Build internal map objects for each map value - for ( AggregatedMapValue mapValue : mapValues ) - { - // Get the org unit for this map value - OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( mapValue.getOrganisationUnitId() ); - - if ( orgUnit != null && orgUnit.hasCoordinates() && orgUnit.hasFeatureType() ) - { - mapObjects.add( buildSingleGeoToolsMapObjectForMapLayer( mapLayer, mapValue, orgUnit ) ); - } - } - - return mapObjects; - } - private GeoToolsMapObject buildSingleGeoToolsMapObjectForMapLayer( InternalMapLayer mapLayer, AggregatedMapValue mapValue, OrganisationUnit orgUnit ) {