Merge authors: Jan Henrik Ă˜verland (janhenrik-overland) ------------------------------------------------------------ revno: 2803 [merge] committer: Jan Henrik Overland <janhenrik.overl...@gmail.com> branch nick: dhis2 timestamp: Wed 2011-02-02 17:48:34 +0100 message: Improved code. modified: dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.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-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java' --- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java 2011-02-02 13:36:42 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java 2011-02-02 16:45:37 +0000 @@ -105,20 +105,18 @@ object = organisationUnitService.getOrganisationUnitsAtLevel( level, parent ); + FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() ); + for ( OrganisationUnit organisationUnit : object ) { - if ( organisationUnit.getFeatureType() != null ) + if ( organisationUnit.getFeatureType() != null + && organisationUnit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) ) { - if ( organisationUnit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) ) - { - organisationUnit.setType( organisationUnit.getGroupNameInGroupSet( organisationUnitGroupService - .getOrganisationUnitGroupSetByName( OrganisationUnitGroupSetPopulator.NAME_TYPE ) ) ); - } + organisationUnit.setType( organisationUnit.getGroupNameInGroupSet( organisationUnitGroupService + .getOrganisationUnitGroupSetByName( OrganisationUnitGroupSetPopulator.NAME_TYPE ) ) ); } } - FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() ); - return object.size() > 0 ? object.iterator().next().getFeatureType() : NONE; } }
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp