← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5146: (GIS) Map rendering made more robust to avoid app crashes (and the annoying infinite 'loading geo...

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5146 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-11-12 13:11:44 +0000
message:
  (GIS) Map rendering made more robust to avoid app crashes (and the annoying infinite 'loading geojson' message). Improvements: 1) Points and polygons at the same level are handled and everything is now displayed together (and points are always rendered on top of the polygons in order to be visible). 2) Invalid point coordinates are handled. 3) Orgunits with no featureType are handled.
removed:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByLevelAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByParentAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPoint.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPolygon.vm
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonSymbol.vm
added:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojson.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java
  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/OrganisationUnitWithValidPointCoordinateFilter.java
  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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml


--
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-api/src/main/java/org/hisp/dhis/mapping/MappingService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2011-11-10 20:57:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MappingService.java	2011-11-12 12:54:31 +0000
@@ -32,7 +32,6 @@
 import java.util.Set;
 
 import org.hisp.dhis.aggregation.AggregatedMapValue;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
 
 /**
@@ -72,14 +71,6 @@
     final String MAP_LAYER_TYPE_OVERLAY = "overlay";
 
     // -------------------------------------------------------------------------
-    // Organisation units
-    // -------------------------------------------------------------------------    
-    
-    boolean isPointMinority( Collection<OrganisationUnit> organisationUnits );
-    
-    Collection<OrganisationUnit> removeMinorityFeatureType( Collection<OrganisationUnit> object );
-
-    // -------------------------------------------------------------------------
     // IndicatorMapValue
     // -------------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2011-11-10 20:57:29 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2011-11-12 12:54:31 +0000
@@ -32,7 +32,6 @@
 import static org.hisp.dhis.options.SystemSettingManager.DEFAULT_AGGREGATION_STRATEGY;
 import static org.hisp.dhis.options.SystemSettingManager.KEY_AGGREGATION_STRATEGY;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
@@ -188,52 +187,6 @@
         return organisationUnits;
     }
 
-    public boolean isPointMinority( Collection<OrganisationUnit> object )
-    {
-        int polygons = 0, points = 0;
-
-        for ( OrganisationUnit unit : object )
-        {
-            polygons = unit.isPolygon() ? polygons + 1 : polygons;
-
-            points = unit.isPoint() ? points + 1 : points;
-        }
-
-        return polygons > points ? true : false;
-    }
-
-    public Collection<OrganisationUnit> removeMinorityFeatureType( Collection<OrganisationUnit> object )
-    {
-        boolean isPointMinority = isPointMinority( object );
-
-        Collection<OrganisationUnit> majority = new ArrayList<OrganisationUnit>();
-
-        if ( isPointMinority )
-        {
-            for ( OrganisationUnit unit : object )
-            {
-                if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_MULTIPOLYGON )
-                    || unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POLYGON ) )
-                {
-                    majority.add( unit );
-                }
-            }
-        }
-
-        else
-        {
-            for ( OrganisationUnit unit : object )
-            {
-                if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
-                {
-                    majority.add( unit );
-                }
-            }
-        }
-
-        return majority;
-    }
-
     // -------------------------------------------------------------------------
     // IndicatorMapValues
     // -------------------------------------------------------------------------
@@ -259,10 +212,10 @@
     {
         String aggregationStrategy = (String) systemSettingManager.getSystemSetting( KEY_AGGREGATION_STRATEGY,
             DEFAULT_AGGREGATION_STRATEGY );
-
+        
         Assert.isTrue( !(period != null && (startDate != null || endDate != null)) );
         Assert.isTrue( !(aggregationStrategy.equals( AGGREGATION_STRATEGY_BATCH ) && period == null) );
-        Assert.isTrue( !(indicatorId == null || parentOrganisationUnitId == null || level == null) );
+        Assert.isTrue( indicatorId != null && parentOrganisationUnitId != null && level != null );
 
         Collection<AggregatedMapValue> values = new HashSet<AggregatedMapValue>();
 

=== 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	2010-08-28 10:27:45 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithCoordinatesFilter.java	2011-11-12 12:54:31 +0000
@@ -39,6 +39,6 @@
     @Override
     public boolean retain( OrganisationUnit object )
     {
-        return object != null && object.hasCoordinates();
+        return object != null && object.getFeatureType() != null && object.hasCoordinates();
     }    
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithValidPointCoordinateFilter.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithValidPointCoordinateFilter.java	2011-10-28 15:43:36 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/OrganisationUnitWithValidPointCoordinateFilter.java	2011-11-12 12:54:31 +0000
@@ -40,6 +40,12 @@
     @Override
     public boolean retain( OrganisationUnit object )
     {
-        return object != null && object.hasCoordinates() && ValidationUtils.coordinateIsValid( object.getCoordinates() );
+        if ( object != null && object.hasCoordinates() )
+        {
+            return object.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) ?
+                ValidationUtils.coordinateIsValid( object.getCoordinates() ) : true;
+        }
+        
+        return false;
     }
 }

=== 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-11-10 20:57:29 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonAction.java	2011-11-12 12:54:31 +0000
@@ -27,9 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
 import java.util.Collection;
 
-import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
@@ -65,13 +65,6 @@
     {
         this.organisationUnitGroupService = organisationUnitGroupService;
     }
-    
-    private MappingService mappingService;
-
-    public void setMappingService( MappingService mappingService )
-    {
-        this.mappingService = mappingService;
-    }
 
     // -------------------------------------------------------------------------
     // Input
@@ -113,31 +106,40 @@
 
         level = level == null ? organisationUnitService.getLevelOfOrganisationUnit( parent ) : level;
 
-        object = organisationUnitService.getOrganisationUnitsAtLevel( level, parent );
-
-        FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() );
-        
-        object = mappingService.removeMinorityFeatureType( object );        
-
-        String returnType = object.size() > 0 ? object.iterator().next().getFeatureType() : NONE;
-
-        if ( returnType.equals( OrganisationUnit.FEATURETYPE_POINT ) )
-        {
-            FilterUtils.filter( object, new OrganisationUnitWithValidPointCoordinateFilter() );
-
-            OrganisationUnitGroupSet typeGroupSet = organisationUnitGroupService
-                .getOrganisationUnitGroupSetByName( OrganisationUnitGroupSetPopulator.NAME_TYPE );
-
-            for ( OrganisationUnit organisationUnit : object )
-            {
-                if ( organisationUnit.getFeatureType() != null
-                    && organisationUnit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
-                {
-                    organisationUnit.setType( organisationUnit.getGroupNameInGroupSet( typeGroupSet ) );
-                }
-            }
-        }
-
-        return returnType;
+        Collection<OrganisationUnit> organisationUnits = organisationUnitService.getOrganisationUnitsAtLevel( level,
+            parent );
+        
+        FilterUtils.filter( organisationUnits, new OrganisationUnitWithCoordinatesFilter() );
+
+        FilterUtils.filter( organisationUnits, new OrganisationUnitWithValidPointCoordinateFilter() );
+
+        OrganisationUnitGroupSet typeGroupSet = organisationUnitGroupService
+            .getOrganisationUnitGroupSetByName( OrganisationUnitGroupSetPopulator.NAME_TYPE );
+        
+        object = new ArrayList<OrganisationUnit>();
+
+        for ( OrganisationUnit unit : organisationUnits )
+        {
+            if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
+            {
+                unit.setType( unit.getGroupNameInGroupSet( typeGroupSet ) );
+            }
+            
+            else
+            {
+                object.add( unit );
+            }
+
+        }
+        
+        for ( OrganisationUnit unit : organisationUnits )
+        {
+            if ( unit.getFeatureType().equals( OrganisationUnit.FEATURETYPE_POINT ) )
+            {
+                object.add( unit );
+            }            
+        }
+
+        return SUCCESS;
     }
 }

=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByLevelAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByLevelAction.java	2011-04-03 10:19:50 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByLevelAction.java	1970-01-01 00:00:00 +0000
@@ -1,97 +0,0 @@
-package org.hisp.dhis.mapping.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.system.filter.OrganisationUnitWithCoordinatesFilter;
-import org.hisp.dhis.system.util.FilterUtils;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Jan Henrik Overland
- * @version $Id$
- */
-public class GetGeoJsonByLevelAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnitService organisationUnitService;
-
-    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
-    {
-        this.organisationUnitService = organisationUnitService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input
-    // -------------------------------------------------------------------------
-
-    private Integer level;
-
-    public void setLevel( Integer level )
-    {
-        this.level = level;
-    }
-    
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private Collection<OrganisationUnit> object;
-
-    public Collection<OrganisationUnit> getObject()
-    {
-        return object;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        object = organisationUnitService.getOrganisationUnitsAtLevel( level );
-        
-        FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() );
-        
-        if ( object != null && object.size() > 0 )
-        {
-            return object.iterator().next().getFeatureType();
-        }
-        
-        return NONE;
-    }
-}

=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByParentAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByParentAction.java	2010-10-29 11:24:12 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/GetGeoJsonByParentAction.java	1970-01-01 00:00:00 +0000
@@ -1,95 +0,0 @@
-package org.hisp.dhis.mapping.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.system.filter.OrganisationUnitWithCoordinatesFilter;
-import org.hisp.dhis.system.util.FilterUtils;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Jan Henrik Overland
- * @version $Id$
- */
-public class GetGeoJsonByParentAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnitService organisationUnitService;
-
-    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
-    {
-        this.organisationUnitService = organisationUnitService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input
-    // -------------------------------------------------------------------------
-
-    private Integer parentId;
-
-    public void setParentId( Integer id )
-    {
-        this.parentId = id;
-    }
-    
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private Collection<OrganisationUnit> object;
-
-    public Collection<OrganisationUnit> getObject()
-    {
-        return object;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        OrganisationUnit parent = organisationUnitService.getOrganisationUnit( parentId );
-        
-        object = new HashSet<OrganisationUnit>( parent.getChildren() );
-        
-        FilterUtils.filter( object, new OrganisationUnitWithCoordinatesFilter() );
-        
-        return parent.getChildrenFeatureType();
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2011-11-10 20:57:29 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2011-11-12 12:54:31 +0000
@@ -304,22 +304,6 @@
             ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
         <property name="organisationUnitGroupService"
             ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
-        <property name="mappingService"
-            ref="org.hisp.dhis.mapping.MappingService" />
-    </bean>
-
-    <bean id="org.hisp.dhis.mapping.action.GetGeoJsonByParentAction"
-        class="org.hisp.dhis.mapping.action.GetGeoJsonByParentAction"
-        scope="prototype">
-        <property name="organisationUnitService"
-            ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-    </bean>
-
-    <bean id="org.hisp.dhis.mapping.action.GetGeoJsonByLevelAction"
-        class="org.hisp.dhis.mapping.action.GetGeoJsonByLevelAction"
-        scope="prototype">
-        <property name="organisationUnitService"
-            ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
     </bean>
 
 	<bean id="org.hisp.dhis.mapping.action.GetGeoJsonFromFileAction" class="org.hisp.dhis.mapping.action.GetGeoJsonFromFileAction"

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2011-06-23 16:19:53 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2011-11-12 12:54:31 +0000
@@ -328,26 +328,7 @@
 
         <action name="getGeoJson"
             class="org.hisp.dhis.mapping.action.GetGeoJsonAction">
-            <result name="Point" type="velocity-json">/dhis-web-mapping/geojsonPoint.vm</result>
-            <result name="Polygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-            <result name="MultiPolygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-            <result name="none" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-        </action>
-
-		<action name="getGeoJsonByParent"
-			class="org.hisp.dhis.mapping.action.GetGeoJsonByParentAction">
-			<result name="Point" type="velocity-json">/dhis-web-mapping/geojsonPoint.vm</result>
-			<result name="Polygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-			<result name="MultiPolygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-			<result name="none" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-		</action>
-
-        <action name="getGeoJsonByLevel"
-            class="org.hisp.dhis.mapping.action.GetGeoJsonByLevelAction">
-            <result name="Point" type="velocity-json">/dhis-web-mapping/geojsonPoint.vm</result>
-            <result name="Polygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-            <result name="MultiPolygon" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
-            <result name="none" type="velocity-json">/dhis-web-mapping/geojsonPolygon.vm</result>
+            <result name="success" type="velocity-json">/dhis-web-mapping/geojson.vm</result>
         </action>
 
 		<action name="getGeoJsonFromFile"

=== added file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojson.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojson.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojson.vm	2011-11-12 12:54:31 +0000
@@ -0,0 +1,1 @@
+#set($size=$object.size()){"type":"FeatureCollection","features":[#foreach($unit in $object){"geometry":{"type":#if($!{unit.featureType}=="Point")"Point"#else "MultiPolygon"#end,"coordinates":$!encoder.jsonEncode($!{unit.validCoordinates})},"properties":{"id":"$!{unit.id}","name":"$!encoder.jsonEncode(${unit.name})"#if($!{unit.featureType}!="Point"),"hasChildrenWithCoordinates":$!{unit.hasChildrenWithCoordinates()}#end#if($!{unit.featureType}=="Point"),"type":"$!encoder.jsonEncode(${unit.type})","code":"$!encoder.jsonEncode(${unit.code})","cp":"$!encoder.jsonEncode(${unit.contactPerson})","ad":"$!encoder.jsonEncode(${unit.address})","em":"$!encoder.jsonEncode(${unit.email})","pn":"$!encoder.jsonEncode(${unit.phoneNumber})"#end}}#if($velocityCount<$size),#end#end],"crs":{"type":"EPSG","properties":{"code":"4326"}}}
\ No newline at end of file

=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPoint.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPoint.vm	2011-06-19 08:33:00 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPoint.vm	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-#set( $size = $object.size() )
-{"type":"FeatureCollection","features":[#foreach($unit in $object){"geometry":{"type":"Point","coordinates":$!encoder.jsEncode( $!{unit.validCoordinates} )},"properties":{"id":"$!{unit.id}","name":"$!encoder.jsonEncode( ${unit.name} )","type":"$!encoder.jsonEncode( ${unit.type} )","code":"$!encoder.jsonEncode(${unit.code})","cp":"$!encoder.jsonEncode(${unit.contactPerson})","ad":"$!encoder.jsonEncode(${unit.address})","em":"$!encoder.jsonEncode(${unit.email})","pn":"$!encoder.jsonEncode(${unit.phoneNumber})"}}#if( $velocityCount < $size ),#end#end],"crs":{"type":"EPSG","properties":{"code":"4326"}}}
\ No newline at end of file

=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPolygon.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPolygon.vm	2011-02-02 13:36:42 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonPolygon.vm	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-#set( $size = $object.size() )
-{"type":"FeatureCollection","features":[#foreach($unit in $object){"geometry":{"type":"MultiPolygon","coordinates":$!encoder.jsonEncode( $!{unit.validCoordinates} )},"properties":{"id":"$!{unit.id}","name":"$!encoder.jsonEncode( ${unit.name} )","hasChildrenWithCoordinates":$!{unit.hasChildrenWithCoordinates()}}}#if( $velocityCount < $size ),#end #end],"crs":{"type":"EPSG","properties":{"code":"4326"}}}
\ No newline at end of file

=== removed file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonSymbol.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonSymbol.vm	2011-06-09 12:04:11 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/geojsonSymbol.vm	1970-01-01 00:00:00 +0000
@@ -1,2 +0,0 @@
-#set($size = $object.size())
-{"type": "FeatureCollection","features":[#foreach($unit in $object){"geometry":{"type":"Point","coordinates": $!encoder.jsEncode($!{unit.validCoordinates})},"properties":{"id":"$!{unit.id}","name":"$!encoder.jsonEncode(${unit.name})","type":"$!encoder.jsonEncode(${unit.type})","code":"$!encoder.jsonEncode(${unit.code})","cp":"$!encoder.jsonEncode(${unit.contactPerson})","ad":"$!encoder.jsonEncode(${unit.address})","em":"$!encoder.jsonEncode(${unit.email} )","pn":"$!encoder.jsonEncode(${unit.phoneNumber})"}}#if($velocityCount<$size),#end#end],"crs":{"type":"EPSG","properties":{"code":"4326"}}}
\ No newline at end of file