Greetings,
I was wondering if something like this could be achievable with Arcade?
I have a map that has multiple feature classes/services. They are project locations for different groups with basic attribute information like Project ID, Name, Type, Description, Project Manager, Estimated Begin and End date. I was originally thinking of using the intersect and proximity functions in Arcade to create a pop up for projects that intersect or come within a certain proximity of each other and have overlapping dates.Now thinking about it (it would be too busy with too many pop ups), it would probably be better to have a list generated that calls out projects that overlap or come within close proximity of each other and have overlapping dates instead of single pop ups for the whole map area.Is this possible with just Arcade? Are there any existing similar examples of this? And how would one go about this?Or would this need to be a web app with custom Java/Python scripting?Thanks for any insight.
I have a map that has multiple feature classes/services. They are project locations for different groups with basic attribute information like Project ID, Name, Type, Description, Project Manager, Estimated Begin and End date.
I was originally thinking of using the intersect and proximity functions in Arcade to create a pop up for projects that intersect or come within a certain proximity of each other and have overlapping dates.
Now thinking about it (it would be too busy with too many pop ups), it would probably be better to have a list generated that calls out projects that overlap or come within close proximity of each other and have overlapping dates instead of single pop ups for the whole map area.
Is this possible with just Arcade? Are there any existing similar examples of this? And how would one go about this?
Or would this need to be a web app with custom Java/Python scripting?
Thanks for any insight.
You can list the overlapping projects in a popup:
// load all project layers (including this one!) var other_project_fcs = [ FeaturesetByName($map, "TestPoints"), FeaturesetByName($map, "TestLines"), FeaturesetByName($map, "TestPolygons"), ] // buffer your project geometry var project_buffer = Buffer($feature, 250, "feet") var other_projects = [] // iterate over the project layers for(var i in other_project_fcs) { // find all projects intersecting the current project (buffered) var nearby_projects = Intersects(project_buffer, other_project_fcs[i]) // iterate over those projects for(var project in nearby_projects) { // skip if the intersecting project is the current $feature if($feature.ProjectID == project.ProjectID) { continue } // get start and end dates var start1 = $feature.BeginDate var end1 = $feature.EndDate var start2 = project.BeginDate var end2 = project.EndDate // skip if there is no time overlap if(start1 > end2 || start2 > end1) { continue } // calculate the time overlap var overlap_start = Date(Max([Number(start1), Number(start2)])) var overlap_end = Date(Min([Number(end1), Number(end2)])) var overlap = DateDiff(overlap_end, overlap_start, "days") + 1 // describe the overlapping project var dist = Round(Distance($feature, project, "feet"), 0) var runtime = Text(start2, "MM/DD/Y") + " - " + Text(end2, "MM/DD/Y") var project_text = [ "Project: " + project.Project, "Contact: " + project.Contact, "Distance: " + dist + " feet", "Runstime: " + runtime, "Overlap: " + overlap + " days" ] // append the desription to the array Push(other_projects, Concatenate(project_text, "\n")) } } // concatenate the descriptions and return return Concatenate(other_projects, "\n\n")
You can modify the expression to fill a featureset with all pairs of overlapping projects and feed that featureset into a list widget in a Dashboard or Experience, no custom javascript neccessary.
Hi Johannes,
You mentioned towards the end of the response that its possible to modify the expression to fill a featureset with all pairs of overlapping projects and feed that featureset into a dashboard widget.
I was just asking how to modify the code to create that project overlap feature class and table.
How would I generate the overlap feature and table that met the spatial and date conditions?
Not sure what you're asking. Can you clarify?
if a field like contact existed with an email, would it be possible to generate a notification to both project contacts if the conditions of location and dates is met?
Probably, but not with Arcade. You can whip up a Python script that sends the mails. I think you could execute the script via a webhook when a new project is inserted, but I don't know anything about that.
Thanks Johannes. This is awesome. How would I generate the overlap feature and table that met the spatial and date conditions?
Was curious if a field like contact existed with an email, would it be possible to generate a notification to both project contacts if the conditions of location and dates is met?
Absolutely! Take a look at the Intersects function, as it's what you'll need to identify features that touch one another. For the proximity part, you can just buffer the input feature 250ft, and use the Distance function to get the distance between.
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.