POST
|
FYI, I also had to remove "orphaned" records in the SDE.ST_GEOMETRY_COLUMNS table which referenced the same "owners" from the SDE.INSTANCES table (records now deleted). Once that was done, I could create a new feature class.
... View more
01-21-2015
09:53 AM
|
0
|
0
|
993
|
POST
|
Thanks for the reply, that helps. Looking forward to the 1.4 release. Good luck!
... View more
10-31-2014
10:15 AM
|
0
|
0
|
999
|
POST
|
1. Does the v 1.3 API support access to FGDBs created with ArcGIS 10.2 ? 2. Does the v 1.3 API support access to compressed FGDBs or compressed featureclasses within a FGDB ? Thanks, HW
... View more
10-31-2014
09:28 AM
|
0
|
6
|
999
|
POST
|
Just an "update" 😛 to close out this thread. The 2nd round of suggested code did not work, so I figured the code approach was probably fine and something else completely was the problem. Going in another direction, I decided to register my table with the enterprise geodatabase (SDE 10.1 over PostgreSQL). After doing that, the update cursor works fine. I did not register the table as versioned, so I am making unversioned edits directly to the base table, which is what I wanted in the first place. What tripped me up was that insert cursors and search cursors did not require that the table be registered with the geodatabase, but it looks like update cursors are different, which is understandable. Thanks very much for your suggestions, which had a lot of good code and hints that I took away and helped move me forward. Hal If anyone knows how to mark this thread as solved, feel free.
... View more
04-03-2013
07:38 AM
|
1
|
0
|
2454
|
POST
|
Great, l'll give it a try. If someone else out there wants to advocate for the "with" block syntax, I'm curious. In the meantime I'll test this approach.
... View more
04-02-2013
11:04 AM
|
0
|
0
|
2454
|
POST
|
Thank you, this is helpful. 1) I don't believe there are any locks on the table. ArcMap, PgAdmin are both closed and I checked on the database cluster from the back end and there are no connections to this database prior to running the script. 2) Your code worked. 3) I definitely have a field called "field3" in my table. Here's what I did to test your idea. I commented out my code block and ran this instead: try:
arcpy.da.UpdateCursor(table_to_update, ["*"])
except Exception as err:
print(err) and did not get an error returned. So then I tried reformatting that into a with block which is how I was doing it before: try:
with arcpy.da.UpdateCursor(table_to_update, ["*"]) as update_cursor:
pass
except Exception as err:
print(err) Which also does not return an error. Hurray!. So I thought I would step down one more level using ["*"] like you did. I'm not sure using pass is OK here, but I thought it was worth trying: try:
with arcpy.da.UpdateCursor(table_to_update, ["*"]) as update_cursor:
for row in update_cursor:
pass
except Exception as err:
print(err) this block returns the error: create cursor has failed Just to check that I hadn't put a lock on the table somehow, I re-ran the 2nd block above again and it still got no error. Thanks again, I'm learning.
... View more
04-02-2013
09:33 AM
|
0
|
0
|
2454
|
POST
|
Hi, I'm working with the arcpy.da module for the first time and just trying to get a handle on how it operates. I have a PostgreSQL database with a simple table that includes these fields: id, field1, field2, field3, field4. At this point the table is not registered with the geodatabase or SDE (I want to do simple unversioned table edits). For the most part I've been trying to follow the ArcGIS 10.1 help examples. I have been able to successfully use arpy.da.SearchCursor to list records. This works: # List records using search cursor (snippet) table_to_select_from = r"/home/engine/scripts/connections/ARCSDE101-DEV1-PG-DC-GDRS_DEV-GDRS-DEFAULT.sde\gdrs_dev.gdrs.test_arcpy_da" field_list = ["id", "field1", "field2", "field3", "field4"] try: with arcpy.da.SearchCursor(table_to_select_from, field_list) as search_cursor: for row in search_cursor: print("{0}, {1}, {2}, {3}, {4}".format(row[0], row[1], row[2], row[3], row[4])) except Exception as err: print(err) exit(1) I can also successfully insert new records using arcpy.da.InsertCursor: # Insert record (snippet): table_to_insert_into = r"/home/engine/scripts/connections/ARCSDE101-DEV1-PG-DC-GDRS_DEV-GDRS-DEFAULT.sde\gdrs_dev.gdrs.test_arcpy_da" field_list = ["field1", "field2", "field3", "field4"] values_list = ["Test arcpy.da.insertRow", "Hello World!", 10, "2013-03-23"] try: with arcpy.da.InsertCursor(table_to_insert_into, field_list) as insert_cursor: insert_cursor.insertRow(values_list) except Exception as err: print(err) exit(1) So far so good. However when I attempt to update rows, I cannot successfully create an update cursor. The exception message: "create cursor has failed" is returned. I'm sure this is something simple, but I've been banging my head on it and hope you can help point me in the right direction. In this example I attempt to multiply the value in an integer field by 2: table_to_update = r"/home/engine/scripts/connections/ARCSDE101-DEV1-PG-DC-GDRS_DEV-GDRS-DEFAULT.sde\gdrs_dev.gdrs.test_arcpy_da" field_list = ["field3"] try: with arcpy.da.UpdateCursor(table_to_update, field_list) as update_cursor: for row in update_cursor: row[0] = row[0] * 2 update_cursor.updateRow(row) del row, update_cursor except Exception as err: print(err) the string object err which is printed is: "create cursor has failed" I tried placing this block inside an arcpy.da.Editor block, but no change in the error result. Any thoughts? Thank you!
... View more
04-02-2013
08:23 AM
|
0
|
6
|
6862
|
POST
|
I have to admit, as someone who has been managing SDE installs since 9.1, I didn't pick up on this paradigm shift until a few days ago when I did a test 10.1 on Oracle install, and realized that with Toad and the Python interpreter in ArcCatalog I could pretty much do everything I needed to get the enterprise geodatabase created, a user-schema geodatabase created, and the .sde connection files to access them created. I think that is a good step forward for basic installs. If I can take the SDE Application server out of the picture, that is a big time saver. The toolbox tools are a little rough, but with arcpy you can get the job done. It would be great to have access to some more of the sde app server command line tools available via the python arcpy module. I'm thinking especially of the tools like sdeconfig and sdedbtune, which still seem necessary to me. I hope that is in the works. If I'm missing something on that front, I would love to be educated. Looking at it now, the progression makes sense and I'm glad for the new options.
... View more
02-26-2013
11:57 AM
|
0
|
0
|
402
|
IDEA
|
-->
We have a data library of File geodatabases that we would like to share with open source clients via GDAL. Many of our file geodatbases are compressed, which makes them unreadable by clients using the FGDB API. There are many benefits to compressed file geodatabases, and we don't want to have to maintain duplicative, uncompressed data for the non-esri clients.
... View more
02-14-2013
12:20 PM
|
9
|
0
|
202
|
Title | Kudos | Posted |
---|---|---|
1 | 04-03-2013 07:38 AM | |
9 | 02-14-2013 12:20 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:22 AM
|