|
POST
|
You use the Equipment field as link text. That means that you get the whole content of that field as link text, so if you have multiple equipment types, they will all be there. Do it like this: <table style="width:100%;">
<tbody>
<tr style="display:{expression/expr4}"> <td style="..."><a href="...">Boat</a> </td> </tr>
<tr style="display:{expression/expr3}"> <td style="..."><a href="...">Car</a> </td> </tr>
</tbody></table>
... View more
11-15-2021
03:07 AM
|
1
|
4
|
3322
|
|
POST
|
Something like this? // label value
var x = 11.8643
// number of subscripted digits
var digits = 1
// integer part
var x_int = Floor(x)
// decimal part
var x_dec = (x - x_int) * Pow(10, digits)
x_dec = Round(x_dec, 0)
// put it all together
return x_int + '<sub>' + x_dec + '</sub>'
... View more
11-15-2021
01:52 AM
|
2
|
1
|
2224
|
|
POST
|
Something like this? var related_records = FeatureSetByRelationshipName($feature, "MonitoringPhotoSites")
var cnt = 0
for(var rr in related_records) {
cnt += Count(Attachments(rr))
}
return cnt
... View more
11-14-2021
10:34 PM
|
1
|
1
|
5209
|
|
POST
|
Hi again! Yeah, please post the code you use. The HTML and at least one of the Arcade expressions.
... View more
11-14-2021
10:31 PM
|
0
|
1
|
3499
|
|
POST
|
The tool doesn't rotate your photos, much less only some of them. The tool takes the rotation from the photo's EXIF data. If there isn't an entry for the rotation, the field in the resulting feature class will have the value 9999. Wrongly rotated photos result from wrong entries in the EXIF data. What you can try: If you take your photos with a phone, calibrate the phone's compass. Check the phone's direction in a map app. In my experience, yo'll have to go through the photos and correct at least some of them. The rotation angle is in the field "Direction". It's a geographic angle (North = 0°, East = 90°).
... View more
11-11-2021
12:02 AM
|
0
|
0
|
1324
|
|
POST
|
The code seems to be OK, no idea why it would throw that error. Maybe try this: create and publish a feature class with that polygon use Intersects: var aoi = FeatureSetByName($datastore, "AoiPolygonFC", ["*"], true)
var gauges_in_aoi = Intersects(aoi, $layer)
Count(gauges_in_aoi) Personally, I would use a definition query on the layer, so only "your" gauges are shown to begin with. Get the STATION attributes of the gauges in your aoi, construct the SQL as STATION IN ('US04229500', 'NWSCOSN6', 'US01187300', ...) and use that to filter your layer. Manually, that would be lots of work (and error prone). If you have access to ArcMap/ArcGIS Pro, it's easy: Load the gauge layer, select your gauges, edit and run this code in the python window: cursor = arcpy.da.SearchCursor("Gauge_Layer", ["STATION"])
stations = [row[0] for row in cursor]
print("STATION IN ('{}')".format("', '".join(stations)))
... View more
11-09-2021
11:49 PM
|
1
|
1
|
5019
|
|
POST
|
geometry_layer_name = "name_of_the_layer_with_the_right_geometry"
attribute_layer_name = "name_of_the_layer_with_attributes_and_wrong_geometry"
common_field = "name_of_the_common_field"
# this will change the geometry of the second layer's underlying data, so back it up!
active_map = arcpy.mp.ArcGISProject("current").activeMap
geometry_layer = active_map.listLayers(geometry_layer_name)[0]
attribute_layer = active_map.listLayers(attribute_layer_name)[0]
# read the correct geometries and save them in a dictionary
# {common_field_value: shape}
cursor = arcpy.da.SearchCursor(geometry_layer, [common_field, "SHAPE@"])
shapes = dict([row for row in cursor])
# loop through the second layer and update the geometries
updated_features = []
with arcpy.da.UpdateCursor(attribute_layer, [common_field, "SHAPE@"]) as cursor:
for row in cursor:
try:
new_shape = shapes[row[0]]
# only update if the geometry is different, fill the updated_features list
if not new_shape.equals(row[1]):
cursor.updateRow([row[0], new_shape])
updated_features.append(row[0])
except KeyError:
print("No new geometry found for feature with {} = {}".format(common_field, row[0]))
# build an SQL query of the updated_features, depending on whether common_field is a text field or not
if updated_features and isinstance(updated_features[0], str):
sql = "{} IN ('{}')".format(common_field, "', '".join(updated_features))
else:
sql = "{} IN ({})".format(common_field, ", ".join([str(uf) for uf in updated_features]))
# print the SQL query
print("Updated the geometry of {} features:\n{}".format(len(updated_features), sql))
... View more
11-09-2021
07:47 AM
|
2
|
2
|
6966
|
|
POST
|
If you know the query names, you can do something like this: def change_definition_query(layer, query_name):
"""Changes the definition query of a layer in ArcGIS Pro.
layer: arcpy.mp.Layer object, the layer that the query will be assigned to
query_name: str, the name of the query that is assigned to the layer
The query has to exist in the layer. If it doesn't, this function throws a ValueError.
Calling this function with query_name=None will remove the active query.
"""
cim = lyr.getDefinition('V2')
query = None
if query_name is not None:
queries = cim.featureTable.definitionFilterChoices
try:
query = {q.name: q.definitionExpression for q in queries}[query_name]
except KeyError:
raise ValueError("Query '{}' not found!".format(query_name)) from None
cim.featureTable.definitionExpression = query
cim.featureTable.definitionExpressionName = query_name
layer.setDefinition(cim)
lyr = arcpy.mp.ArcGISProject("current").activeMap.listLayers("Layer")[0]
change_definition_query(lyr, "Query 1")
change_definition_query(lyr, "DistanceNotNull")
change_definition_query(lyr, None)
change_definition_query(lyr, "ThisWillThrowAnError")
... View more
11-08-2021
11:38 PM
|
1
|
1
|
2193
|
|
POST
|
Try building the overviews and/or pyramids: arcpy.management.AddRastersToMosaicDataset(
mosaic,
"Raster Dataset",
image_path,
update_overviews=True,
build_pyramids=True
)
... View more
11-08-2021
10:52 PM
|
0
|
0
|
1906
|
|
POST
|
Problem is probably in line 43: var intersecting_lines = Intersects(line_fs, start_point); What this code does (in a very general way) is this: get the lines that intersect the start point of $feature request edits to be made on those lines for each of those lines, goto 1 But intersecting the start point of $feature with the lines also finds $feature, so you're editing $feature and request edits to be made to $feature and it just cycles endlessly (or it would, but ArcGIS stops it). Try adding this after line 43: var gid = $feature.GlobalID
intersecting_lines = Filter(intersecting_lines, "GlobalID <> @gid")) This will remove $feature from the edited lines.
... View more
11-08-2021
10:28 PM
|
0
|
0
|
1632
|
|
POST
|
We'd gladly help you, but we need to see the actual code you used for that. Please post that:
... View more
11-07-2021
10:10 PM
|
1
|
0
|
1661
|
|
POST
|
AFAIK, it's not possible with labels directly. I would do it with Feature Binning. This way, your points get aggregated into polygons dynamically when you zoom out: If you don't like the polygons, you can style them to show a point marker in their center, so that it looks like a point layer. And then you just use the calculated mean of the polygons as labels.
... View more
11-05-2021
12:10 AM
|
0
|
0
|
1474
|
|
POST
|
function closest_feature(test_feature, compare_feature_set) {
var min_distance = 9999999
var closest_feature = null
for(var f in compare_feature_set) {
var d = Distance(test_feature, f)
if(d < min_distance) {
min_distance = d
closest_feature = f
}
}
return closest_feature
}
var roads = FeatureSetByName($datastore, "RoadFeatureclass", ["RoadID"], true)
var waterway_buffer = Buffer($feature, 100, "kilometers")
var close_roads = Intersects(roads, waterway_buffer)
var closest_road = closest_feature($feature, close_roads)
if(closest_road != null) {
return closest_road.RoadID
}
return null
... View more
11-02-2021
12:30 AM
|
2
|
0
|
1969
|
|
POST
|
According to the documentation of the attribute rule dicitonary keywords , the "result" field in the returned dictionary is either a value for the field definied as return field for the rule a dicitionary for the geometry and/or attributes of the feature, if you haven't set a return field in the rule You return a log message. If you haven't set a text field as output field of the rule, this should throw an error. The ObjectID in the update array should be given in the dictionary field "objectID", not "OBJECTID", don't know if this would cause an error, though. So, try this: //s1 - get all the features from sewer upgrades feature class
// you only need DBNUMBER (to filter) and OBJECTID (to send edits)
var destination = FeatureSetByName($datastore, "GEO_DB.ENG_SD.SewerUpgrade", ["DBNUMBER","OBJECTID"], false);
//s2 - get dbnumber edited in the projects developments feature class
var dbnumber = $feature.DBNUMBER;
//s3 - filter feature based on the existing edit
var match = Filter(destination, "DBNUMBER = @dbnumber");
//s4 - update records in sewer upgrades
var sewerupgradelist = [];
var counter = 0;
for (var feature in match) {
sewerupgradelist[counter] = {
'objectID' : feature.OBJECTID,
'attributes' : {
'CONS_ST' : $feature.CONS_ST,
'CONS_ED' : $feature.CONS_ED,
'EST_CON_DUR' : $feature.EST_CONS_DUR,
'TECH_REV' : $feature.TECH_REV,
'STATUS' : $feature.STATUS
}
}
counter++
}
return {
// only use this if you have set a text field as return field for the rule
// 'result' : numfeatures + ' sewer upgrades features found.',
'edit' : [{
'className' : "GEO_DB.ENG_SD.SewerUpgrade",
'updates' : sewerupgradelist
}]
}
... View more
10-31-2021
11:33 PM
|
2
|
1
|
2245
|
|
POST
|
var attach = Attachments($feature)
if(Count(attach) == 0) {
return "no attachments"
}
var Part1 = "https://services8.arcgis.com/OxmrsInax8iIPqdy/arcgis/rest/services/Civils_Data_Collection/FeatureSer..."
var ObjectID = $feature.OBJECTID
var Part2 = "/attachments/"
var AttachID = First(attach).ID
var Token = "?token=I HAVE REMOVED THIS.
return Part1 + ObjectID + Part2 + AttachID + Token
... View more
10-29-2021
05:28 AM
|
3
|
2
|
3086
|
| 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
|