Find a widget/ solution in WebApp builder to return the sum of values within the buffer

359
2
02-01-2024 12:31 PM
Labels (2)
rrangar
New Contributor

I am trying to build an app to give ranks to each development facility (aka address entered by the user) based on what facilities are in a 5 mile  radius. For example let's say Address X has hospital, bus stop, transit station in a 5 mile radius of it. 

Hospital carries 1 point

Transit station carries 1 point

Bus stop carries 1 point

 

So Address X in the map should return a sum total of all of the above = 3. Hence Rank is 3. 

I tried pretty much all widgets in Web App builder, I am not able to find the one that can return me the sum of the layers within the buffer. I am currently using near me widget that is great to try different buffer distances and get a list of facilities within that buffer but it does not add the scores for me. Can someone please help me if they know what could be the best possible solution to this?

0 Kudos
2 Replies
DavidSolari
Occasional Contributor III

Is your data in an EGDB? You can write a database view that UNIONs every layer into 1 big table with a "score" field, something like:

 

SELECT ROW_NUMBER() [OBJECTID], tbl.[LayerName], tbl.[Score], tbl.[Shape]
FROM ( 
  SELECT 'Layer1' [LayerName], 1 [Score], Shape
  FROM A.B.Layer1
  UNION
  SELECT 'Layer2' [LayerName], 1 [Score], Shape
  FROM A.B.Layer2
) tbl

 

You'll have to find the appropriate function to get a unique row number for your database, here's some info for SQL Server. Once the view works you can register it to the EGDB, publish it as a layer and drop that in your app for use with widgets.

0 Kudos
rrangar
New Contributor

My data is in ArcGIS Online and the app that I am creating is using WebApp GIS Builder (without coding). I do not have a coding background so I am not sure of the solution you provided me with and how to implement it. 

Is there a no coding solution available? or if you could explain how to implement your solution in a step by step manner.

0 Kudos