Select to view content in your preferred language

Survey123: Validate position for geopoint in repeat

764
6
09-17-2019 01:37 AM
Nicole_Ueberschär
Esri Regular Contributor

I have a quite complicated construction of a survey: 

This is the scenario: 

An area is defined that needs to be validated by samples. For every 1ha of that given area there is supposed to be taken a sample. Each taken survey is covering a different area which might be defined just before the next field visit. All samples for that given area should be stored within one filled survey. It needs to be validated automatically that one sample is taken for every 1ha. 

My idea was now to create a fish grid of 1ha grid size for that given area, calculate the position of the label points. Store the point ID with the position inside the survey and calculate the distance from the geopoint to the selected point to make sure that it is within a 50m radius of that label point. Now these points might be changing/being updated when a new area is added, so I would need to update the survey each time with the risk to loose all my data. 

First question: is there another way to validate the location of a geopoint question against the location of a different set of points?

Second question: Can I validate within a filled survey that each point id was only selected once?

Sorry if this sounds very complicated. Please don't hesitate to ask for clarifications. 

Thanks for your input!

Tags (1)
0 Kudos
6 Replies
DougBrowning
MVP Esteemed Contributor

Well I do have a distance formula that I use.  It takes 2 sets of lat/long, converts to radians and then gives the distance between them.  But making sure there is a grid pattern would be hard even in ArcMap.  Can you premake the points based on the polygon before they leave for the field?  Could you make a vector tile layer of the fishnet for the whole possible area ahead of time?

Here is the formula

round(acos(sin(${Northing} * pi() div 180)*sin(${DesignLat} * pi() div 180) + cos(${Northing} * pi() div 180)*cos(${DesignLat} * pi() div 180)*cos((${DesignLong} * pi() div 180)-(${Easting} * pi() div 180))) * 6371000,2)

Hope it helps.

Nicole_Ueberschär
Esri Regular Contributor

Thank you Doug!

I managed to create the regular grid with the fishnet, then used the label points as target sample points, calculated x/y, duplicated the points and moved them to the upper left corner of the fishnet (for each grid cell), then calculated from here the x and y again and then calculated in excel from here the min and max values that would be allowed for each point. I used pulldata() to validate the location is within my min and max values. This is very complicated...

So with your formula I think I could skip the part from "duplicated the points" 🙂

Would the distance be given in meters then? I assume Northing/Easting would be one pair and the DesignLat and DesignLong would be the other pair of coordinates?  EDIT: This works like a charm! 

I am not sure yet if the workflow will allow to create a new basemap for each field trip. I think it would help the fieldworker to navigate from point to point but I don't know yet if it will be feasible...

0 Kudos
DougBrowning
MVP Esteemed Contributor

Yes meters and yes these are two lat/long pairs.

How I use it is I have Collector send over the lat/long pair of the plot the crew is supposed to go to (DesignLat/DesignLong).  (I have Arcade code that calcs the lat/long on the fly vs static in case they move it).

Then the form uses the GPS to to get Northing and Easting.

This formula gives me the distance then of where they are vs where they should be.

Not my math - check out the post here https://community.esri.com/groups/survey123/blog/2018/01/10/calculating-distances-between-multiple-g... 

Nicole_Ueberschär
Esri Regular Contributor

I would say the first question is solved - not yet the perfect solution but it should work. 

Remains the second question: 

Can I validate that each point id is selected only once among the repeats?

I could write all given answers to a field (=summary) and then use notcontains() to check if it is already there. Now the problem is, that as soon as I do the selection, that string is added to the summary, so I would need to check if this string appears only once. And the best would be if the validation would happen directly with the selection - when the field officer already had entered the data for that point and after creating a new repeat only gets the note that he already had entered data for this point he will be frustrated 😉

Another option would be to remove the selected point (visually) from the options but that is probably more difficult...

0 Kudos
DougBrowning
MVP Esteemed Contributor

I do this.  The trick is to take the last few chars off the join() string first then check it. 

See my post here for more details  Counting "unique" selections across repeats 

 not(contains(substr(${AllPlantsCheck}, 0, string-length(${AllPlantsCheck}) - 3), ${SpeciesList})) 

Nicole_Ueberschär
Esri Regular Contributor

Awesome, thanks! 

0 Kudos