|
POST
|
sys.argv is used to call scripts from command line, right? I have absolutely no experience with that. The script above is supposed to be executed in the ArcGIS Pro Python window.
... View more
07-04-2023
11:57 AM
|
0
|
0
|
6868
|
|
POST
|
layer_names has to be a list (or other collection type). My guess is that sys.argv[1] is a string, which the script iterates through, taking each letter as layer name. listLayers("a") returns an empty list, and then it correctly raises the IndexError when you try to access the first element of that empty list.
... View more
07-04-2023
09:41 AM
|
0
|
2
|
6875
|
|
POST
|
There is no class Layer in arcgis.mapping . Here are some classes that could be what you want: for x in arcgis.mapping.__dict__.keys():
print(x) ...
MapImageLayer
MapImageLayerManager
...
VectorTileLayer
...
Object3DLayer
IntegratedMeshLayer
Point3DLayer
VoxelLayer
PointCloudLayer
BuildingLayer
SceneLayer
...
MapServiceLayer
MapFeatureLayer
MapTable
MapRasterLayer
... It's also possible that you actually want arcpy.mp.Layer ...
... View more
07-04-2023
06:30 AM
|
0
|
0
|
2276
|
|
POST
|
Field Calculator, switch to Arcade. Edit the last line to return the X or Y coordinate. function sort_by_y (p1, p2) {
return p1.Y < p2.Y
}
var vertices = Geometry($feature).rings[0]
var v_YMax = First(Sort(vertices, sort_by_y))
return v_YMax.X
... View more
07-04-2023
04:22 AM
|
1
|
0
|
1569
|
|
POST
|
This is a difference in conventions between programming and mathematics and is completely expected behavior. In many (if not most) programming languages, log(x) calculates the natural logarithm (base e). This is also described in the respective documentations. For example: log in Arcade log in Python log in Javascript log in Java log in C++ etc...
... View more
07-04-2023
04:12 AM
|
1
|
0
|
26729
|
|
POST
|
matchingFeatures is a Featureset, a collection of Features. While it would be cool to access the Features by their index, that's not how it works. You can get the First() feature, though. var classesTable = FeatureSetByName($map, 'Rose Classes')
var currentClass = $feature.Class
var matchingFeature = First(Filter(classesTable, 'Class = @currentClass'))
return IIf(matchingFeature == null, '', matchingFeature.Description)
... View more
07-03-2023
03:13 AM
|
2
|
0
|
7263
|
|
POST
|
Option 1: Select the point, switch the map's display coordinate system to DMS, get the coordinates from the geometry tab in the attribute pane: Option 2: Calculate Geometry Attributes, this will store the coordinates in the feature class. The result is static, if you move the point, the calculated coordinates won't change until you repeat the process.
... View more
07-02-2023
02:31 AM
|
1
|
0
|
3365
|
|
POST
|
I'm not at all sure I understand your data structure... Here's what I imagine from your description: Survey_Locations probably contains the actual survey results. Route_Data contains high-level attributes of the current survey. 1-m relationship with Survey_Locations, meaning one route can have many survey locations. Call_Point_Data contains fixed (?) points along the route where you take surveys (?), but here you only store meta data (time, bearing). 1-m relationship with Survey_Locations, meaning that one call point can have many survey locations (?) You explained Route_Data and Call_Point_Data. These seem like what you're interested in. What's the deal with Survey_Locations? Are they the actual survey results at a call point? Are the call points fixed for multiple survey on the same route? An extract of your actual data would be helpful, either here or in a pm. Assuming you want to implement the Attribute Rule on Survey_Locations: // Calculation Attribute Rule on Survey_Locations
// field: empty
// triggers: Insert
// exclude from application evaluation
// get the related route
var route = First(FeaturesetByRelationshipName($feature, "SurveyLocations_Routes"))
if(route == null) { return }
// get the related call points
var call_points = FeaturesetByRelationshipName($feature, "SurveyLocations_CallPoints")
// create and fill an array that contains the updates to be made to Call_Points
var updates = []
for(var c in call_points) {
var update = {
globalID: c.GlobalID, // alternatively: objectID: c.OBJECTID
attributes: {
RouteAttribute1: route.RouteAttribute1,
RouteAttribute2: route.RouteAttribute2,
}
Push(updates, update)
}
// return the edit instruction
return {
edit: [{
className: "SPOW_Call_point_Data",
updates: updates
}]
}
... View more
07-02-2023
01:52 AM
|
0
|
0
|
1209
|
|
POST
|
If you use the new Map Viewer, you can use the Arcade Element. Here, you can return HTML that gets interpreted by the popup (as opposed to an Arcade Expression, where HTML won't get interpreted). Really simple: var fs = ...
var candidates = []
for(var f in fs) {
var c = `<strong>${f.Candidate_Name}</strong><br/>Phone: ${f.Phone_Number}<br/>Address: ${f.Address}`
Push(candidates, c)
}
return {
type : 'text',
text : Concatenate(candidates, '<br/><br/>')
} Align phone and address, using a table: var c = `<strong>${f.Candidate_Name}</strong><table><tr><td>Phone:</td><td>${f.Phone_Number}</td></tr><tr><td>Address</td><td>${f.Address}</td></tr></table>` Using symbols: var person_icon = "https://example.com/person.png"
var phone_icon = "https://example.com/phone.png"
var address_icon = "https://example.com/address.png"
//...
var c = `<table>
<tr><td><img src="${person_icon}" height=16></td><td><strong>${f.Candidate_Name}</strong></td></tr>
<tr><td><img src="${phone_icon}" height=16></td><td>${f.Phone_Number}</td></tr>
<tr><td><img src="${address_icon}" height=16></td><td>${f.Address}</td></tr>
</table>`
... View more
07-02-2023
12:45 AM
|
1
|
1
|
3108
|
|
POST
|
Yes, or will create a copy, of the whole project. It shouldn't take up too much space, because it doesn't copy the tater data. As I said, you can also use the aprx.save() method, but only if you don't have that project open.
... View more
06-17-2023
04:02 AM
|
0
|
0
|
4280
|
|
POST
|
You can use images from a blob field. Either add them as attachments and John the attachment table or do it with the script in this question. Then follow the instructions to use the field for symbolization. https://community.esri.com/t5/arcgis-pro-questions/can-you-import-multiple-geocoded-png-files-as/td-p/1117667
... View more
06-17-2023
03:52 AM
|
0
|
0
|
1074
|
|
BLOG
|
YES! Thus ends my personal crusade against that particular irksome problem. Now to make working with Featuresets more performant 🙂 @jcarlson , your workaround from these excellent blogs is finally no longer necessary...
... View more
06-15-2023
07:22 AM
|
3
|
0
|
5182
|
|
POST
|
var diff = DateDiff(Today(), $feature.Field, "days")
var overdue = diff > 28
diff = diff % 28 // modulo operation: divide by 28 and take the rest
var period = When(
diff > 20, "Last 8 days",
diff > 17, "First 20 days",
diff > 12, "First 17 days",
"First 12 days"
)
return period + IIf(overdue, " (overdue)", "")
... View more
06-15-2023
07:03 AM
|
1
|
1
|
1690
|
|
POST
|
I implemented this functionality in a Toolbox: https://community.esri.com/t5/arcgis-pro-questions/create-bookmarks-from-features/m-p/1299420
... View more
06-14-2023
02:17 PM
|
0
|
0
|
1940
|
|
POST
|
I implemented this functionality in a Toolbox: https://community.esri.com/t5/arcgis-pro-questions/create-bookmarks-from-features/m-p/1299420
... View more
06-14-2023
02:17 PM
|
2
|
1
|
3614
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-30-2023 09:57 AM | |
| 1 | 05-18-2023 12:51 AM | |
| 1 | 03-05-2023 12:46 PM | |
| 1 | 12-07-2022 07:01 AM | |
| 1 | 06-21-2022 08:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-03-2024
06:14 PM
|