Print the mid (or central) Geopoint of a repeat in a map in the report and hide the marker

229
6
03-23-2022 09:24 AM
Iron_Mark
New Contributor III

Hi,

I have a survey with a repeat that let you collect as many geopoints as you want.

In the final report I am interested to see only one map because I don't want a single map for each geopoint. So I use this:

${#ObPoints | resultRecordCount:1}

${Ob_Points | mapSettings:” xxxf4192fcdexxxccf52xxbb7xxxxxxx”:3500 | size:580:380}

${/}

 

The problem is that when I geneate the report I have the map centered on the first point (because the logic of the script is to print that first point). I would like to center the map on the value on the center.

For example if we collect 3 geopoints for that repeat it has to be centered (or print if you want) the second, if we collect 4 points I want the map centered on the second or the third one...

Can anybody help with this please?

Also, if you know how to hide (or change) the marker on the PDF report generated that would be great.

Thank you

0 Kudos
6 Replies
BarbaraWebster1
Esri Contributor

Hi @Iron_Mark,

Have you looked into the recent enhancement that allows you to show all the geopoint entries on one map for a geopoint that's in a repeat? The syntax would be ${repeat1.repeatLocation}. It's documented in the Map Questions section of the Survey123 feature reports documentation. If you used that approach, the centerpoint of the report map would be based on all the points. 

If that option doesn't work for your workflow, one way to filter for the approximate median repeat index would be to calculate it in the survey form, which might look something like this:

typenamelabelcalculation
begin repeatr1r1 
geopointg1g1 
integerpositionpositionposition(..)
end repeat   
decimalcenter_positioncenter_positionround((count(${position})) div 2,0)


Then you could use a where method in the report template to only show repeat records where the position question was equal to the center_position question.

You can hide or change the marker symbol using the drawingInfo method, which will allow you to define the symbology based on either the current feature layer or by providing a URL to a different feature layer. This is also included in the Map questions documentation linked above.

Thanks,
-Barbara

Iron_Mark
New Contributor III

Hi Barbara,

Thank you for your reply. I tried to use the syntax suggested by you " ${repeat1.repeatLocation} " but I couldn't be able to make it work. Can you explain how do I use in my report to make it work?

Please if you can also suggest regarding  hiding the marker using the drawinfo method  with my sytax

${#ObPoints | resultRecordCount:1}

${Ob_Points | mapSettings:” xxxf4192fcdexxxccf52xxbb7xxxxxxx”:3500 | size:580:380}

${/}

Many thanks

0 Kudos
BarbaraWebster1
Esri Contributor

Hi @Iron_Mark,

Sorry for the delayed reply. Try this syntax to set the point symbology equal to the symbology defined in the survey feature layer in the visualization tab. There's no need to include the repeat start and end tags when you are showing all the points on one map.

${ObPoints.Ob_Points| mapSettings:”xxf4192fcdexxxccf52xxbb7xxxxxxx”:3500 | size:580:380| drawingInfo:"currentLayer"}

And this syntax is what you would use to set the point symbology equal to the symbology that's set in a view of the feature layer.

${ObPoints.Ob_Points| mapSettings:”xxf4192fcdexxxccf52xxbb7xxxxxxx”:3500 | size:580:380|drawingInfo:" https://services5.arcgis.com/jxxx654444xxx/arcgis/rest/services/nameofviewlayer/FeatureServer/1"}

Also note that if you don't explicitly define a scale, the map extent will automatically adjust to fit the points in the map.

Thanks,
-Barbara

Iron_Mark
New Contributor III

Hi Barbara,

Many thanks for your answer, I am having a problem with yours syntaxes. Everything work awesome exept for the fsct that I get the "default" survey123 simbology on top of mine one (those red points).

Do you know why?

I tried several times both your 2 sintaxes but it comes out like the following screenshot.

Screenshot 2022-04-21 145137.png

Do you know why?

Many thanks again!

0 Kudos
BarbaraWebster1
Esri Contributor

Hi @Iron_Mark,

Sorry for the delay, you could check to make sure that when you set the symbology in the 'Visualization' tab of the feature layer or view that you changed the symbology for the repeat layer as well as the parent layer. 

BarbaraWebster1_0-1652378938107.png


- Barbara

0 Kudos
DerrickWestoby
Occasional Contributor III

As @BarbaraWebster1 said, the recent enhancements would allow  you to print a map that contains all of your geopoint.  If you combine it with a referenced web map ID and drawingInfo=currentLayer, you could hide all of the geopoints on the generated map as well. 

Prior to that feature being released, I was doing what you're after by generate an extent geoshape by calculating the min/max lat/lon values and then using that polygon for report generation, instead of the geopoints. (I'd still recommend using the recently-released feature Barbara linked, though)

DerrickWestoby_0-1648069926147.png

 

DerrickWestoby_1-1648069946120.png

 

DerrickWestoby_3-1648070018779.png

DerrickWestoby_5-1648070153264.png

 

 

DerrickWestoby_4-1648070110210.png