|
POST
|
Hi Doug, Try moving the print statement that you use right after the add field function up so that it prints what is supposed to be added. I think that will give you the info you need to solve the problem. Based on the error you received I believe that your script is trying to add a field with an invalid type to the target shapefile. Micah
... View more
04-26-2019
01:19 PM
|
1
|
2
|
6039
|
|
IDEA
|
Zing! Btw, it looks like there is an additional relationships resource that would expose the attribute rule properties within a feature service in the ArcGIS REST API, introduced at version 10.7. So, maybe they are planning to implement what you are talking about soon. https://developers.arcgis.com/rest/services-reference/relationships-feature-service-.htm
... View more
04-26-2019
12:48 PM
|
1
|
0
|
781
|
|
IDEA
|
Zing! Btw, it looks like there is an additional relationships resource that would expose the attribute rule properties within a feature service in the ArcGIS REST API, introduced at version 10.7. So, maybe they are planning to implement what you are talking about soon. https://developers.arcgis.com/rest/services-reference/relationships-feature-service-.htm
... View more
04-26-2019
12:48 PM
|
1
|
0
|
639
|
|
IDEA
|
Excellent idea! This just came up for me at work. Why on Earth would someone downvote this idea???
... View more
04-26-2019
09:06 AM
|
0
|
1
|
781
|
|
IDEA
|
Excellent idea! This just came up for me at work. Why on Earth would someone downvote this idea???
... View more
04-26-2019
09:06 AM
|
0
|
1
|
639
|
|
BLOG
|
Joseph Elfelt I finally got around to sharing this with my URISA pals and plan to share this on the social media platforms that I manage. I also talked this up at the Oregon URISA annual GIS in Action conference earlier this week. Great work! This is such an achievement - you should seriously consider going for a slot on the National Geospatial Advisory Committee or something. Micah
... View more
04-24-2019
11:04 AM
|
1
|
0
|
416
|
|
POST
|
Here's some code I've been using. It might help. def GetWorkspace(inputFeatureClass):
"""
Returns the workspace which contains the input feature class
"""
path = arcpy.Describe(inputFeatureClass).path
if arcpy.Describe(path).dataType in ("Workspace", "Folder"):
workspace = path
else:
workspace = arcpy.Describe(path).path
return workspace
def hasRelatedTables(inputTable):
"""
Returns true if the input table participates in a relationship class
"""
if arcpy.Describe(inputTable).relationshipClassNames != []:
return True
else:
return False
def GetRelatedTableInfo(inputTable):
"""
Returns a dictionary of relationship class info
"""
relTableInfo = {}
workspace = GetWorkspace(inputTable)
if hasRelatedTables(inputTable):
relClasses = arcpy.Describe(inputTable).relationshipClassNames
for rc in relClasses:
relClassProps = arcpy.Describe(os.path.join(workspace, rc))
if os.path.join(workspace, relClassProps.originClassNames[0]) == inputTable:
isTopLevel = True
else:
isTopLevel = False
relTableInfo[relClasses.index(rc)] = {"IsTopLevel": isTopLevel,
"RelClassName": rc,
"ParentTable": os.path.join(workspace, relClassProps.originClassNames[0]),
"ChildTable": os.path.join(workspace, relClassProps.destinationClassNames[0]),
"PrimaryKey": [k[0] for k in relClassProps.originClassKeys if k[1] == "OriginPrimary"][0],
"ForeignKey": [k[0] for k in relClassProps.originClassKeys if k[1] == "OriginForeign"][0],
"IsAttachment": relClassProps.isAttachmentRelationship,
"Cardinality": relClassProps.cardinality}
return relTableInfo
else:
return {}
def ListRelatedTables(inputTable, excludeAttachments = False):
"""
"""
if not hasRelatedTables(inputTable):
return None
relatedTables = []
relTableInfo = GetRelatedTableInfo(inputTable)
if excludeAttachments:
for item in relTableInfo:
if not relTableInfo[item]["IsAttachment"]:
relatedTables.append(relTableInfo[item]["ParentTable"])
relatedTables.append(relTableInfo[item]["ChildTable"])
else:
for item in relTableInfo:
relatedTables.append(relTableInfo[item]["ParentTable"])
relatedTables.append(relTableInfo[item]["ChildTable"])
relatedTables = list(set(relatedTables))
if inputTable in relatedTables:
relatedTables.remove(inputTable)
return relatedTables
For list related tables function I only wanted non-attachment relationships. Hope this helps! Micah
... View more
04-11-2019
03:29 PM
|
0
|
0
|
3527
|
|
POST
|
Hey Robert, thanks for the reply. This would be part of a process that would be used in an ongoing fashion. It's part of a regular QA/QC process we run on our corporate data. I'd like to flag features where all the geometry and attributes are the same except for: OBJECTID GLOBALID GUIDs But, if the features have related child records, I'd only like to flag those as duplicates if they have identical related records. We use either GLOBALID or GUID fields as the primary keys in relationship classes. Suppose the following Feature Class A relates to Table B in a one-to-many relationship: Feature Class A Geometry Field 1 Field 2 Field 3 GUID (PK) Same All The Same {GUID1} Same All The Same {GUID2} Table B Field 4 Field 5 Field 6 GUID (FK) Same Values Here {GUID1} And Same Here {GUID1} Same Values Here {GUID2} And Same Here {GUID2} So, in Feature Class A, the two features have the same geometry, and same attributes except for GUID. Each one has two related records in Table B - but they are the same set of related records. So in this case I would like to flag the two features as duplicates. But in this case: Feature Class A Geometry Field 1 Field 2 Field 3 GUID (PK) Same All The Same {GUID1} Same All The Same {GUID2} Table B Field 4 Field 5 Field 6 GUID (FK) Same Values Here {GUID1} And Same Here {GUID1} Same Values Here {GUID2} But I'm Different! {GUID2} The records related to the feature with GUID2 are different than those related to the feature with GUID1, so I would like to not flag the two features as duplicate. Make sense? I might not be doing a good job explaining it. Basically I want a way to identify features with the same geometry, attributes, and identical related records, excluding any OBJECTID, GLOBALID, or GUID fields which would be unique by default. Micah
... View more
03-26-2019
11:32 AM
|
0
|
0
|
1470
|
|
POST
|
Greetings, I am in need of a way to efficiently identify features/records that are duplicates within a feature class or table, while also accounting for any child records that might exist. Right now, I am checking for duplicates using Find Identical. I exclude fields that are OBJECTID, GLOBALID, or GUID, but otherwise evaluate all other fields for duplicates. We have datasets that participate in one or more relationship classes, sometimes as many as two relates deep. I'd like to avoid flagging parent features/records as duplicates if they have child records which differ from another otherwise-identical feature in the parent feature class. This is part of a suite of QA/QC tools that I've created using, Python, arcpy, the geoprocessing toolbox, plus a couple custom bits (e.g. if the feature class is above a certain number of features I bring it into sqlite and check for duplicates there for performance), so any solution that leverages those capabilities would be preferable. Thanks, Micah
... View more
03-26-2019
09:08 AM
|
0
|
2
|
1562
|
|
POST
|
This just happened for me on a GUID field stored in an SDE geodatabase using Oracle (Oracle 12). The geodatabase is version 10.4.1. I was attempting to copy a feature class from SDE into a file geodatabase stored on a shared network. Any ideas?
... View more
03-07-2019
07:55 AM
|
0
|
0
|
1960
|
|
IDEA
|
Subtypes applied within a feature class or table provide a great range of options for enforcing data integrity by specifying the domains and/or default values to apply to other fields for each subtype. It would be very helpful to expand the field properties which can be controlled on a per-subtype basis to include the non-nullable/read-only property. Suppose you have applied subtypes (0, 1, 2) to Column A, and Column B contains additional details that only apply when Column A equals 1 or 2. With this idea you could specify: For subtypes 1 and 2, Column B has a domain of "Column_B_Options" For subtype 0, Column B default value is "N/A" For subtype 0, Column B is read-only (so an editor couldn't erroneously enter a non-sequitur value) Thanks for considering my idea! Please upvote if you think it's worthwhile for Esri to take a look at.
... View more
11-29-2018
11:06 AM
|
2
|
0
|
855
|
|
POST
|
Greetings, I have a list of Python dictionary objects. Each of the dictionaries has the same six keys. I'd like to be able to 'collapse' these dictionaries, combining them where five of the keys have identical values, and then separate the values for the sixth key with a comma. For instance, if I was starting with: myDictionaries = [{'Subdivision': u'NENW', 'Twp': u'026S', 'Range': u'033E', 'Sec': u'13', 'Sur Type': u'A', 'Meridian': u'33'},
{'Subdivision': u'NWNE', 'Twp': u'026S', 'Range': u'033E', 'Sec': u'13', 'Sur Type': u'A', 'Meridian': u'33'}] Note that all of the key/value pairs in the two dictionaries are identical, except for Subdivision. So, what I would like to get is: [{'Subdivision': u'NENW,NWNE', 'Twp': u'026S', 'Range': u'033E', 'Sec': u'13', 'Sur Type': u'A', 'Meridian': u'33'}] Thanks for any help you can provide! Micah
... View more
10-17-2018
04:03 PM
|
0
|
5
|
7678
|
|
POST
|
Hi Djalil, I don't think so. Have a look at the table on this page: Client and geodatabase compatibility—ArcGIS Help | ArcGIS Desktop It suggests that a 10.3 client could open a 10.4 .gdb, but not 10.5. Micah
... View more
04-19-2018
01:18 PM
|
0
|
0
|
442
|
|
POST
|
Does putting this at the desired end of your line work?: <br /> Here's the source: Adding a new line/break tag in XML - Stack Overflow
... View more
04-19-2018
01:15 PM
|
0
|
2
|
4569
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-13-2017 09:58 AM | |
| 1 | 10-27-2017 12:54 PM | |
| 1 | 10-13-2017 04:28 PM | |
| 5 | 08-14-2017 01:58 PM | |
| 1 | 10-16-2017 08:03 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-26-2021
03:16 PM
|