|
IDEA
|
ObjectID and GlobalID are used for database internal processes and can't be edited using ArcGIS (maybe with your database's management software, but I'm not sure about that and I strongly suggest not trying it, as it might corrupt your database). For your use cases, the easiest solution might be to create a new GUID or Text field in your table and change the value of that field with Attribute Rules. For example, your distance use case can be solved like this: if(IsEmpty($feature.GuidField)) {
return GUID()
}
if(Distance($feature, $originalfeature) > 100) {
return GUID()
}
return $feature.GuidField Be aware that any relationships built on that field will be lost when its value changes!
... View more
11-02-2022
01:18 AM
|
0
|
0
|
1135
|
|
POST
|
Using Calculate Field in a Python script is a little tricky. As already said, you have to enclose field names with exclamation marks. What @dgiersz_cuyahoga did in his answer but didn't actually say: You have to supply the expression as a string. Your expression is (almost) correct when you use it in the Python window. For it to work in the tool, you have to turn it into a string. Just surround it with quotes (the type you didn't use in the expression, or triple quotes): # this works in a Python console, assuming LINKID is a defined variable
'https://msc.fema.gov/portal/downloadProduct?productID=' + str(LINKID)
# or with newer syntax
f'https://msc.fema.gov/portal/downloadProduct?productID={LINKID}'
# for Calculate field, you have to supply the expression as string
"'https://msc.fema.gov/portal/downloadProduct?productID=' + str(!LINKID!)"
"f'https://msc.fema.gov/portal/downloadProduct?productID={!LINKID!}'"
... View more
11-02-2022
12:42 AM
|
1
|
1
|
4837
|
|
POST
|
First thing that comes to mind: You have to use the actual field names, not the aliases. If you have spaces in lines 15-18, you're using aliases. If that doesn't solve it, please post your code and a screenshot of the field view of your feature class.
... View more
11-02-2022
12:21 AM
|
0
|
0
|
2936
|
|
POST
|
Seems like you have empty attachments. Are there entries with DATA_SIZE = 0 ? Try to include a where clause in the cursor: with da.SearchCursor(inTable, ["DATA", "ATT_NAME"], "DATA IS NOT NULL") as cursor:
#...
... View more
11-01-2022
07:11 AM
|
2
|
2
|
3769
|
|
POST
|
Instead of getting the first row of the filtered featureset, you need a second for loop: // Populate feature array
for (var site in sites) {
var id = site.siteID
// get all samples for this site, ordered by date
var samples = OrderBy(Filter(fs, 'siteID = @ID'), 'sampleDate DESC')
var i = 0
var prevDate
// loop through the samples
for(var sample in samples) {
// abort after second feature
i += 1
if(i > 2) { break }
// abort if second feature has different date
if(i == 2 && Text(sample.sampleDate, 'Y-MM-DD') != Text(prevDate, 'Y-MM-DD')) { break }
// store date
prevDate = sample.sampleDate
// create the new feature and push it into the output fs
var feat = {
'attributes': {
//...
}}
Push(dowDict.features, feat);
}
};
... View more
11-01-2022
04:36 AM
|
1
|
1
|
3031
|
|
POST
|
It's probably your symbology. Let's take BC_1 = 'CI20' as example. The pink areas are polygons from the shapefile that aren't covered by your symbology: These features are still in the layer, you can select them in the table and with Select Layer by Attribute, but they are not drawn on the map, so you can't select them with the selection tool and you can't see the selection outline and flash. If you load the shapefile (not the layers) into the map, you can select normally. This compares selecting in your layers and the "pure" shapefile. Without symbology, all 30 features are selected: The problem are the GS seasons. The old shapefile lists these seasons as "GS 01", "GS 02", etc. You changed that to be consistent with the DS seasons. Now, they are called "GS_01", "GS_02", etc. You forgot to change the symbology. It doesn't draw the GS seasons earlier than GS_20, because it looks for spaces, but they are now stored with underscores:
... View more
11-01-2022
03:11 AM
|
0
|
1
|
4824
|
|
POST
|
// Calculation attribute rule on the line fc
// triggers: Insert, Update
// Field: empty
// get the $feature's geometry
var geom = Geometry($feature)
// null geometry -> abort
if(geom == null) { return }
// get start and end point
var p_start = geom.paths[0][0]
var p_end = geom.paths[-1][-1]
// return the x and y values of those points
return {
"result": {"attributes": {
"UpstreamX": p_start.x,
"UpstreamY": p_start.y,
"DownstreamX": p_end.x,
"DownstreamY": p_end.y
}}
}
... View more
11-01-2022
01:03 AM
|
0
|
2
|
2954
|
|
IDEA
|
The viewing part was implemented in 2.7 thanks to this idea: ArcGIS Pro should allow you to see the SQL used to... - Esri Community 3:42 in this video: Ideas in ArcGIS Pro 2.7 - YouTube So this idea would be about editing that query.
... View more
10-28-2022
11:46 AM
|
0
|
0
|
7168
|
|
POST
|
"Field" and "column" are the same thing. "Column" is more often used in purely table based applications, like Excel. "Field" is often used in database applications. Both mean "the vertical sections of a table".
... View more
10-28-2022
01:27 AM
|
0
|
0
|
1349
|
|
POST
|
Hard to say without knowing the data. Can you post the shapefile?
... View more
10-28-2022
01:21 AM
|
0
|
1
|
4834
|
|
POST
|
You have to do it in two steps: Use GroupBy to get the MAX date for each site Use a loop to fill your output featureset, filtering the input data I hate filtering with date values with a passion, because any number of things can go wrong, and the syntax depends on your database. I would use Distinct() instead: var p = Portal('https://arcgis.com'); // don't assign to names of functions!
var fs = FeatureSetByPortalItem(
p,
'XXX',
0,
[
'sys_estFreqReads_DeltaB16172',
'sys_estFreqReads_OmicronBA1',
'sys_estFreqReads_OmicronBA2',
'sys_estFreqReads_OmicronBA4',
'sys_estFreqReads_OmicronBA5',
'sys_estFreqReads_OmicronBA275',
'sys_sewershedName',
'sys_phu',
'sampleDate',
'siteID',
'lowQuality'
],
false
);
// create output fs
var dowDict = {
'fields': [
{ 'name': 'sampleDate', 'type': 'esriFieldTypeString'},
{ 'name': 'siteID', 'type': 'esriFieldTypeString'},
{'name': 'sys_phu', 'type': 'esriFieldTypeString'},
{'name': 'sys_sewershedName', 'type': 'esriFieldTypeString'},
{ 'name': 'sys_estFreqReads_DeltaB16172', 'type': 'esriFieldTypeDouble'},
{ 'name': 'sys_estFreqReads_OmicronBA1', 'type': 'esriFieldTypeDouble'},
{ 'name': 'sys_estFreqReads_OmicronBA2', 'type': 'esriFieldTypeDouble'},
{ 'name': 'sys_estFreqReads_OmicronBA4', 'type': 'esriFieldTypeDouble'},
{ 'name': 'sys_estFreqReads_OmicronBA5', 'type': 'esriFieldTypeDouble'},
{ 'name': 'sys_estFreqReads_OmicronBA275', 'type': 'esriFieldTypeDouble'},
{ 'name': 'dow_num', 'type': 'esriFieldTypeInteger'},
{'name': 'dow', 'type': 'esriFieldTypeString'}
],
'geometryType': '',
'features': []
};
// get all distinct combinations of ['siteID','sys_phu', 'sys_sewershedName']
var sites = Distinct(fs, ['siteID','sys_phu', 'sys_sewershedName'])
// Populate feature array
for (var site in sites) {
var id = site.siteID
var phu = site.sys_phu
var sewershed = site.sys_sewershedName
// get all samples for this site
var samples = Filter(fs, 'siteID = @ID AND sys_phu = @phu AND sys_sewershedName = @sewershed')
// get the latest sample
var latest_sample = First(OrderBy(samples, 'sampleDate DESC'))
// null check to avoid errors
if(latest_sample == null) { continue }
// create the new feature and push it into the output fs
feat = {
'attributes': {
'sampleDate': Number(latest_sample['sampleDate']),
'siteID': latest_sample['siteID'],
'sys_phu': Text(latest_sample['sys_phu']),
'sys_sewershedName': Text(latest_sample['sys_sewershedName']),
'sys_estFreqReads_DeltaB16172': (latest_sample['sys_estFreqReads_DeltaB16172']),
'sys_estFreqReads_OmicronBA1': (latest_sample['sys_estFreqReads_OmicronBA1']),
'sys_estFreqReads_OmicronBA2': (latest_sample['sys_estFreqReads_OmicronBA2']),
'sys_estFreqReads_OmicronBA4': (latest_sample['sys_estFreqReads_OmicronBA4']),
'sys_estFreqReads_OmicronBA5': (latest_sample['sys_estFreqReads_OmicronBA5']),
'sys_estFreqReads_OmicronBA275': (latest_sample['sys_estFreqReads_OmicronBA275']),
'dow_num': Weekday(latest_sample['sampleDate']),
'dow': Text(latest_sample['sampleDate'], 'dddd')
}}
Push(dowDict.features, feat);
};
// Convert dictionary to feature set.
//var fs_dict = FeatureSet(Text(dowDict));
return FeatureSet(Text(dowDict));
... View more
10-27-2022
12:37 AM
|
2
|
2
|
5310
|
|
POST
|
This sounds like you have to increase the nummber of displayed decimals for the field. Format numeric and date fields—ArcGIS Pro | Documentation
... View more
10-26-2022
11:30 PM
|
0
|
1
|
2107
|
|
POST
|
Do you actually have a relationship class between your feature class and the inspection table? Is it named "gas.GU.VALVEINSP"?
... View more
10-25-2022
05:33 AM
|
0
|
1
|
3495
|
|
POST
|
The FeaturesetBy* functions should be available. You can do it like this: // load the table, this assumes you have a relationship class
var inspections = FeaturesetByRelationshipName($feature, "RelationshipName")
// sort descendingly by the date field
var latest_inspection = First(OrderBy(inspections, "DateField DESC"))
// no inspection found -> return a default value
if(latest_inspection == null) { return null }
// else return the date field of the latest inspection
return latest_inspection.DateField
... View more
10-25-2022
05:12 AM
|
0
|
3
|
3515
|
|
POST
|
First Point I didn't think about timezones when I tested... The feature class stores date values in UTC. According to the documentation, the value returned by Date() is considered to be UTC, but the behavior you (and me, too) see suggests that it treats it as local time. You're in CET (UTC+1), so it subtracts the hour. In the summer months, you're in CEST (UTC+2), you should see values with a time of 22:00:00. I haven't found a way to change that behavior. ToUTC() and ToLocal() don't have any effect. Setting the hour to 1 (or adding an hour) works, but that still leaves the problem with summer time. I think in this case it's best to do it with Python. In the Field Calculation, switch to Python and use this expression: datetime.datetime.strptime(!zz_ff_jdatat!, "%d/%m/%Y") Second Point This seems to be a bug. For validation, ArcGIS runs the expression on a row of your table. It apparently doesn't honor definition queries of the layer. You probably have a definition query set to "TextField IS NOT NULL" or something similar. When the tool runs, it doesn't encounter an error, but for validation, it grabs a feature that should be excluded from the layer. I just posted an idea about this, please lend your support to it, so that this will hopefully be fixed in the future: Honor Definition Query in Arcade Validation - Esri Community
... View more
10-25-2022
05:04 AM
|
0
|
0
|
1728
|
| 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
|