Listing Menu with Map

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Listing Menu with Map

Post by khurshid.arshad »

Dear CSPro Team;


How can I calculate distance between the current location and the GPS which we are getting through tap on the tab.

We want to be certain and assured that the enumerator conducts listing at the doorstep instead of being stationary at one place and listing. If the distance is more than 1.5 meter from the current location, it means enumerator is not at the doorstep.

Thanks.

a.
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Listing Menu with Map

Post by htuser »

Dear Arshad,
Have you try https://www.csprousers.org/help/CSPro/gps_function.html
Calculating Distances

I always used it to calculate distance in the same ideas as you.

However, kept in mind, that GNSS receivers on Tablets, smartphones are not accurate (their accuracy are typically 5-10m even more than 10m in urban area), except for theses having L1/L5 GNSS chips from Ublox or Broadcom. Theses chips can give decimeters accuracy on tablets or smartphones without any external corrections services.

Best Regards,
Last edited by htuser on March 5th, 2020, 3:13 pm, edited 1 time in total.
G.VOLNY, a CSProuser from Haiti, since 2004
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Listing Menu with Map

Post by khurshid.arshad »

Dear htuser
Thank you of your reply. Basically, I want to get GPS of my current location in CSPro 7.3 version. I also want to calculate distance between two coordinates. For instance, between these two coordinates, distance is 2.49 meters (Lat: 33.692361, Long 73.033732/ Lat 33.692341, long 73.033744). Based on this, we want to see if enumerator was at doorstep or not.
Please see example application “Listing Menu with Map” in CSPro 7.3.0

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

Re: Listing Menu with Map

Post by josh »

You can use the gps function with the distance option to compute distances in meters. For example:

Code: Select all

numeric distance_meters = gps(distance,38.846261,-76.929445,gps(latitude),gps(longitude))
As @htuser said, the GPS on most Android devices is not accurate enough to determine if the interviewer is with 1.5 meters of a point. There will be times even when it is not possible to get a reading at all.That does not mean you should not try to do this but you should not block the interviewer from entering data based on the GPS reading. The recommended approach is to record the GPS of where the interviewer is when conducting the interview and then as part of monitoring the survey check if on average the interviewer is close the expected interview location. This way you will catch the interviewers who are often doing interviews in the wrong place without slowing down those who are generally doing their job correctly.
khurshid.arshad
Posts: 572
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: Listing Menu with Map

Post by khurshid.arshad »

Thanks Josh.
Best.
a.
Pinalli
Posts: 13
Joined: December 30th, 2017, 6:17 pm

Re: Listing Menu with Map

Post by Pinalli »

Hi,
I just used similar coding but it keeps recording zero. I'm using Samsung S8. Is there something wrong with my phone
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Listing Menu with Map

Post by josh »

Try printing out the latitude and longitude values using errmsg() to see what is going on.

Make sure you open and read the GPS before doing the calculation as well. Details here: https://www.csprousers.org/help/CSPro/gps_function.html
Pinalli
Posts: 13
Joined: December 30th, 2017, 6:17 pm

Re: Listing Menu with Map

Post by Pinalli »

Thanks Josh. It works now
Post Reply