|
POST
|
While you can delete features with Arcade, doing so in the Field Calculator is complicated. If you want to build a model, you can do this easily with the available ArcGIS Tools: In the Select Layer By Attribute tool, use this SQL expression (this works for a file gdb, you might need a different expression if you work in an enterprise gdb): TextField = 'Completed' AND DateField < CURRENT_DATE() - 30
... View more
01-20-2023
12:07 AM
|
1
|
0
|
2402
|
|
POST
|
If you hover over the red square on the left, it will tell you what's wrong. In this case, it will probably tell you that you have to check the "Exclude from application evaluation" checkbox.
... View more
01-19-2023
04:16 AM
|
0
|
0
|
5073
|
|
POST
|
Yes, that is expected. You told the rule that you want to calculate the feature's geometry, but then you did not return a geometry. Leave the field empty.
... View more
01-19-2023
02:57 AM
|
0
|
0
|
5104
|
|
POST
|
The buffer is a polygon, so you have to write it into a polygon feature class (Line 4). Leave the field empty. Just so we talk about the same thing: The rule will take your new line, create a 5 meter buffer around it and write that buffer into a polygon feature class. So you will have the line feature class with the line features and a polygon feature class with the buffers. Is that what you're trying to do?
... View more
01-19-2023
02:54 AM
|
0
|
0
|
5106
|
|
POST
|
OK. You could do something like this: // Calculation Attribute Rule on the WaterLine feature class
// field: leave empty
// triggers: Insert
// Exclude from Application Evaluation
// If the new feature is not a water main, abort
if($feature.SubtypeField != "Water Main") { return }
// load all laterals
var laterals = Filter($featureset, "SubtypeField = 'Service'")
// load the valves
var valves = FeaturesetByName($datastore, "NameOfTheValveFeatureclass")
// get the new feature's end point
var end_point = Geometry($feature).paths[-1][-1]
// if the new feature doesn't end at a valve, abort
var valves_at_end_point = Intersects(valves, end_point)
var valve = First(valves_at_end_point)
if(valve == null) { return }
// if there already exists a lateral at the valve, abort
var laterals_at_valve = Intersects(laterals, valve)
if(First(laterals_at_valve) != null) { return }
// get the angle of the new feature at the valve
var waterline_clip = Clip($feature, Extent(Buffer(valve, 0.1)))
var wcp = waterline_clip.paths
var waterline_angle = Angle(wcp[0][0], wcp[-1][-1]) * PI / 180
// calculate the geometry of the lateral line
var lateral_length = 2
var lateral_start = Geometry(valve)
var lateral_end = Point({
x: lateral_start.x + lateral_length * cos(waterline_angle),
y: lateral_start.y + lateral_length * sin(waterline_angle),
spatialReference: lateral_start.spatialReference
})
var lateral_geometry = Polyline({
paths: [[
[lateral_start.x, lateral_start.y],
[lateral_end.x, lateral_end.y],
]],
spatialReference: lateral_start.spatialReference
})
// save the lateral and the plug
return {
edit: [
{
className: "NameOfThePlugFeatureclass",
adds: [{geometry: lateral_end, attributes: {SubtypeField: "Plug"}}]
},
{
className: "WaterLine",
adds: [{geometry: lateral_geometry, attributes: {SubtypeField: "Service"}}]
}
]
} You have to supply the correct names of the feature classes, field names and subtypes in lines 7, 10, 13, 52, 53, 56, 57. Line 33: This creates a 2 meter lateral in my test feature class. Try it with your data, maybe it works correctly there. Else you have to replace that with the metric value (2 feet = 0,6096 meters)
... View more
01-19-2023
02:46 AM
|
2
|
1
|
2376
|
|
POST
|
The most basic form: // Calculation attribute rule on the line fc
// field: empty
// triggers: insert
// exclude from application evaluation
var buffer_polygon = Buffer($feature, 10, "meters")
return {
edit: [{
className: "NameOfThePolygonFC",
adds: [{geometry: buffer_polygon}]
}]
} This makes use of the Attribute rule dictionary keywords—ArcGIS Pro | Documentation to edit another feature class. specify the size of the buffer too in either an area or % terms The "normal" way to define a buffer is by buffer distance ("10 meters on either side of this feature"). What do you mean with "area" and "percent"?
... View more
01-19-2023
01:08 AM
|
0
|
4
|
5152
|
|
POST
|
Create Mosaic datasets for each year, load them all into the map, switch them all off. Navigate to your area of interest, switch on the layer of the year you're interested in.
... View more
01-18-2023
11:45 PM
|
0
|
1
|
1602
|
|
POST
|
Take a look at the Experience Builder. I made this quick (and ugly) example in 5 minutes: So basically, use a Section widget. For each app you want to include, make a new View in the section widget adn create an Embed widget pointing to the app's URL. Create the top bar using a Row widget, insert a Text widget for the tile, and a View Navigation widget for switching between the apps.
... View more
01-18-2023
11:35 PM
|
0
|
3
|
2810
|
|
POST
|
Is it not possible for HTML tags to retain formatting when conditional expressions are added to it? The CSS display attribute has many possible values. Take a look: CSS display property (w3schools.com) It's important to choose the right one. You are using block. This basically displays the element as though it were a paragaph (<p> tag), which probably messes with the formatting. Try to use "display: table;" for the table conditional "display: table-row" for the tr conditional Is there a limitation for dashboards to not respect HTML formatting for conditional expressions? There are some limitations for what you can do with HTML in ArcGIS products. But this doesn't seem like one of them. why does formatting seem to be respected (at least in map viewer) when the conditional expression is added to the overall table (<table> tag), but not when it's added to individual rows of a table (<td> tag)? Rendering HTML and CSS is a tricky thing. Every browser does it a little differently, and as you discovered, even apllications from the same vendor can handle it differently. For us non-web-developers, these corner cases often come down to trial and error.
... View more
01-18-2023
10:57 PM
|
1
|
1
|
3140
|
|
POST
|
In line 12, you need to use the route field (the value that is already in the table, not the concatenated value you are calculating). You changed the variable name to routename, use that in line 13, too! As Mike said, Count gives an error for null. Try replacing line 1 with this (this is the same null check that we already do for the week): var prefix = IIf(
IsEmpty($feature.CASTERBOXCARDBOARD_PREFIX),
"",
$feature.CASTERBOXCARDBOARD_PREFIX
)
... View more
01-18-2023
10:57 AM
|
0
|
1
|
3366
|
|
POST
|
Try Touches(). Can't test right now, but something like this could work: // load polygons
var polygons = FeaturesetByName(...)
// get intersecting polygons
var i_polygons = Intersects(polygons, $feature)
// return 1 at the first touching polygon
for(var i_poly in i_polygons) {
if(Touches(i_poly, $feature)) { return 1}
}
// else return 0
return 0
... View more
01-18-2023
10:48 AM
|
1
|
1
|
2365
|
|
POST
|
Hmmm. I tested the rule again, and it works for me. Are you sure that the field "HWDataCollectionPoints.ElectoralArea" is editable? Can you send me the two feature classes (export them into a new gdb or as shapefiles), either here or in a private message?
... View more
01-18-2023
04:52 AM
|
0
|
0
|
2219
|
|
POST
|
Yeah, change lines 1, 2, 3, and 30 (if you want to export to a different format). Copy paste into the Pro Python window, execute. You should be able to run that as a standalone script outside of Pro. For that, use the project path in line 6 instead of "current". I haven't tested that, though.
... View more
01-18-2023
04:42 AM
|
1
|
0
|
2034
|
|
POST
|
Interesting behavior, also reproducable in ArcGIS Pro. To solve it, you can set the default value in getParameterInfo() and do the glob() in updateParameters(): import os, glob
class DEFileTest(object):
label="DEFileTest"
description="DEFileTest"
def getParameterInfo(self):
parameters = [
arcpy.Parameter(name="in_file", displayName="In File", datatype="DEFile", parameterType="Required", direction="Input"),
]
parameters[0].value = "N:/.../temp/test.txt"
return parameters
def updateParameters(self, parameters):
par = {p.name: p for p in parameters}
if par["in_file"].value is None or not os.path.exists(str(par["in_file"].value)):
b = glob.glob("N:/.../temp/*.txt")
try:
par["in_file"].value = b[0]
except IndexError:
par["in_file"].value = None
def execute(self, parameters, messages):
par = {p.name: p for p in parameters}
arcpy.AddMessage("I'm working on " + str(par["in_file"].value))
... View more
01-18-2023
04:38 AM
|
2
|
0
|
1412
|
|
POST
|
You can do that with a little Python. A quick-and-dirty approach: layout_name = "Layout"
locked_layers = ["World_Imagery"] # these layers will not change visibility
export_folder = "N:/.../temp"
# get the layout, its map frame, and its legend
aprx = arcpy.mp.ArcGISProject("current")
layout = aprx.listLayouts(layout_name)[0]
mapframe = layout.listElements("MAPFRAME_ELEMENT")[0]
legend = layout.listElements("LEGEND_ELEMENT")[0]
# get the layers
layers = [
layer
for layer in mapframe.map.listLayers()
if layer.name not in locked_layers
and layer.supports("visible")
and layer.name == layer.longName
]
# for each layer
for layer in layers:
print(f"Exporting layer {layer.name}")
# make all layers invisible
for other_layer in layers:
other_layer.visible = False
# make the layer visible
layer.visible = True
# change the legend title
legend.title = layer.name
# export the layout
layout.exportToPNG(f"{export_folder}/Export_Layer_{layer.name}.png")
... View more
01-18-2023
04:13 AM
|
1
|
0
|
2039
|
| 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
|