|
POST
|
We also use SQL-Triggers to automate some tasks I wonder if the argument can be made to abandon your triggers in favor of attribute rules. In a former life I used SQL triggers in a SqlServer backend SDE (now enterprise) and I was under the impression then that triggers were not a supported feature for ArcGIS.
... View more
03-30-2021
10:00 AM
|
0
|
1
|
1354
|
|
POST
|
This is one reason I avoid globals, too easy to introduce bugs. As do I....
... View more
03-25-2021
03:26 PM
|
1
|
0
|
5485
|
|
POST
|
I've used that find duplicates definition for a number of years. I found it here. And I have never quite understood how it works!
... View more
03-25-2021
03:12 PM
|
0
|
0
|
5487
|
|
POST
|
That's what I meant by I guess I could just append every row to the list as individual tuple elements. I was hoping to keep in the list comprehension format, but I suspect opening an empty list and appending a formatted tuple to it is the only option...
... View more
03-25-2021
11:58 AM
|
0
|
4
|
4071
|
|
POST
|
I need to write the output of a search cursor to a csv file. I stole an idea from this Stackexchange post that uses list comprehension and it works great. The problem is one of my fields is a date field, and it's goofing up the works. import arcpy
fc = r'\Path\to\my\featureclass'
fields = ['UNIQUE_ID','asset_id','Condition','Year_Installed','Carto_ID',
'Pave_Area','Pave_Width','Length','AM_Asset_ID','Lanes','OCI_Date']
lines = [row for row in arcpy.da.SearchCursor(fc,fields)] Here is what one of the tuples in the lines list looks like: ('10100922','PWOPS_pave00024318',84,1989,7366264,8800.60992698,35.0,
251.44599791,None,None, datetime.datetime(2019, 2, 1, 0, 0)) Notice how the field OCI_date comes from the search cursor. I get what it's doing with the datetime.datetime() method, but how can I avoid that? I guess I could just append every row to the list as individual tuple elements and for the date, format in a fashion that works, but maybe there is a better way?
... View more
03-25-2021
11:51 AM
|
0
|
9
|
4080
|
|
POST
|
for row in arcpy.SearchCursor(Point):
strrow = str(row.OBJECTID)
pointList.append(strrow) This part catches my attention: is there some specific reason you are using the old style SearchCursor() rather than the new (and suggested) arcpy.da.SearchCursor()? The syntax that I am familiar with requires some sort of field name reference: fields = ['OBJECTID']
for row in arcpy.da.SearchCursor(Point, Fields):
blah blah blah....
# or
with arcpy.da.SearchCursor(Point, '*'): as cursor:
for row in cursor:
blah blah blah You can throw in a print() statement to see what the value is of strrow and or what PointList looks like. Is this being run as a stand alone script? I'm not sure how l layers are actually used in the .mapping module, as most of my experience is limited to working on features themselves and in that case I have to use Make feature layer first and apply the selection to that.
... View more
03-22-2021
03:17 PM
|
3
|
1
|
6958
|
|
POST
|
here are a couple online resources for a python approach to finding identical values in a given field: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/find-identical.htm https://support.esri.com/en/technical-article/000023355 But these are not attribute rules; you would run these as part of a data QA/QC routine. I also looked at Data Reviewer which does not seem to offer a 'find repeated values' check. Also found this post: https://community.esri.com/t5/electric-questions/check-for-duplicate-assetid-values-with-arcade/m-p/209833 I haven't studied it yet, but it might point you in a directions. @XanderBakker - any ideas for @AlexP_ ?
... View more
03-22-2021
12:25 PM
|
1
|
0
|
1801
|
|
POST
|
Survey123 would not be the tool to use for data editing, and I would venture a guess that is does not have such a tool.
... View more
03-22-2021
12:21 PM
|
1
|
0
|
1801
|
|
POST
|
I see: You want the address field to be unique and never reused. The Address Data Management Solution uses a Domain approach to resolving that issue with street names. The problem with that is Domains in an enterprise geodatabase can only be modified by the domain owner, not multiple editors. I'm not sure how to scan a feature set for a particular value and dis-allow it from being used again at the time of creation.
... View more
03-22-2021
10:25 AM
|
1
|
1
|
1935
|
|
POST
|
GlobalIDs are maintained internally by the geodatabase, so you have no control over them. I let the geodatabse do it's job. The same goes for ObjectID: I avoid using either one for anything than they are intended for. I think I've also mentioned database sequences in one or more of my responses to your earlier posts. I find deploying a database sequence and then capturing the next value in an attribute rule to be a very convenient and easy way to create a unique id of your own design. Here is an example of using a database sequence which is numeric to update a text type of unique id field. // This rule will create a new unique id when new feature is created
// Define the leading text and the delimiter for the ID
var prefix = "MyID"
var join_char = "-"
//Ensure the ID is not already set, if it is, return the original id
if (IsEmpty($feature.siteaddid)) {
return Concatenate([prefix, NextSequenceValue("MyDatabaseSequence")], join_char)
}
else {
return $feature.siteaddid
} In this example I use the text of MyID as the prefix to my unique identifier and concatenate to the next value in a database sequence named MyDatabaseSequence. If the next value of my sequence is 100, then the unique id field value will be: MyID-100
... View more
03-22-2021
09:34 AM
|
1
|
1
|
5461
|
|
POST
|
'datastore' which is Arcade for database. That's the great thing about having a database view: the view is in the same datastore/database that the points are in. But the actual data that the view is referencing can be elsewhere.
... View more
03-22-2021
08:59 AM
|
1
|
3
|
5468
|
|
POST
|
1. It depends where you store your data: if it a hosted feature layer on AGOL, no. 2. To use attribute rules, the feature needs a global id 3. This type of rule is applied to the point feature 4. MyParcels is the name of the feature class, and the variable 'parcel' refers to it My suggestion is you take a look at the Arcade help pages to be come more familiar with it. Something you need to consider is that when you create attribute rules that take data from one feature to another, all the feature classes must reside in the same 'datastore' which is Arcade for database. At this point in time all my addressing data and the related features are in the same enterprise geodatabase. I notice that you refer to your parcel feature class as 'parcelview': is this an actual database view of the data? If so, that view and your address points need to be in the same datastore.
... View more
03-22-2021
08:36 AM
|
1
|
8
|
5474
|
|
POST
|
I think on one of your other related posts I suggested an attribute rule. I have one that does exactly what you are looking for: var parcel = FeatureSetByName($datastore,"MyParcels",["parcel_id"],true)
var intersectLayer = Intersects(parcel, Geometry($feature))
if (Count(intersectLayer) > 0) {
var layer = First(intersectLayer);
return layer.parcel_id;
} else {
return null;
} The if/else assures you that if there is not intersecting layer, the rule still fires correctly and does not toss an error.
... View more
03-22-2021
08:13 AM
|
1
|
2
|
5479
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-11-2018 07:12 AM | |
| 1 | 05-17-2021 11:18 AM | |
| 1 | 06-29-2021 11:42 AM | |
| 1 | 07-05-2012 07:49 AM | |
| 1 | 09-03-2016 06:16 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-19-2026
11:56 AM
|