Survey123 with a single attribute for repeating generic questions (instead of multiple attributes); and an auto-incremented list!

Example Requirement:

RiskAssessmentExcel

You are being tasked with creating a Disaster Risk Assessment form (as above) which requires the field worker to capture the risk factor associated with 14 Hazard Items:

  1. Avalanche
  2. Animal disease outbreak
  3. Drought
  4. Earthquake
  5. Epidemic
  6. Flood
  7. Hurricane
  8. Landslide
  9. Pandemic
  10. Tornado
  11. Tsunami
  12. Volcanic eruption
  13. Wildfire
  14. Winter storm

Each of these Hazard Items require the field worker to assess the risk factors of the hazard as follows:

  1. Affected Area (Very small=1, Small=2, Medium=3, Large=4, Very large=5)
  2. Probability (0% chance=1, 30% chance=2, 60% chance=3, 80% chance=4, 100% chance=5)
  3. Frequency (> 20 years = 1, 1 to 20 years = 2, Annually = 3, Monthly = 4, Weekly = 5)
  4. Predictability (100% Predictable = 1, Fairly Accurate to Predict = 2, 50/50 predictable = 3, Slightly Predictable = 4, Cannot Predict = 5)
  5. Magnitude (Low = 1, Low to Medium = 2, Medium = 3, Medium  to High = 4, High = 5)

A hazard score is calculated with the above risk factors as follow:

Score = Affected Area*0.5 + Probability + Predictability + Magnitude*1.5 + Frequency


Survey / Feature Class Design:

Having worked with Survey123 before we might be tempted to jump into it and simply create 14 questions, one for each Hazard Item listed in the requirement. The number of attributes quickly escalates however, since we also need to capture the associated Risk Factor for each Hazard Item – which results in a LOT of attributes! That doesn’t sound like a good design anymore, does it?

If we first designed this Feature Class in ArcGIS Pro we would probably design it simpler and lighter; perhaps a design like the one below, where each hazard item is not a separate attribute but a generic field which stores the Hazard Item descriptions:

FCRisk.JPG

That looks better, but how do we marry these two designs and also keep in mind the “limitations” of Survey123, seeing that Survey123 only allows one answer per “question”? An alternative would be to use a repeat section in the survey. A repeat section would give us the ability to add each Hazard Item as a (related) record whilst saving the Risk Factors in attributes.

Good, a Repeat Section it is… but how do we make it easy for the hapless field worker to capture 14 attributes and then still expect him/her to remember which hazards have been captured and which ones haven’t? It would be downright cruel to have the user choose the hazard item from a drop-down, like this (mistakes will happen!):

ice_video_20171213-115850(1)

Let us improve on this design.

It would be great if the field worker didn’t have to remember which hazard is next in the sequence, so if we can add an auto-incremented hazard list to the design it would be great! It would also be nice if the field worker could see some kind of progress as the survey is completed – for instance Hazard 5 of 14 captured.

Luckily Survey123 allows us to do all of these things. Look at the final design in action:

ice_video_20171213-160453

This solution comprises:

  • An auto-incremented Hazard Item (leaving no room for mistakes!)
  • An incremented counter showing the capturing progress (for example 1 of 14)
  • A clean database design that looks like this:SchemaS123
  • A happy field worker!

So how did we achieve this design?

In the repeat section of the survey, add a counter variable (count1) that we use for the increment:

calculate count1 count1 1
calculate counter Counter once(count(${count1}))

The count() function does a count of the number of repeats by simply counting all the count1 values. The once() function ensures that the count calculation only happens once, otherwise we will have an issue when the user traverses backwards through the list and the count() is recalculated.

Now, for the magic bit…

Create a CSV file with all the Hazard Items and their indexes in it. The file will look like this:

CSVFile

Now all we need is to hook up our incremental index (the ${Counter}) with the Hazard Item. This is done with the pulldata() function as follow, where HazardEntryLookup is our CSV file:

pulldata('HazardEntryLookup', 'hazard', 'hazardindex', string(${counter}))

Now, all that is left is to enable the 1 of 14, 2 of 14, etc functionality. This is done by specifying that the Repeat count should not exceed 14 (our number of hazard items). So setting the repeat_count option for the Repeat sorts that out nicely!

As always, here is the complete set of files used for this demonstration, feel free to use an adapt as necessary:

Source files

For my upcoming Blog I am going to show how to make an interactive progress / risk visualization bar in Survey123! Here is a sneak peek of the end result:

ice_video_20171214-172437

Calculating distances between locations (geopoints) in Survey123 with the Haversine Formula

Consider the scenario where a person is applying for a liquor licence and the law stipulates: New liquor premises must be located at least five hundred meters (500m) away from schools, places of worship; recreation facilities, rehabilitation or retreat centers, residential areas and public institutions.

For this requirement Survey123 can be a valuable tool and in this blog post I will show you how you can enable this functionality in a Survey123 form:

Step 1: Create a new survey with Survey123 Connect

Step 2: Create a geopoint field in the main survey which will be used to capture the location of the new licence premises

Step 3: Create a repeated section to capture the occurrences of nearby schools, places of worship etc. Each with a premise type and a geopoint

Your survey design should look similar to this:

type name label
geopoint new_licence_location New Licence Location
begin repeat nearby_places Nearby Permises
select_one category place_type Type of Premises
geopoint nearby_location Nearby Location
end repeat

Step 4: Now, split both the coordinates sets into their x,y pairs and convert them to radians:

calculate gps_lat gps lat pulldata(‘@geopoint’, ${new_licence_location}, ‘y’) * pi() div 180
calculate gps_long gps long pulldata(“@geopoint”, ${new_licence_location}, “x”) * pi() div 180

Do the same for the nearby_location geopoint field.
Step 5: Use the X, Y pairs to perform the distance calculation (in meters) with the Haversine formula:

acos(sin(${gps_lat_end})*sin(${gps_lat}) + cos(${gps_lat_end})*cos(${gps_lat})*cos(${gps_long}-${gps_long_end}) ) * 6371000

After having made some cosmetic enhancements and adding the 500m stipulation your survey should look like this:

DistanceCalcScreen

Feel free to use and adapt as you require. Here is a link to the Survey123 Excel design file: Licence Application

SCHOOL EARLY WARNING SYSTEM

The North-West Department of Education and Sport Development is one of the largest departments having staff complement of 30000 and serving 800000 learners annually.

The department have a need to respond to the needs of schools on the ground. This has resulted in a need for a department to require a solution that will follow a systematic approach of reporting and recording incidence and emergencies occurring at schools. The solution should enable real time incident recording and must have the ability to send alerts to the department’s officials, thus enabling the department to promptly respond to the needs of schools. This has triggered a need for the optimal implementation of the ArcGIS Platform to support these development initiatives.

The North-West Department of Education and Sport Development is a huge administration with diverse products and service offering especially to the schools. The biggest challenge that is faced by the department is the turnaround time on issues raised by any sector at any given time. The current method of disseminating information is primitive and non-effective because it’s still relying the most on paper methods.

The implementation of the platform should assist the operations within the department, but also establish standards that will ensure interoperability and integration of data, systems and other GIS resources.

Each school would require access to the solution through the principal or management of the school. The people assigned would be responsible to communicate incidents through the solution, this should give the department the best chance to respond with effective reaction times.

Incidents
Spatial view of Schools with Incidents

The solution identified for these specific requirements was School Early Warning System. The Esri platform forms and integral part of the development of this system. The platform provides a spatial data infrastructure within the department. The ArcGIS Platform is an integrated web-GIS system that provides a wide range of capabilities for storing, managing, analysing, visualising and sharing geospatial data for all users within the organisation. The Platform provides the framework of data and technology needed to address a wide range of location-related business processes. Through change management processes, the department utilised ArcGIS Platform to introduce a method of reporting incidents at schools, backed up by photographic evidence.

survey123
Integrated mobile component of the School Early Warning System

The implementation of the School Early Warning System through ArcGIS Platform, support the Programmes of the Department’s Strategic Plan Document, the Annual Performance Plan and Medium-Term Framework Plan which are in a form of Five Year Plan and are identified as indicators within the following Strategic Objectives:

  • Ensure effective governance processes
  • Improved functionality and performance of schools
  • Enhanced accessibility of special schools
  • Accessible quality Grade R Education
  • Infrastructure management in schools and
  • Examination services managed

                                                                          

As part of the solution, the incidents will be loaded and locked in a centralised server via mobile device (Survey 123) wherein a unique identifier will be allocated to the incident for tracking purposes.

The Department Official will acknowledge receipt of the incident to update its status to received or in progress, in an Operations Dashboard.

The school will have access to track the status of the incident logged via a Dashboard

dashboard
Dashboard to give an overall indication of incident status

By understanding the main objectives of the North-West Department of Education and Sport Development to support the various schools and functions, the optimal implementation of the ArcGIS Platform serves as the right solution to meet the challenges faced by Department.

Broadband in South Africa

Broadband in South Africa

Whether it is mobile or fixed broadband services, consumers are demanding cheaper and faster speeds. Consumers have become brand agnostic and have become data hungry.

How do you differentiate yourself from your customer? Better services, faster speeds and rapid deployment of broadband services. This requires huge capital expenditure and exploring unknown markets.

Esri South Africa have helped our customers in the rapid build and design of their networks using the ArcGIS Platform. Using mobile applications our customers can update, capture and report on their network. This has changed the way in which our clients operate; instead of using paper based maps, our clients are enabled to manage their network from the field. With the introduction of BYOD, it helps organizations reduce hardware expenses.

Our mobile applications have enabled our clients to engage directly with the client by means of integrating CRM’s and allows the rapid deployment of their sales force into the field.

Esri helps you answer the question of “where” and solve problems. You transform your telecommunication company provide better service via your network assurance team, plan and build team and sales team. Esri provides a complete system that allows you to integrate disparate data, access and update information from the office or the field, and maintain a real-time view of all operations. More than maps and applications, Esri gives you the location analytics you need to save time, lower costs, and satisfy customers.

fibre_editing

Mathematically Verifying South African ID Numbers with Survey123

This blog post describes how South African ID numbers can be verified mathematically in Survey123. South African ID numbers have the following format:

{YYMMDD}{G}{SSS}{C}{A}{Z}

YYMMDD : Date of birth.
G  : Gender. 0-4 Female; 5-9 Male.
SSS  : Sequence No. for DOB/G combination.
C  : Citizenship. 0 SA; 1 Other.
A  : Usually 8, or 9
Z  : Control digit

The most challenging part of verifying the ID number is the control digit which is calculated by using the Luhn algorithm – this will be the focus of this blog post.

The best way to tackle complex mathematical functions in Survey123 is to break it up into separate mathematical calculations and using calculated fields:

The check digit is the last digit of the SA ID number so it can be retrieved with the following function: substr(${idnr}, string-length(${idnr}) – 1, string-length(${idnr})) where ${idnr} refers to the captured ID number.

Once you have an understanding of the substr() function the rest of the calculations used to verify the ID number is pretty much straight forward.

The survey’s XLSForm file can be found here (and can be freely used): SA Id number

  1. Copy the file to your downloads folder
  2. Open Survey123 Connect
  3. Create a New Survey and base it on an existing file
  4. Choose the Excel file that you have downloaded
  5. Your survey will be generated

Notes:

  1. The SA ID Number does not indicate if a user was born in 19yy or 20yy so both options are catered for – with a logic test to see if the birth date is in the future (age not greater than zero)
  2. Race is no longer indicated in the SA ID Number

Esri Field Mobility

Maintaining field assets such as roads or fire hydrants, requires engineers and managers to know what condition these assets are in. After all, prevention is better than cure and fixing problems is much more time consuming and expensive than just keeping all assets serviced and in good working condition.

Many organizations rely on a field workforce to support these daily operations. Having the capability to get information into and out of the field in a timely manner can increase the efficiency and effectiveness of the organization. Information collected in the field using easy-to-use solutions can share information with solutions including the executive operational dashboard in near real-time allowing decision-makers within an organization to make more informed and timely decisions. These mobile solutions can also improve the workflows of field personnel by providing them with on-demand access to actionable and task-relevant information creating a more efficient and effective workforce.

In a scenario where the data already resides in a geodatabase, how can office staff or dispatchers send out staff to the field to inspect and evaluate the condition of an asset easily and quickly and ideally without a paper trail?

Simply put, the workflow can be streamlined with the use of Workforce for ArcGIS in conjunction with Collector for ArcGIS.

1
Workforce for ArcGIS: Creating an Assignment

With Workforce for ArcGIS, office staff can manage the deployment of all field crews by assigning jobs to each individually and monitoring their progress and position in real time.

Creating an assignment on the Workforce for ArcGIS web app allows for the dispatcher to:

  • Choose the assignment Type
  • Set the location of assignment (Address or   coordinate)
  • Choose the staff member
  • Set Priority of assignment
  • Set the due date/time for completion
  • Description of assignment/task
  • Attach files for use by the field staff such as images or technical drawings.

Assignments are sent to the field worker via an internet connection to their mobile phones or tablets, running on Android, iOS or Windows 10.

2

Once the assignment has been created, the user in the field can choose to accept or decline the assignment, all of which will notify the dispatcher in the office.

When an assignment has been accepted and “Start” is chosen, the field user will access the details of the job as well as be able to access the applications used to both navigate to the location  or capture the data.

 

3-4
Navigating between Workforce for ArcGIS and Collector for ArcGIS on a mobile device

The user will choose the Collect option at the top-right in order for the hydrants to show on a map. Using Collector for ArcGIS allows for the user to access the existing feature where it’s properties can be altered.

5
Collector for ArcGIS: Feature attributes
6
Collector for ArcGIS: Editing feature attributes

Once a hydrant is selected, all it’s relevant data is displayed and ready to be edited, if required.

And when the inspection is complete, the tick at the top-left is selected, which will sync the data from the mobile device with the data source, keeping in mind that an internet connection is required.

Lastly, the applications will switch back to the Workforce for ArcGIS, where the field worker will select the “Finish” option, notifying the dispatcher of the assignments completion.

7

Collector and Survey123 for ArcGIS are also capable of capturing new features with the same workflow and do not require internet access though the location (GPS) has to be switched ON, on the mobile device.

Capturing data in the field has never been easier!

Three Steps to Asset Management with ArcGIS Online and Collector

Three quick steps to do Asset Management with Collector and ArcGIS Online:

Step 1 (ArcMap) – Authoring your feature classes and tables:

What you need: ArcMap and an ArcGIS Online Organizational Account

  • Create a database in ArcMap
  • Create a (point) Feature Class to store your Assets
  • Create a Table to store your Assets’ Condition Assessments
  • Create a Table to store Maintenance Tasks associated with your Assets
  • Link them all together with Relationship Classes to create a 1:M link between Assets and Assessments and Assets and Maintenance Tasks

ArcMap Asset Management FCs

  • Add the Asset Feature Class and the two related tables to a map document and publish it as a service to your ArcGIS Online account

Step 2 (ArcGIS Online) – Authoring your Web Map for use in Collector:

What you need: An ArcGIS Online Organizational Account

  • Create a new Map in AGOL and add your newly created Asset Management service to it
  • Add a basemap of your choice to your Map
  • Save your Map

Step 3 (Collector) – Deploying your Asset Management application:

What you need: An iPhone or Android phone with the Collector for ArcGIS Application installed

  • Start Collector and log in with your AGOL credentials
  • Open the Map created in Step 2
  • Start performing your Asset Management tasks!

Collector 1

For some additional images relating to this post – please see here: Asset Management Images

Homework for the avid reader:

  • Add a Tracking Layer for Field Workers to the AGOL Web Map
  • Install ArcGIS Operations Dashboard
  • Create a Dashboard that monitors real-time field activities such as Field Worker positions, Assets that require maintenance etc

OPS Dashboard