|
POST
|
It's telling you that it can't find "valuecopied". Change line 26 to "Subdivision": intersected_feature[intersecting_field]
... View more
05-03-2022
04:15 AM
|
1
|
1
|
2385
|
|
POST
|
There are 2 ways to do this. You can have the condition in the Arcade expression: if($feature.Shape_Area > 300000) {
return $feature.OBJECTID
}
// if $feature.Shape_Area doesn't work, you can also try Area($feature) Or you can have the condition as SQL statement, making the expression very simple: return $feature.OBJECTID
... View more
04-29-2022
02:19 AM
|
0
|
0
|
2421
|
|
POST
|
To make your expression easier to read, you can also use Concatenate: var values = [
$feature.Well_Name,
$feature.Max_MD,
Text($feature.Spud_Date, 'M/D/Y')
]
return Concatenate(values, TextFormatting.NewLine) // each on its own line
return Concatenate(values, ", ") // comma separated
... View more
04-29-2022
02:06 AM
|
1
|
0
|
1547
|
|
POST
|
Huh, weird, these snippets worked for me. But my test feature classes are in a file gdb, maybe that makes a difference, who knows... Glad you got it to work with the buffer!
... View more
04-28-2022
01:49 AM
|
0
|
1
|
1832
|
|
POST
|
Annotation features seem to be treated as polygons. So when you try to just copy the geometry to a point fc, it throws an error. Depending on where you want the point to show up, you have a few options: Centroid(featureGeo), this will place the point in the center of the annotation featureGeo.rings[0][1], this will place the point at the bottom left corner of the annotation featureGeo.ring[0][X], where X is 0, 2 or 3, this will place the point at one of the other corners
... View more
04-27-2022
10:51 PM
|
2
|
1
|
1839
|
|
POST
|
Ich versuche gerade, eine Fließweganalyse mit Hilfe des Tools Spartial Analyst Tools / Hydrologie durchzuführen. Jedoch verstehe ich nicht, welche Daten ich hierzu als Grundlage nehmen sollte und was bei Durchführung der Tools für Einheiten rauskommen. Hier gibt es einen guten Überblick: Überblick über das Toolset "Hydrologie"—Hilfe | ArcGIS for Desktop, v.a. der Punkt "Konzepte des Toolsets Hydrologie". Allgemeiner Ablauf einer hydrologischen Analyse: Grundlage ist ein Digitales Geländemodell (DGM, englisch "digital elevation model / dem"), also ein Raster von geodätischen Höhen der Geländeoberfläche In diesem Raster werden verrohrte Strecken (Straßendurchlässe, Brücken, Kanalisation) nicht abgebildet. Um reale Fließverhältnisse abbilden zu können, musst du das DGM deshalb aufbereiten, bzw. "konditionieren". Unter den Suchbegriffen "digital elevation model conditioning" und "stream burning" findest du nähere Angaben. Das DGM hat durch Messfehler und Artefakte oft Senken (Bereiche die niedriger als alle umliegenden Bereiche), die nirgendwo hin entwässern können. Dadurch wird die Bestimmung von Einzugsgebieten erschwert. Mit dem Tool Sink kannst du diese Senken anzeigen, mit dem Tool Fill kannst du sie bereinigen. Mit dem Tool Flow Direction erstellst du ein Raster der Fließrichtungen aus dem bereinigten DGM. Die ausgegebenen Werte haben keine Einheit, sondern geben direkt die Richtung an, in die das Wasser aus einer Zelle abfließt (berechnet aus der Höhe der Zelle und den Höhen der Nachbarzellen): Mit dem Tool Flow Accumulation ermittelst du Fließwege aus dem Fließrichtungsraster. Die ausgegebenen Werte sind die Anzahl der Zellen, die in die jeweilige Zelle entwässern, also oberstrom liegen. Je höher dieser Wert ist, umso wahrscheinlicher handelt es sich um Abfluss in einem Gerinne, niedrigere Werte sind Oberflächenabfluss. Der "genaue" Grenzwert ist abhängig von diversen Faktoren (z.B. Klima, Geländeneigung, Bodeneigenschaften, horizontale Rasterauflösung, vertikaler Messfehler) und muss experimentell (z.B. durch Abgleich von Raster und Luftbildern oder Schummerung) ermittelt werden. Persönlich habe ich das immer "frei Schnauze" gemacht, es gibt aber wahrscheinlich auch wissenschaftliche Literatur dazu. Die Richtungs- und Akkumulationsraster dienen dann als Inputs für verschiedene Analysen, z.B. Bestimmung von Abfluss- und Einzugsgebieten oder Wasserlaufordnung nach Strahler/Shreve.
... View more
04-27-2022
03:59 AM
|
0
|
0
|
1684
|
|
POST
|
Sorry, I don't know how to do this in ModelBuilder. Try running the script in the Python Window first, that makes it easier to troubleshoot.
... View more
04-27-2022
12:15 AM
|
1
|
0
|
3976
|
|
POST
|
import re
def extract_number(txt):
numbers = re.findall(r"\d+", txt)
if not numbers:
return None
return numbers[0]
... View more
04-26-2022
11:57 PM
|
2
|
0
|
7353
|
|
POST
|
What am I doing wrong? Remove the commas inside the CLR tag. the colors are backward I don't know your data structure, but from the screenshot it seems to be correct? The purple asset has an AssetID (1295), so it shows as green text. The yellow assets have AssetID "PRVT", so the labels are purple. Maybe try using the actual field values instead of the DomainName.
... View more
04-26-2022
11:44 PM
|
1
|
1
|
2671
|
|
POST
|
The filter query is OK. But you are right, the problem is related to the filter query and yes, something is null somewhere. This is probably caused by null values in $feature.GUID. When you execute this expression for a feature whose GUID is not in RelatedTable.GlobalID (but not null), Filter() returns an empty feature set, which is the reason for the empty check before accessing the First() element (better way in the code below). When you execute the expression for a feature whose GUID is null, Filter() returns null and the expression fails on anything using that result, e.g. Count() or First(). So you just need another check at the top of the expression: var ref_guid= $feature.GUID
if(ref_guid == null) {
// there can be no related features
return null
}
var wells_fs=FeatureSetByName($map,"Wellsites2")
var wells_filter = Filter(wells_fs, "GlobalID = @ref_guid")
var well = First(wells_filter)
if(well == null) {
// wells_filter is empty, no related features found
return null
}
return well.name
... View more
04-26-2022
11:12 PM
|
0
|
0
|
6723
|
|
POST
|
You're missing a step. You return the first entry of the filtered feature set, which is the first inspection for that asset. What you want to do: load the feature set and filter it sort the related features by date, descending return the first feature //Foreign key in child table
var fk = $feature.GUID
//Load all inspections of the feature
var inspections = FeatureSetByName($datastore, "CHILD_TABLE_NAME",['GUID'],false)
var related_inspections = Filter(inspections, 'GUID = @fk')
// (if you have a relationship class, you can also do it like this)
var related_inspections = FeatureSetByRelationshipName($feature, "RelationshipName", ["GUID"], false)
// (also, you have a trigger on delete. if you delete an inspection, it will
// still be in the table when the rule is executed, so you should filter it out:)
if($editcontext.editType == "DELETE") {
var pk = $feature.PrimaryKeyOfChildTable
related_inspections = Filter(related_inspections, "PrimaryKeyOfChildTable <> @pk")
}
//Filter the most recent inspection date of the feature
var last_inspection = First(OrderBy(related_inspections, "DATE_INSPECTION DESC"))
... View more
04-26-2022
02:41 AM
|
2
|
3
|
3727
|
|
POST
|
Basic structure: def get_gdb_feature_count(gdb_path):
# set workspace to gdb
prev_ws = arcpy.env.workspace
arcpy.env.workspace = gdb_path
# list all feature classes and tables in workspace
fcs_and_tbls = arcpy.ListFeatureClasses() + arcpy.ListTables()
# GetCount() on all of these
counts = [int(arcpy.management.GetCount(ft)[0]) for ft in fcs_and_tbls]
# revert workspace
arcpy.env.workspace = prev_ws
# return [ ["TableName", count] ]
return zip(fcs_and_tbls, counts)
csv_path = "path:/to/your/csv_file.csv"
result = get_gdb_feature_count("path:/to/your/gdb")
with open(csv_path, "w") as f:
f.write("Name,Count\n")
for r in result:
f.write(f"{r[0]},{r[1]}\n")
... View more
04-25-2022
02:38 AM
|
1
|
0
|
3999
|
|
POST
|
Sorry it took so long to answer, I was on vacation... If you haven't found a soultion yet: It's probably because you used backslashes instead of forward slashes in your paths. Single backslashes are special characters in Python strings, they are used to encode characters that you can't simply type, e.g. "\n" for a linebreak. Use one of these methods: # forward slashes
"path:/to/your/fc"
# double backslashes
"path:\\to\\your\\fc"
# define it as raw string
r"path:\to\your\fc"
... View more
04-25-2022
01:43 AM
|
0
|
2
|
5703
|
|
POST
|
Hmmm... Sadly, I have no idea what could cause that error. I have only tested my expression in the Arcade Playground, maybe there's some hickups when you involve actual data. You should probably stick to Josh's answer. Is trying to use "$feature" on a standalone table an issue (i.e., does the data source have to be a feature layer)? No, $feature and FeatureSetBy*() work on non-feature-class tables, too.
... View more
04-08-2022
12:56 AM
|
0
|
0
|
8751
|
| 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
|