akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

Fix geocells computation #1295

Closed ichinaski closed 9 years ago

ichinaski commented 9 years ago

Overview

For newly created surveyed locales the corresponding geocells are not being computed. This is a regression introduced in 1.8.6

ichinaski commented 9 years ago

Since the latitude and longitude properties are already set in the SurveyedLocale, this conditional never holds true, therefore the if block is never entered https://github.com/akvo/akvo-flow/blob/release/1.8.7/GAE/src/com/gallatinsystems/surveyal/app/web/SurveyalRestServlet.java#L269-L270

The (quickest) solution is to check for geocells property status, rather than lat/lon comparisons, essentially computing the geocells for any locale that hasn't got any yet.

ichinaski commented 9 years ago

Test plan:

In all cases the resulting datapoints should contain the geocells property set (visible in the datastore viewer) and the points should be shown in the map.

rumca commented 9 years ago

The above test plan passes as described :+1:

@ichinaski is there a functional difference (in terms of the map) between questions with the datapoint location flag and those without? I hadn't previously been checking this.

ichinaski commented 9 years ago

@rumca the main difference is that such a flag explicitly sets the location of the datapoint, whereas the lack thereof computes a response lookup, trying to get the value of the geoquestion (if any). I just wanted to make sure both scenarios were covered.

rumca commented 9 years ago

:+1: