S prosincovou aktualizací ArcGIS Online byla zavedena možnost odkazovat na jiné vrstvy pomocí Arcade výrazů v pop-upech. Tento blog představí rychlý příklad, jak vytvořit jednoduchý výraz pro průnik a zobrazit výsledky v pop-up okně.<\/P>
<\/P>
V tomto příkladu jsem použil 4 vrstvy označené jako authoritative v ArcGIS Online od Miami-Dade County, Florida<\/A>. Chci zobrazit názvy Elementary<\/A>, Middle<\/A> a High School <\/A>, které se protínají s building footprints<\/A> v jednom pop-up okně. Mám tři vrstvy School Attendance Boundaries, které identifikují konkrétní školní hranice, jež se překrývají s mnoha building footprints. Vrstva building footprint obsahuje geometrické informace, ale žádné informace o infrastruktuře nebo zónách, které se protínají s budovou.<\/P>Tato Web Map<\/A> ukazuje příklady informací dostupných v těchto vrstvách ve 4 samostatných vrstvách.<\/P><\/P><\/P>S využitím nové funkce Arcade FeatureSet jsem byl schopen zahrnout názvy Elementary, Middle a High School do building footprint pop-up okna v tomto web mapu<\/A>. <\/P><\/P><\/P><\/P>Zde jsou kroky k nastavení tohoto jednoduchého průnikového Arcade výrazu pro zahrnutí do pop-up okna.<\/P>Přidejte všechny požadované vrstvy s informacemi, které chcete vidět, do web mapy<\/A>.<\/P><\/LI>Vyberte vrstvu, která by měla zobrazovat informace v pop-up okně (Building Footprint)<\/P><\/LI>Prohlédněte si vrstvy School Attendance Boundary a identifikujte pole, která chcete zobrazit ve vrstvě Building Footprint (Name)<\/P><\/LI>Vyberte Konfigurace Pop-up a přejděte na Přidat atributové výrazy<\/A><\/P><\/LI>Vytvořte výraz pro každou vrstvu.<\/P>Vytvořte proměnnou, která vrací FeatureSet atributů protínajících se prvků.<\/P>var intersectLayer =Intersects<\/A>(FeatureSetByName($map,"Elementary School Attendance Boundary"), $feature)<\/P><\/BLOCKQUOTE>Vysvětlení hodnot výrazu:<\/P>var intersectLayer<\/EM> <\/> <\/> 03 specifikuje název proměnné pro protínající se prvky<\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/> Intersects <\/> 03 specifikuje geometrickou funkci, kdy jeden prvek protíná geometrii druhé specifikované vrstvy.<\/><\/> FeatureSetByName<\/> 03 Vytváří FeatureSet z vrstvy prvků na základě jejího názvu v mapě nebo službě prvků.<\/> $map,"Elementary School Attendance Boundary"<\/> 03 identifikuje, že FeatureSet je vrstva pojmenovaná Elementary School Attendance Boundary v rámci webové mapy.<\/> $feature<\/> je prvek, který je vybrán ve vrstvě Building Footprint a poskytuje počáteční prostorové informace.<\/><\/><\/> b. Procházejte vytvořený FeatureSet a vraťte konkrétní pole z FeatureSet:<\/> <\/> for (var f in intersectLayer){<\/> return f.NAME<\/> }<\/> 6. Jakmile jsou všechny výrazy vytvořeny, přidejte je do konfigurace pop-up okna (pop up configuration<\/>).<\/> 7. Deaktivujte pop-up okna a případně viditelnost vrstev School Attendance Boundary (není povinné, ale myslím, že to čistí zobrazení).8.Podívejte se na svůj pop-up s informacemi z protínajících se vrstev.Budou k dispozici další dokumentace, blogy a příklady během příštího týdne, ale vyzkoušejte tento rychlý příklad s jednoduchými protínajícími se vrstvami a dejte nám vědět, pokud máte otázky.Celý výraz pro jeden název high school:var intersectLayer =Intersects(FeatureSetByName($map,"Elementary School Attendance Boundary"), $feature)for (var f in intersectLayer){ return f.NAME}
Tato
S využitím nové funkce Arcade FeatureSet jsem byl schopen zahrnout názvy Elementary, Middle a High School do building footprint pop-up okna v tomto
Zde jsou kroky k nastavení tohoto jednoduchého průnikového Arcade výrazu pro zahrnutí do pop-up okna.<\/P>
Přidejte všechny požadované vrstvy s informacemi, které chcete vidět, do
Vyberte vrstvu, která by měla zobrazovat informace v pop-up okně (Building Footprint)<\/P><\/LI>
Prohlédněte si vrstvy School Attendance Boundary a identifikujte pole, která chcete zobrazit ve vrstvě Building Footprint (Name)<\/P><\/LI>
Vyberte Konfigurace Pop-up a přejděte na
Vytvořte výraz pro každou vrstvu.<\/P>
Vytvořte proměnnou, která vrací FeatureSet atributů protínajících se prvků.<\/P>
var intersectLayer =
Vysvětlení hodnot výrazu:<\/P>
var intersectLayer<\/EM> <\/> <\/> 03 specifikuje název proměnné pro protínající se prvky<\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/><\/> Intersects <\/> 03 specifikuje geometrickou funkci, kdy jeden prvek protíná geometrii druhé specifikované vrstvy.<\/><\/> FeatureSetByName<\/> 03 Vytváří FeatureSet z vrstvy prvků na základě jejího názvu v mapě nebo službě prvků.<\/> $map,"Elementary School Attendance Boundary"<\/> 03 identifikuje, že FeatureSet je vrstva pojmenovaná Elementary School Attendance Boundary v rámci webové mapy.<\/> $feature<\/> je prvek, který je vybrán ve vrstvě Building Footprint a poskytuje počáteční prostorové informace.<\/><\/><\/>
b. Procházejte vytvořený FeatureSet a vraťte konkrétní pole z FeatureSet:<\/>
<\/>
for (var f in intersectLayer){<\/> return f.NAME<\/> }<\/>
for (var f in intersectLayer){<\/>
return f.NAME<\/>
}<\/>
6. Jakmile jsou všechny výrazy vytvořeny, přidejte je do konfigurace pop-up okna (
7. Deaktivujte pop-up okna a případně viditelnost vrstev School Attendance Boundary (není povinné, ale myslím, že to čistí zobrazení).
8.Podívejte se na svůj pop-up s informacemi z protínajících se vrstev.
Budou k dispozici další dokumentace, blogy a příklady během příštího týdne, ale vyzkoušejte tento rychlý příklad s jednoduchými protínajícími se vrstvami a dejte nám vědět, pokud máte otázky.
Celý výraz pro jeden název high school:
var intersectLayer =Intersects(FeatureSetByName($map,"Elementary School Attendance Boundary"), $feature)for (var f in intersectLayer){ return f.NAME}
for (var f in intersectLayer){ return f.NAME}
Hi Kelly Gerrow ,
Thanks for sharing this blog! Any idea when the online help of ArcGIS Arcade | ArcGIS for Developers will reflect the new features in version 1.5 ? At this moment it is still showing version 1.4 (July):
Hi,
It was just updated. You can find feature set doc here:
Data Functions | ArcGIS for Developers
-Kelly
Great, thank you Kelly!
I'm assuming this isn't available in Portal yet?
John,
That would be No. See this release info link:
About release versions—Portal for ArcGIS | ArcGIS Enterprise
I suspect that this will be included in the March release of ArcGIS 10.7.
Thanks. Just determining a route to proceed with.
Yes, This is planned to be included with the next ArcGIS Enterprise release. (10.7)
Check out this blog by Paul Barker about Feature Sets:
What’s new with Arcade: Taking a stroll through FeatureSets (Part 1)
I just posted another document on these new functions here: https://community.esri.com/docs/DOC-12773-using-featuresetby-functions-in-arcade-to-drill-down-to-other-layers-and-tables
Is it also possible to use the position off the mouseclick instead off $feature within the Intersects function?
I don't think that is possible (at least I haven't seen a functionality exposed in Arcade that does that. Could you explain a little better what you would like to achieve?
Thank you, Xander. I was able to use the negative buffer example you provided in your blog - very helpful! Also, I created an if... else to determine if more than one polygon was intersected and return different expressions.
var buff = Buffer($feature,-10,'feet')var intersectsLayer = Intersects(FeatureSetByName($map,"Zoning"),buff)var intcount = Count(intersectsLayer)var expr = ''if(intcount>1) { expr = 'Multiple regulations apply. Contact appropriate Planning Department.'}else { for(var f in intersectsLayer){ var zone = f.ZONING expr = Proper(zone) }}return expr
You could also return multiple values by iterating and adding to the expression before returning it, but the lack of a new line capability in AGOL makes this unworkable for me.
Hi Heather Widlund ,
Great to hear that you successfully made use of the new Arcade functions! Please post a screenshot of the result.
Actually the "TextFormatting.NewLine" works in the pop-up and you can create a new line for each entry as show below:
The document you referenced Using FeatureSetBy functions in Arcade to drill-down to other layers and tables shows how you can do this.
I was led astray by old documentation, I guess - not the first time. Thanks for the tip! I decided not to do the multiple results for other reasons, but here are my two pop-ups, consisting of two expressions drilling down from one polygon layer to another.
Is it safe to say that this functionality does not work if the web map contains ArcGIS Enterprise "Map Image Layers" (formerly known as ArcGIS Server Dynamic Map Services)? I tried setting it up with those in the web map and I was not able to access the Global "$map" entity. As a result the Arcade Expression does not work. But when I add hosted feature layers from ArcGIS Online to the web map it does work. I also assume this would work with an ArcGIS Enterprise feature layer, but I'll have to wait to test that in the future when we have the on-site Portal set up.
I tried the same thing. It doesn't work with Map Image Layers. I haven't tried it with hosted Enterprise feature layers.
When I attempt to create an expression, similar to the example, I receive this error... Any ideas as to why? AGOL, not portal.
That's the error I got when I tried to use a source that was not a hosted feature layer (it was a map image layer published from ArcGIS Server). It doesn't have an object $map because it's not the right kind of source.
That is also the same error I encountered when I used a map image layer from ArcGIS Server. Error did not happen when using a hosted feature layer from AGOL.
The expression will work for AGS layers if you register the individual layers in your AGS map service as feature layers in AGOL (by their map index number). Then add the registered feature layers to your web map. The globals for $map, $feature, $layer, and $datastore will appear in the expression builder.
Hope that helps
Ned
Hi all,
This is exciting stuff! I'm still fairly new to Arcade. Can anyone tell me if these Arcade Expressions with FeatureSets will work in Collector? If they will work in Collector, will they work in an offline Collector application that has syncing enabled?
I have some end users that could really use some of this functionality to quickly determine some summary info while "disconnected" in the field.
Thanks!
Ken
I just did a small test on Collector (Aurora, iPad) and it seems that there is still not full support for Arcade. I do expect that the new functions will be supported in the future.
I tried this and it did not seem to work for me. Perhaps it is a version issue? I am using a really old AGS stack at the moment (AGS 10.3.1, Enterprise GDB in SQL Server 2008 R2). Out of curiosity what version are you running, Ned?
This is just SUPER! This ability is very much appreciated!
It does not appear that the Near Me widget in Web AppBuilder supports this capability yet. Is this in fact the case? We like to use the Near Me widget to lookup locations and any intersecting features, but it doesn't seem like the Arcade expressions want to print results in the Near Me resulting popup configuration.
Kyle,
My tests confirm your findings. My group uses the Near Me widget in a similar fashion so this is a significant limitation for us too.
Any thoughts or potential work around ideas from ESRI Staff?
Thanks
Due to performance issues I guess this functionality has been limited. You can however do a field calculation and use the Arcade functions to create a new field and that one will be available in all the widgets. The donwside is that the values in the new field will not update when a feature changes or new features are created.
Kyle Wikstrom Ned Cake This is a known issue with Near Me right now. We're planing to include a fix in the next release of WebAppbuilder/ArcGIS Online.
-Allison
Sounds Great Allison!
Thanks for the quick response. Will the fix find its way into the WAB Developer Edition also?
Yes, it will.
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Nový zde? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.