IDEA
|
Most modern drones are using Android Smart Controllers. Autel is the main alternative to DJI (which is not a viable option for my local gov) and it would be great to have Site Scan for Android. Autel has an SDK available... that would make Site Scan an end-to-end solution allowing for fleet management.
... View more
05-16-2023
02:17 PM
|
0
|
0
|
855
|
POST
|
You're the man @ChrisFox, that solved my indexing error. Thanks!
... View more
05-09-2023
09:05 AM
|
0
|
0
|
444
|
POST
|
Thanks for the reply @TedHoward2. I tried adding these to both rules but I'm still getting the same indexing error.
... View more
05-08-2023
01:10 PM
|
0
|
0
|
471
|
POST
|
Working on the attribute rules in the address data management solution v2. The address point rule "Create Site Address Point" is giving me an error about indexing that it difficult to troubleshoot. It seems like this rule is looking for the addressptid created in the Address Point ID rule but not finding it. Any suggestions on getting one rule to initiate before another? Anyone else seen this error? Here is the rule. // This rule will create a new site address point when an address point is created along a road // The site address point will be offset from the road by the distance and direction defined in the address point feature template // Define the Address Points fields var id_field = "addressptid"; var offdist_field = "offdist"; var offdir_field = "offdir"; var numpoints_field = "numpoints"; var incrementval_field = "incrementval"; var capturemeth_field = "capturemeth"; // Define the Site Addresses fields var addressptid_field = "addressid"; var addrnum_field = "housenumber"; var roadfullname_field = "fullname"; var status_field = "status"; var defaultstatus = "Pending"; var addrcapturemeth_field = "capturemethod"; // Define the Road Centerline fields var fromleft_field = "fromaddr_l"; var fromright_field = "fromaddr_r"; var toleft_field = "toaddr_l"; var toright_field = "toaddr_r"; var fullname_field = "fullname"; // This function will return the new point offset perpendicularly from a 2-point line segment at a specified distance // Positive distance is to the left of the line. Negative distance is to the right of the line function offsetPoint(firstPoint, secondPoint, fromPoint, dist) { var x1 = firstPoint.x; var y1 = firstPoint.y; var x2 = secondPoint.x; var y2 = secondPoint.y; var x3 = fromPoint.x; var y3 = fromPoint.y; var a = y1 - y2; var b = x2 - x1; var norm = Sqrt(a*a + b*b); a = a / norm; b = b / norm; return [x3 + a * dist, y3 + b * dist] } // This function will find the closest point on line_feature from point_feature function closestPointInfo(point_feature, line_feature) { var vertices = line_feature["paths"] var x = point_feature["x"]; var y = point_feature["y"]; // Loop through each part of the geometry and each segment, tracking the shortest distance var shortest = [1e10]; for (var i in vertices) { var part = vertices[i]; var previous = part[0]; for (var j = 1; j < Count(part); j++) { var current = part[j]; var result = pDistance(x, y, previous["x"], previous["y"], current["x"], current["y"]); if (result[0] < shortest[0]) shortest = result previous = current; } } // Couldn't find anything if (Count(shortest) == 1) return null return {"distance": shortest[0], "coordinates": shortest[1], "isVertex": shortest[2], "lineSide": shortest[3]} } // This function will get distance between 2 points function pDistance(x, y, x1, y1, x2, y2) { var A = x - x1; var B = y - y1; var C = x2 - x1; var D = y2 - y1; var dot = A * C + B * D; var len_sq = C * C + D * D; var param = -1; if (len_sq != 0) //in case of 0 length line param = dot / len_sq; var xx, yy; var is_vertex = true; if (param < 0) { xx = x1; yy = y1; } else if (param > 1) { xx = x2; yy = y2; } else { is_vertex = false; xx = x1 + param * C; yy = y1 + param * D; } var dx = x - xx; var dy = y - yy; return [Sqrt(dx * dx + dy * dy), [xx, yy], is_vertex, sideOfLine(x,y,x1,y1,x2,y2)]; } // This function will get side of line segment that a point (x, y) is on based on the direction of segment [[x1, y1], [x2, y2]] function sideOfLine(x, y, x1, y1, x2, y2) { var d = (x - x1) * (y2 - y1) - (y - y1) * (x2 - x1) if (d < 0) { return 'left' } else if (d > 0) { return 'right' } else { return null } } // This function will create point geometry from coordinates [x, y] function createPoint(coordinates, spatial_ref) { return Point({"x": coordinates[0], "y": coordinates[1], "z" : 0, "spatialReference": spatial_ref}) } // This function will return the segment intersected and the distance along the line function intersectDistanceAlong(sourceGeometry, interestedLine){ var distanceAlongLine = 0; // Loop through the segments of the line. Handle multipart geometries for (var part in Geometry(interestedLine).paths) { var segment = Geometry(interestedLine).paths[part]; // Loop through the points in the segment for (var i in segment) { if (i == 0) continue; // Construct a 2-point line segment from the current and previous point var firstPoint = segment[i-1]; var secondPoint = segment[i] var twoPointLine = Polyline({ 'paths' : [[[firstPoint.x, firstPoint.y], [secondPoint.x, secondPoint.y]]], 'spatialReference' : firstPoint.spatialReference}); // Test if the point intersects the 2-point line segment if (Intersects(sourceGeometry, twoPointLine)) { // Construct a 2-point line segment using the previous point and the address point var lastSegment = Polyline({ 'paths' : [[[firstPoint.x, firstPoint.y], [sourceGeometry.x, sourceGeometry.y]]], 'spatialReference' : firstPoint.spatialReference}); // Add to the total distance along the line and break the loop distanceAlongLine += Length(lastSegment); return [twoPointLine, distanceAlongLine] } // Add to the toal distance along the line distanceAlongLine += Length(twoPointLine); } } return null; } // This function will return the address number of the new site address point // It determines this based on the from and to address range on the intersecting road and the direction of the offset function getAddrNum(road, percentAlong, dir) { var addrNum = null; var from = road[fromleft_field]; var to = road[toleft_field]; if (Lower(dir) == 'right') { var from = road[fromright_field]; var to = road[toright_field]; } if (from == null || to == null) return null; var val = percentAlong * (to - from); var addrNum = 0; if ((Floor(val) % 2) == 0) addrNum = Floor(val); else if ((Ceil(val) % 2) == 0) addrNum = Ceil(val); else addrNum = Floor(val) - 1; return from + addrNum; } If (!HasKey($feature, id_field)) return; var id = $feature[id_field]; // Get the geometry of the feature var geom = Geometry($feature); // Get the distance and direction defined in the address point feature template/ // If none specified defaults to 0 and Left var dist = 0; if ($feature[offdist_field] != null) dist = $feature[offdist_field]; var dir = 'left'; if ($feature[offdir_field] != null) dir = $feature[offdir_field]; if (Lower(dir) == 'right') dist *= -1 // Get the number of site address points and increment value from the address point feature template // Defaults to 1 and 0 respectively var numpoints = 1; if ($feature[numpoints_field] != null) numpoints = $feature[numpoints_field]; var increment = 0; if ($feature[incrementval_field] != null) increment = $feature[incrementval_field]; // If not creating any site addresses return if (numpoints < 1) return; // Find any intersecting roads with the address point // If no roads intersect, buffer the point to handle cases where point isn't exactly snapped to line and try again // If no roads intersect the the buffer return an error message and prevent the address point from being created var intersectingRoads = Intersects(FeatureSetByName($datastore, "CenterlinesMSD", [fullname_field, fromleft_field, toleft_field, fromright_field, toright_field], true), geom); if (Count(intersectingRoads) == 0) { intersectingRoads = Intersects(FeatureSetByName($datastore, "CenterlinesMSD", [fullname_field, fromleft_field, toleft_field, fromright_field, toright_field], true), Buffer(geom, 5)); if (Count(intersectingRoads) == 0) return { "errorMessage": "Address Point must intersect at least one Road Centerline" } } var intersectingRoad = First(intersectingRoads); // Snap the point to the closest place along the line and find the segment it intersects and the distance along the line var data = closestPointInfo(geom, Geometry(intersectingRoad)); var closest_point = createPoint(data["coordinates"], Geometry($feature)["spatialReference"]) var results = intersectDistanceAlong(closest_point, intersectingRoad) var twoPtSegment = results[0]; var distanceAlongLine = results[1]; // Construct a new point geometry offset perpendicularly from the road var xy = offsetPoint(twoPtSegment.paths[0][0], twoPtSegment.paths[0][1], geom, dist) var newPoint = Point({ 'x' : xy[0], 'y' : xy[1], 'z' : 0, 'spatialReference' : geom.spatialReference }); // Get the new address number of the site address point based on the distance along the road and direction of the offset var percentAlong = distanceAlongLine / Length(intersectingRoad); var addrnum = getAddrNum(intersectingRoad, percentAlong, dir) // Create an array of 1 or more new site address point as specified // Store the related address point id, the calculated address number, the intersecting road name and set the status to Pending var adds = [] for(var i=0; i<numpoints; i++) { Push(adds, { 'attributes': Dictionary(id_field, id, status_field, defaultstatus, addrnum_field, addrnum, roadfullname_field, intersectingRoad[fullname_field], addrcapturemeth_field, $feature[capturemeth_field]), 'geometry': newPoint }) addrNum += increment; } // Create new site address points return { 'edit': [{ 'className': "SiteAddressesMSD", 'adds': adds }] }
... View more
05-08-2023
06:53 AM
|
0
|
6
|
509
|
POST
|
I'm having trouble with this attribute rule that used to work just fine. It seems the syntax to call a field from a variable is not working anymore. E.g. layer['zipcode'] Error is attached. Here is the rule: var zip = FeatureSetByName($datastore, 'ZipCodes', ['ZIP5'], true); var intersectLayer = Intersects(zip, Geometry($feature)); if (Count(intersectLayer) > 0) { var layer = First(intersectLayer); return layer['zipcode']; } else { return null; }
... View more
05-04-2023
01:24 PM
|
0
|
1
|
1299
|
POST
|
So are you saying that the acceptable syntax for Arcade has changed? All my attribute rules for ADMS have broken at Pro 3.1.1
... View more
05-04-2023
09:31 AM
|
0
|
0
|
1312
|
POST
|
I was using the out of the box script they provide to send emails for a while just with Windows Task Scheduler. Another alternative would be to set-up some automation using a service like "Make" which has connectors for ESRI services.
... View more
05-04-2023
09:27 AM
|
0
|
2
|
380
|
POST
|
Good to know. That would be a great enhancement since not many of my centerlines are coincident with the municipalities. Thanks!
... View more
10-18-2022
07:28 AM
|
0
|
0
|
411
|
POST
|
Anyone else having issues getting the left and right municipality attribute rule to intersect the correct municipality? The rule works as expected if I create a centerline directly on the municipal boundary, but when a centerline is created within a couple feet of the boundary, it doesn't seem to honor the offset and just selects the municipality it is currently located in. My initial reaction to this problem was to increase the offset distances and check my variables but that isn't helping me. I must be missing something. The attribute rule is attached along with some screen shots. @ChrisFox
... View more
10-14-2022
11:18 AM
|
0
|
2
|
458
|
POST
|
Exactly the answer I was hoping for. Thanks @ChrisFox
... View more
08-30-2022
03:15 PM
|
0
|
0
|
357
|
POST
|
I currently have the Citizen Problem Reporter v1.0 deployed in My Content on my organizations AGOL. I want to upgrade to the Citizen Problem Reporter v2.0 by "Deploying Now" on the ArcGIS Solutions page. So I'm wondering, what is the best practice to do that? Am I going to have any conflicts with my existing layers? Do I need to back up the CitizenProblems feature layer beforehand so I don't lose all our records? Any advice is greatly appreciated. Thanks! @ChrisFox
... View more
08-30-2022
12:44 PM
|
0
|
2
|
399
|
POST
|
Just curious, what's the benefit of going back and creating address points for all your pre-existing site addresses?
... View more
04-26-2022
10:04 AM
|
0
|
0
|
297
|
POST
|
Any chance you could share the syntax of your build_email function after implementing this?
... View more
03-28-2022
11:09 AM
|
0
|
1
|
1155
|
Title | Kudos | Posted |
---|---|---|
5 | 03-06-2024 09:55 AM | |
1 | 09-13-2023 09:10 AM | |
2 | 08-02-2023 08:26 AM | |
1 | 05-15-2019 03:06 PM | |
1 | 02-11-2020 10:50 AM |
Online Status |
Offline
|
Date Last Visited |
yesterday
|