dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25226
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12452: Minor optimization
------------------------------------------------------------
revno: 12452
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 00:17:22 +0200
message:
Minor optimization
modified:
dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithCoordinatesFilter.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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 2013-10-06 22:11:27 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/GeoToolsMapGenerationService.java 2013-10-06 22:17:22 +0000
@@ -188,6 +188,8 @@
List<OrganisationUnit> organisationUnits = mapView.getAllOrganisationUnits();
+ FilterUtils.filter( organisationUnits, new OrganisationUnitWithCoordinatesFilter() );
+
java.util.Map<String, OrganisationUnit> uidOuMap = new HashMap<String, OrganisationUnit>();
for ( OrganisationUnit ou : organisationUnits )
@@ -237,11 +239,7 @@
if ( !mapView.isDataLayer() ) // Boundary (and facility) layer
{
- List<OrganisationUnit> units = mapView.getAllOrganisationUnits();
-
- FilterUtils.filter( units, new OrganisationUnitWithCoordinatesFilter() );
-
- for ( OrganisationUnit unit : units )
+ for ( OrganisationUnit unit : organisationUnits )
{
mapLayer.addBoundaryMapObject( unit );
}
@@ -262,7 +260,7 @@
// Get the org unit for this map value
OrganisationUnit orgUnit = uidOuMap.get( mapValue.getOu() );
- if ( orgUnit != null && orgUnit.hasCoordinates() && orgUnit.hasFeatureType() )
+ if ( orgUnit != null )
{
mapLayer.addDataMapObject( mapValue.getValue(), orgUnit );
}
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithCoordinatesFilter.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithCoordinatesFilter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithCoordinatesFilter.java 2013-10-06 22:17:22 +0000
@@ -40,6 +40,6 @@
@Override
public boolean retain( OrganisationUnit object )
{
- return object != null && object.getFeatureType() != null && object.hasCoordinates();
+ return object != null && object.hasFeatureType() && object.hasCoordinates();
}
}