POST
|
Hi Dan. Yes, its simply number of Attr columns. Just realized the table did add up. All fixed. Yeah, looks like an Excel Macro is the way to go. Thanks, Jason.
... View more
04-13-2020
10:16 AM
|
0
|
0
|
434
|
POST
|
Hi there. I am trying to take a feature class attribute table with n columns and rearrange its table structure so I can use it as a "Many" table in a relationship class, but I am struggling on how to transpose the table in arcpy and preserve two index columns, in this example, OBJECTID and ObjectType and export it as a .dbf. I was thinking pandas could do this, but my attempts to implement it has failed so far. Appreciate any help! Thanks. The attribute table is a typical feature class structure and looks like this: OBJECTID ObjectType Atrr2 Attr3 Attr4 Attr5 n…. 1 Red 1 6 2 Yes …. 2 Green 4 3 3 No …. 3 Blue 3 2 5 Yes …. What I need is the attribute structured like this: OBJECTID ObjectType Attribute Value 1 Red Atrr2 1 1 Red Attr3 6 1 Red Attr4 2 1 Red Attr5 Yes 2 Green Atrr2 4 2 Green Attr3 3 2 Green Attr4 3 2 Green Attr5 No 3 Blue Atrr2 3 3 Blue Attr3 2 3 Blue Attr4 5 3 Blue Attr5 Yes
... View more
04-13-2020
09:51 AM
|
0
|
2
|
507
|
POST
|
My inspection survey can have up to 25 photos collected per asset. A photo is captured only if a defect is found. Is there a way to create a Feature Report document that would limit to only those questions with a photo? My current Feature Report does this to an extent, but it leaves a blank cell in the table when the if/then test proves false (e.g. ${if (Photo5 | getValue:”size”)>0} ) for each question. For instance, I could have only four photos for the asset, but three pages of blank cells until the if/then for a Photo proves true. My objective is to get rid of the blank cells, so that if a report has only 10 photos then all 10 get placed in a grid like pattern over the pages without any blank cells in between. Hope this makes sense. Any guidance is much appreciated. Thanks!
... View more
03-11-2020
02:32 PM
|
0
|
1
|
408
|
POST
|
Hi there. We have Collector for Windows 10, version 18.0.2.0 and it errors on Vector Tile Layers. Having a hard time finding info on this, but I assume Vector Tile Layers are not currently supported in the Collector for Windows app. Will they be in the next app release? Same target as Android, Q1 2020?
... View more
02-28-2020
07:30 AM
|
0
|
1
|
618
|
POST
|
Yep. Special props to David for helping me this! I learned quite a bit today.
... View more
02-21-2020
01:47 PM
|
0
|
1
|
528
|
POST
|
Thanks David. I got snippet to update the geometry, but unfortunately it only takes the first geometry and applies it to the rest of the non-geometry records. Thinking there needs to be a where clause that says if ID = ID and has geometry, apply geometry to non-geometry records with same ID. Anyways thanks a look. I appreciate the help. I'll keep at it! import arcpy
inFC = #".\Example.gdb\Lines"
fields = ['SHAPE@','Unique_ID']
#Update cursor
with arcpy.da.UpdateCursor(inFC, fields) as cursor:
#Set up dictionary to store previous non-null non-empty values
lastNonNullVals={}
for field in fields:
lastNonNullVals[field]="" #set a starting value for each field
for row in cursor:
for field in fields:
#Check if the current cell is null or empty
if row[fields.index(field)] in [None,"", " "]:
#Check if the previous value for the field exists
if lastNonNullVals[field] not in [None,"", " "]:
#Set the cell to the previous non-null non-empty value
row[fields.index(field)]=lastNonNullVals[field]
else:
#if there is a value for the cell, set it so it can be used in the next row(s)
lastNonNullVals[field]=row[fields.index(field)]
cursor.updateRow(row)
... View more
02-21-2020
11:57 AM
|
0
|
3
|
1069
|
POST
|
Thanks David. Yeah, was able to cobble together so py code and create a data dictionary. From there, not sure how to write the SHAPE@ to the records with NULL Geometry based on the matching ID that has Geometry. Any help/guidance is much appreciated. Thanks! import arcpy
inFC = #path toExample.gdb\Lines
inFields = ['ID', 'SHAPE@']
valueDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(inFC, inFields)}
print(valueDict)
with arcpy.da.UpdateCursor(inFC, inFields) as updateRows:
for updateRow in updateRows:
keyValue = updateRow[0]
print(keyValue)
if keyValue in valueDict:
updateRow[1] = valueDict[keyValue][0]
print(valueDict[keyValue][0])
updateRows.updateRow(updateRow)
... View more
02-21-2020
10:19 AM
|
0
|
5
|
1069
|
POST
|
Hi David. Thanks for the quick reply. Essentially, I have a polyline feature class that contains records with geometry and without geometry. Records with geometry are related to those without geometry (Shape_Length = 0) by an ID. Thought it might be easier to break those no geometry records out to a related table, but now I am thinking it would be easier and more straightforward not to do that and just have a cursor write geometry to no geometry records based on matching IDs it encounters in the attribute table. Please to see below table.
... View more
02-21-2020
08:08 AM
|
0
|
7
|
1069
|
POST
|
I have a polyline feature class with a related table attached. Is there a good way to write the feature class line geometry to the records in the related table? Goal is to create a feature class with lines with duplicate geometry, e.g. stacked. Any py code out that can accomplish this? Thanks!
... View more
02-21-2020
07:38 AM
|
0
|
16
|
1787
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|