Copy GPS coordinates from previous case?

Discussions about creating CAPI applications to run on Android devices
Forum rules
New release: CSPro 8.0
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Copy GPS coordinates from previous case?

Post by Anne »

Hi,
What is the best way to record gps coordinates in an urban area where there are buildings containing many appartments?

My first idea was to give the interviewer a choice between "record GPS" or "import GPS from previous questionnaire". The latter option to be used if you're in an appartment building..

But I'm worried the interviewers will import everytime, as that might be quicker than actually recording the gps..

Second idea was to always try to record GPS, and in the cases it fails, use a batch job later to assign approximate GPS. As this is the listing phase of the survey, it is highly likely that the coordinates recorded in previous or next questionnaire are good candidates. But there are two problems with this attempt: 1) What if there are many consecutive questionnaires with missing coordinates, and 2) Are these estimates going to be good enough to use to navigate back for the actual interview (of course in combination with name of HoH and description of area)?

Anybody else had the same challenges? what are "best practices"?

Anne
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Copy GPS coordinates from previous case?

Post by josh »

We recently did a listing application like that although we had a question asking if the current housing unit is in the same building as the previous housing unit and only copy the GPS coordinates if it is the same building. This program hasn't gone into the field yet so not sure how well it works.
Pinalli
Posts: 13
Joined: December 30th, 2017, 6:17 pm

Re: Copy GPS coordinates from previous case?

Post by Pinalli »

Hi Josh,
Could please share with how the coding was done. It sounds good to me. I intend to implement a similar thing in my next survey.
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Copy GPS coordinates from previous case?

Post by josh »

The application I mentioned is not mine to share but I can describe roughly how it was implemented. All the households in an enumeration area were saved in the same case where each line in a big roster represents a household. For GPS there were three variables: TAKE_GPS, LATITUDE, LONGITUDE. LATITUDE and LONGITUDE are numeric variables that store the coordinates. TAKE_GPS is a variable with 3 possible responses:
1) Keep existing coordinates (only displayed if coming back to a household after already taking the coordinates)
2) Copy the coordinates from previous household (only displayed if not on first line of roster)
3) Take GPS reading

In the onfocus of TAKE_GPS update the value set based on whether or not the coordinates from the household have been taken or not.

In the postproc of TAKE_GPS if they choose 1 then do nothing if they choose 2 then copy LATITUDE and LONGITUDE from previous row of roster (LATITUDE = LATITUDE(currocc() - 1); LONGITUDE = LONGITUDE(currocc() - 1);). If they choose 3 then read the GPS and put the results in LATITUDE and LONGITUDE.

If I were to implement this again I probably would not put all the households into the same roster. With a lot of households it was pretty slow to open the roster and moving back to previous households to make modifications or delete households was tricky. I would use a separate case for each household. However this would make it a bit trickier to copy the coordinates from the previous household since you would not have access to the data for the previous household. Instead I would save the household number, LATITUDE and LONGITUDE of the last household using savesettings or in an external data file to be able to copy it in the current household.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Copy GPS coordinates from previous case?

Post by htuser »

Hi Josh,
I faced this problem of slow roster all the times. I asked myself if changing actual form technology (designed long ago) to HTML5/CSS can solve this problem?

Also, when CSdb/CSdbe data are parsed in a relational schema, does it will be impossible to access to data from previous case?
I imagine that sqlquery would be able to extract data from whatever case... Please let us know.

Thanks in advance,
G.VOLNY, a CSProuser from Haiti, since 2004
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Copy GPS coordinates from previous case?

Post by josh »

We are working on some performance improvements for existing rosters. Not working on HTML/CSS forms.

Yes, relational data files will allow you to use sqlquery to get data from previous cases.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Copy GPS coordinates from previous case?

Post by htuser »

Thanks Josh. Very Good news about form and acceding data from (previous) case without menu.
Best,
G.VOLNY, a CSProuser from Haiti, since 2004
Pinalli
Posts: 13
Joined: December 30th, 2017, 6:17 pm

Re: Copy GPS coordinates from previous case?

Post by Pinalli »

Hi Josh,
Thanks for the reply. Really appreciate it.
bishnuyar
Posts: 2
Joined: September 3rd, 2018, 1:32 pm

Re: Copy GPS coordinates from previous case?

Post by bishnuyar »

Hi Anne

I faced the same problem previously. But, I used savesetting() and loadsetting() functions to solve the problem. I locally save the LATITUDE and the LONGITUDE using savesetting() function for every case using PreviousLatitude and PreviousLongitude attribute. If I need to use the same GPS for next case, I call the loadsetting() function using the same attribute. In this way, solve the problems.

I hope, this will give an idea to solve that.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Copy GPS coordinates from previous case?

Post by htuser »

Hi Bishnuyar,
It's more easy in versions previous to 7.4, to insert theses coordinates in settings db (the same where savettings are stored) using slquery : insert into ... and extract them with a select*from. But, right now, in 7.4 version you can use sqlquery on cases data so you can select item, records data directly and use theses data across your application.

Best,
G.VOLNY, a CSProuser from Haiti, since 2004
Post Reply