|
POST
|
Gotcha. Yes, Table_2 currently has 40 empty fields. I would like to only populate FieldA. Is there a way to assign 'None' to all subsequent fields without having a long list of 'Nones'? It looks like I might be able to use (*) to read in all fields from Table_1 if this is needed for line 7 (vs. having to list out all fields). Also, the tbList values are what I was expecting. I just wanted to make sure the list format wasn't part of the 'size of row error'. Thanks for all of your help!
... View more
01-30-2018
09:53 AM
|
0
|
5
|
1407
|
|
POST
|
I think this is exactly what I am looking for. However, I am getting a "sequence size must match size of the row" error on line 10. I did not include a "myCalc" field though, as I have already added all of the necessary fields to the new table (i.e. Table_2). (Maybe I am wrong in excluding it?) tbList = [] # empty list
for row in arcpy.da.SearchCursor('Table_1', ["FieldA"]):
if row[0] not in tbList:
tbList.append(row[0]) # copy distinct rows to list
inCursor = arcpy.da.InsertCursor('Table_2', ["FieldA"]) # list of all fields in new table
for row in tbList:
inCursor.insertRow((row,None)) # field values to insert
del inCursor If I print tbList, this is what I currently get:
... View more
01-30-2018
08:46 AM
|
0
|
7
|
2535
|
|
POST
|
That blog post is AWESOME. I have been using it for many of my field updates lately, and it has been a game changer for speeding up scripts. I was actually hoping to integrate something similar for this particular issue but became stumped when I didn't have a key for both tables. I am also not quite sure if a dictionary is helpful, if the search cursor is only reading values from one field. If you have suggestions as to how I might make this method work for updating one existing field on a new table that does not already have a key (the new field that is being populated here will act as the key for subsequent field calculations), I will gladly take them. I'm a python novice and am looking for recommendations anywhere I can get them. Thank you so much!
... View more
01-29-2018
03:51 PM
|
0
|
0
|
2535
|
|
POST
|
This might be the straightforward way I was hoping to keep the existing 'Table_2' structure (without having to add and reorder fields), but deleting the new field after a quick join and calculation might be the best way to go. Thanks!
... View more
01-29-2018
03:04 PM
|
0
|
1
|
2535
|
|
POST
|
I'm assuming this is pretty straightforward, and I am missing something fairly simple. I am attempting to bring in a column of data values, 'FieldA', from a table, 'Table_1', to populate an empty field, 'FieldA', in a new, empty table, 'Table_2'. These 'FieldA' values will be used as a key in 'Table 2' for subsequent field calculations. Is there a direct way to do this? I have been attempting to use a search cursor and update cursor combination to write the field values to the new table, though I am not sure how to successfully employ the cursors to update the single field without an existing key between the two tables (where I would use a dictionary). Here is my unsuccessful, botched code: search_feats = arcpy.da.SearchCursor(Table_1,["FieldA"])
i = 0
with arcpy.da.UpdateCursor(Table_2,["FieldA"]) as upd_cur:
for upd_row in upd_cur:
i=i+1
upd_row[0] = search_feats (i)
upd_cur.updateRow(upd_row)
del upd_cur
What may be a better way to approach this?
... View more
01-29-2018
02:52 PM
|
0
|
16
|
5579
|
|
POST
|
I am trying to add a where clause into a arcpy.da.SearchCursor statement, and I keep receiving a 'An expected Field was not found or could not be retrieved properly' error with this code: where_expression = ' "FIELD2" = "CODE1" or "FIELD2" = "CODE2" '
search_feats = {f[0]:f[1] for f in arcpy.da.SearchCursor(table,["FIELD1","FIELD2","FIELD3"], where_expression)}
with arcpy.da.UpdateCursor(New_Table,["NT_FIELD_1","NT_FIELD_3"]) as upd_cur:
for upd_row in upd_cur:
upd_row[1] = search_feats.get(upd_row[0], 0)
upd_cur.updateRow(upd_row)
del upd_cur I believe this error is falling on the where clause, as if I exclude the clause from search_feats, the code runs without error. I have used a where clause successfully in this structure in the past, but not with a text field such as FIELD2 here. Any tips or suggestions would be much appreciated. I have tried many different variations of syntax with no luck yet. I have verified that the fields exist in the table, have been typed correctly, and do not have any locks.
... View more
01-23-2018
04:01 PM
|
0
|
3
|
10421
|
|
POST
|
Turns out, I did find some color conflict. It appears in both CityEngine and the web scene. web scene: CityEngine:
... View more
11-21-2017
10:44 AM
|
0
|
1
|
1898
|
|
POST
|
Thank you so much. You have been super helpful. By removing the transparency and adding an extrusion to the fill color shapes on the first floor models, I was able to resolve most of the flickering. I am using a 10 meter DEM as a terrain surface in CityEngine, though I have not been exporting the terrain to our Portal. In web scenes, it appears to load to the 3D basemap correctly. I think the main issue with the flickering for my models is directly related to the uneven terrain. I am not sure of ways to navigate this. For the building in the screen shot below, I have extruded the floors by 1.3 m and am still receiving some z-conflict flickering due to the gentle hills of the terrain (e.g. the left side of the building shown). The colors are solid with no flickering in CityEngine, regardless of elevation offset or extrude height. The issue only seems to appear in the web scene. I did change some of the colors around and it looks like the rendering remains consistent in the web scene. The colors are accurate and the z-conflict still appears to be in the same location. I will keep an eye out for any issues with color that may look buggy, though I haven't noticed any as of yet. I'll keep you posted if I run into anything. Thanks again!
... View more
11-21-2017
10:33 AM
|
0
|
2
|
1898
|
|
POST
|
Here are screenshots of the same floor plan with an offset of 0.01 meters with the street maps and imagery base maps: There still appears to be some sort of face conflict (apparently with the ground surface) for the ground level floors in the web scene, even after a 0.1 m vertical offset. Also, as it would be nice to have these floors snapped to the ground, any options on how I might work around this conflict? Thank you! Tess
... View more
11-17-2017
08:16 AM
|
0
|
4
|
1898
|
|
POST
|
The colors do appear to be consistent in the web scene and in CityEngine. Here are two images of the same floor plan. The top image is in the web scene and the bottom is in CityEngine. I am not quite sure what the light gray building would be or how to adjust their plane. I do see what you're taking about though. However, in addition, it does look like the halls and other corridors should be rendering as the same dark gray as seen in CityEngine prior to export. It also looks as if the hallways and corridors are also attempting to render in the right color in the web scene. The Model Heirarchy Explorer is awesome! I have also browsed over the additional links you attached, and they are definitely helpful. I will keep digging. Thanks! Tess
... View more
11-16-2017
02:12 PM
|
0
|
6
|
1898
|
|
POST
|
Awesome! This works perfectly: report("name", "MyNewNameToBeDisplayedInPopupWindow") Thank you!
... View more
11-15-2017
03:22 PM
|
0
|
0
|
2279
|
|
POST
|
Thanks again for your help Cheryl. I do get the problem regardless of zoom level, though the flickering appears to change with zoom level. The polygon floor colors do render correctly as solid color surfaces in CE prior to exporting as scene layer packages. Adding the NIL after the attribute reporting did not appear to solve the issue. Unfortunately, I will not be able to pass along the polygon feature data these models are generated from, but attached is the rule file that is being used. The rule file was originally written in CE 2015. Thanks again! Tess
... View more
11-15-2017
03:18 PM
|
0
|
1
|
1898
|
|
POST
|
I have been struggling with poor rendering quality in the Scene Viewer on our Portal. Colored faces appear patchy or as if there is face conflict. The white patchiness is dynamic and shifts as models are rotated in the scene viewer. The models render as solid color surfaces in CityEngine prior to exporting as a scene layer packages. Any tips on ways to have these colors stay solid when rendering in the SceneViewer? Attached are screenshots of this issue where colored faces are not rendering consistently.
... View more
11-13-2017
08:59 AM
|
0
|
10
|
2560
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-19-2018 11:46 AM | |
| 1 | 04-10-2018 03:47 PM | |
| 1 | 10-01-2018 08:50 AM | |
| 1 | 02-15-2017 07:50 AM | |
| 1 | 10-19-2018 04:08 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-22-2025
08:12 AM
|