Calculation on geopoint not working

683
6
Jump to solution
03-18-2021 01:01 PM
JulietK
Occasional Contributor II

Hi, I'm trying to get geopoint data incorporated into my survey using calculations on geopoints, but it doesn't seem to be working as it should.

What I'm trying to achieve is to have a list of locations available in a select_one question, where the user can select the name of the location, then to have the location data able to be mapped in visualisation. The final output I would like is to show on the map the count of submissions made for each location (so the count of submissions for each location show in circle sizes).

 

In my xlsform Choices tab, I've got geopoints data in this format 

JulietK_0-1616096371626.png

In the Survey tab, I've entered the below into the Calculation column, as shown in the calculations on geopoints page. 

JulietK_1-1616096448059.png

In the survey, when I make the selection the geopoint map doesn't show the correct location

JulietK_2-1616097177104.png

The geopoint data does show up in the feature layer data page, but on the map view, the geopoint doesn't show correctly (this location should be in Vancouver Canada) 

JulietK_4-1616097538786.png

JulietK_5-1616097664328.png

Any idea what the issue might be here? 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Notable Contributor

I think you need a space between the numbers.  It is hard to see in that post you linked but if you copy paste the code from there you can see the space that you are missing.

concat(substr(${cities}, 0,10)," ",substr(${cities}, -10))

Hope that is it.  Seems like a weird way to do it but I have never tried it.  I am not sure why you cannot just store like  49.55 -127.66

View solution in original post

0 Kudos
6 Replies
DougBrowning
MVP Notable Contributor

I think you need a space between the numbers.  It is hard to see in that post you linked but if you copy paste the code from there you can see the space that you are missing.

concat(substr(${cities}, 0,10)," ",substr(${cities}, -10))

Hope that is it.  Seems like a weird way to do it but I have never tried it.  I am not sure why you cannot just store like  49.55 -127.66

0 Kudos
JulietK
Occasional Contributor II

Oh that has fixed the whole issue, thank you so much! :D 

Yes it would be ideal if the latitude & longitude could be stored without the extra symbols added and replacing the space.. Seems like they are needed since space is not allowed in the name column

0 Kudos
JulietK
Occasional Contributor II

Hi Doug, I have some additional queries if you would be able to answer them..

Query 1: The geopoints are showing in the correct locations, but in 'Change Style' the map does not give me a Counts and Amounts option to let me control the circle size according to the count number. 

JulietK_0-1616099745976.png

This is even though the map counts the number of entries with this geopoint as more than one (3)

JulietK_1-1616099804002.png

 

Query 2: I am hoping to make a different map with similar data, but a world choropleth map. I used 'Summarise within' function in the analysis, with the above feature layer and the ArcGIS world generalised countries shapefile layer. The option for Counts and Amounts (color) is given, but the count for the country shows as 1 when there are 3 entries for within the country. I thought this might be occurring due to the 3 geopoint entries being the same (overlapping), but my other geopoints within another country (2 different geolocations which do not overlap) also show as count of 1 in the country.

JulietK_2-1616100222014.png

Any ideas would be very much appreciated! 

 

 

 

0 Kudos
DougBrowning
MVP Notable Contributor

I am a bit lost but I will try.  

Query 1 you have work area picked which is a string prob - so no counts and amounts there.  Symbols show ranges of values (like 3 features with 10, 20, 30 values) they will not auto count the number of features for you.  You have to summarize for this like you do in Query 2.  I am not really sure what you are trying to map here.  If you want to see how many are in that exact spot then something like the new Clustering may work enough for you.  But it will not just group the 3 points for you.

The Query 2 I really have no idea.  Maybe you counted the main form instead of the repeat?

Sorry hard to tell without seeing it.  

Have you tried to use the Survery123 analysis tool instead?  

0 Kudos
JulietK
Occasional Contributor II

Thank you, I am trying to visualise on the map the count of survey submissions in which the specific locations were selected. I'll have to find out which one the new Clustering tool is and see if it helps.

For query 2, I used Summarise Within with the World generalised and the Repeat layer which contains the Work Area data, and not the main form parent layer. I will try query this issue with the ESRI support and see what they say. 

I've had a look at the map option on the Survey123 Analyse tab, but unfortunately it only places small circles noting the geolocations from the survey, and doesn't visualise on the map the number of entries for each of the locations. 

Thank you for your help! :)

0 Kudos
DougBrowning
MVP Notable Contributor

Clustering is the new Map Beta only.  Note you cannot set the clusters to shapes though.  Based on Zoom.

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/enhanced-clustering-in-map-viewer-be...

Summarize is the right way I think if you want it by polygon.  I think it is still not dynamic but not sure (new points means run it again).  Or maybe Aggregate Points.  Sorry been a bit since I used them.

If you want to get fancy I would look at Arcade.  One you get used to it pretty easy.  And it is dynamic.

Check out

https://community.esri.com/t5/arcgis-online-questions/arcade-totaling-field-values-of-features-conta...

https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-arcade-groupby/

https://community.esri.com/t5/arcgis-online-questions/count-points-in-a-polygon/m-p/704262

Hope that helps.

0 Kudos