Hello all,
I have a map with two polygon layers and a point layer. One polygon layer is isochrones representing how far someone can go on public transit using current schedules. The second polygon layer is isochrones representing how far someone can go with increased frequency. The point layer contains points of interest. Some of these points can be reached by both polygons, some are only reached by one polygon, and some are not reached by either polygon. I'm trying to build an expression that I can use in the pop-up that will tell the viewer if that point can be reached using the current schedule, the increased frequency schedule, both, or neither. Below is the expression:
<SPAN class="keyword token">var</SPAN> current <SPAN class="operator token">=</SPAN> <SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$map<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Jane with Current Schedules"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">var</SPAN> increased <SPAN class="operator token">=</SPAN> <SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$map<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"Jane with High Frequency"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">var</SPAN> Jane_current <SPAN class="operator token">=</SPAN> <SPAN class="token function">Intersects</SPAN><SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">,</SPAN>current<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">var</SPAN> Jane_increased <SPAN class="operator token">=</SPAN> <SPAN class="token function">Intersects</SPAN><SPAN class="punctuation token">(</SPAN>$feature<SPAN class="punctuation token">,</SPAN>increased<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">var</SPAN> both_Janes <SPAN class="operator token">=</SPAN> <SPAN class="token function">Iif</SPAN><SPAN class="punctuation token">(</SPAN>Jane_current <SPAN class="operator token">==</SPAN> Jane_increased<SPAN class="punctuation token">,</SPAN><SPAN class="string token">'true'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'false'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="token function">When</SPAN><SPAN class="punctuation token">(</SPAN>both_Janes <SPAN class="operator token">==</SPAN> <SPAN class="string token">'true'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'This location can be reached by Jane using the current and increased frequency schedules.'</SPAN>
Jane_current <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'This location can be reached by Jane using the current public transportation schedules.'</SPAN><SPAN class="punctuation token">,</SPAN>
Jane_increased <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'This location can be reached by Jane using the increased frequency schedule.'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'This location cannot be reached by public transportation.'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
When I try to run this, I get the following error: Parse Error:Line 9: Unexpected identifier
If I put a Count function around the intersects, it returns the correct count, so I'm confused why I'm getting an error on Line 9 when I call Jane_current in the When function.
Any help would be appreciated.
Miguel