|
POST
|
"Unreliable" may have been the wrong word. It tends to be harder to read, which could make it unreliable. It's easy to get messed up on the slashes and get one the wrong way, or accidentally add an extra one. Plus it's also less flexible than os.path. For example, instead of using string concatenation like this attFolder = mapFolder + "/" + "6)Deliverables/4)Feature_Class_Attribute_Tables/" + version
outATTgdb = 'attribute_tables.gdb'
exportLoc = attFolder + "/" + outATTgdb You can use os.path to define your pieces separately and put them all together in a more readable way without worrying about the slashes. mapFolder = r"C:\temp"
version = "v99"
outATTgdb = "attribute_tables.gdb"
attFolder = os.path.join(mapFolder, "6)Deliverables", "4)Feature_Class_Attribute_Tables", version)
exportLoc = os.path.join(attFolder, outATTgdb) Notice the r in front of the string for mapFolder. That specifies the string as "raw" so a single backslash doesn't need a second escape backslash. I find it easier this way so you can just copy/paste directory paths.
... View more
06-19-2015
08:44 AM
|
2
|
1
|
3670
|
|
POST
|
I just realized I was using copy rows instead of copy features so it was trying to add geometry attributes on a table instead of a feature class. DOH! Using in_memory workspace to calculate X/Y is about twice as fast (compared to in a file geodatabase) on a point feature class with just over 80,000 rows.
... View more
06-17-2015
03:05 PM
|
0
|
0
|
1496
|
|
POST
|
Good spot, Darren. On that note, the Python OS module can create file paths more reliably than concatenating strings. Try os.path.join()
... View more
06-17-2015
08:07 AM
|
1
|
0
|
7281
|
|
POST
|
The TableToExcel tool requires an input of a table view, not just the path to a table. Try making the table view first, then use that as input for the table to Excel process.
... View more
06-16-2015
02:22 PM
|
0
|
3
|
7281
|
|
POST
|
If you're looking for something simple and out of the box for ArcCatalog, you can simply make a GIS Server connection to your ArcGIS Server machine with a publisher or administrator type connection and start and easily stop services; no need for Python or an extra toolbox (although those tools are great). ArcGIS Help 10.1 - Connecting to GIS servers If you do find you want something to put into a Python script, Kevin Hibma published some nice Python snippets on GitHub for administering ArcGIS Server. khibma/AdministeringArcGISServerwithPython_DS2014 · GitHub
... View more
06-16-2015
02:09 PM
|
0
|
0
|
1082
|
|
POST
|
Looking at the documentation, I don't see anything where you can explicitly specify which expression type to use. It does give an example of printing the label class expression, so try that and see if it includes anything about which type it's using and adjust your format accordingly.
... View more
06-15-2015
09:38 AM
|
0
|
1
|
2467
|
|
POST
|
It takes a good 20 seconds for the copy rows to complete, so I'm sure it's actually creating the in_memory data. My guess is that AddGeometry just can't work its magic in an in_memory workspace.
... View more
06-11-2015
05:09 PM
|
0
|
0
|
1496
|
|
POST
|
I should clarify, My plan was to create a variable that has a path "in_memory" MyInputFC = r"C:\MySDEConn.sde\MyInputFC"
inputFC_inmem = os.path.join("in_memory", "MyInputFC_inmem") Then I copy rows from the source to the in_memory workspace arcpy.CopyRows_management(MyInputFC, inputFC_inmem) Then I try to run AddGeometry on the data in memory. This is where it errors. arcpy.AddGeometryAttributes_management(
inputFC_inmem, ## Input_Features
"POINT_X_Y_Z_M", ## Geometry_Properties
"", ## Length_Unit
"", ## Area_Unit
GCS_WGS_1984 ## Coordinate_System
) Then I would copy the rows back out of in_memory workspace.
... View more
06-11-2015
03:52 PM
|
0
|
3
|
1496
|
|
POST
|
I just tried to copy the data to in_memory workspace and do the AddGeometry there thinking it would be faster, but it looks like AddGeomerty won't work with in_memory data. I get an ERROR 000732: Input Features: Dataset does not exist or is not supported I don't see anything explicit in the documentation about this (unlike with Project, which clearly says in_memory is not a valid workspace).
... View more
06-11-2015
02:37 PM
|
0
|
5
|
1496
|
|
POST
|
I did a test of AddGeometryAttributes_management() for "POINT_X_Y_Z_M" and it can take 15 minutes to do an SDE feature class with about 80,000 points. I'm not even trying anything fancy with reprojecting, I'm just using the feature class's assigned coordinate system. The output is just Point_X and Point_Y fields. Is this typical performance?
... View more
06-11-2015
01:32 PM
|
0
|
7
|
4141
|
|
POST
|
You can mark as assumed answered so people know you don't still need help.
... View more
06-11-2015
11:10 AM
|
1
|
0
|
2467
|
|
POST
|
When you say it terminates, do you get an error message? If so, what exactly does the error message say?
... View more
06-10-2015
03:41 PM
|
0
|
1
|
3972
|
|
POST
|
Is there an easier way to just convert state plane coordinates to decimal degrees without reprojecting? Our data is in NAD_1983_HARN_StatePlane_Arizona_Central_FIPS_0202. EDIT: Looks like the accepted transformation from NAD_1983 to WGS_1984 in the contiguous 48 states of the US is NAD_1983_To_WGS_1984_5. However, I don't see how to specify a transformation when using AddGeometryAttributes_management().
... View more
06-09-2015
07:11 AM
|
0
|
2
|
4141
|
|
POST
|
You can use the arcpy ArcSDESQLExecute class to execute SQL in SDE using Python. Another alternative is cx_Oracle; you'll have to download and import a separate module, but it works on any Oracle database, not just one with SDE. In either case, you will need the Oracle client adapter installed on your computer that allows you to connect to an Oracle database.
... View more
06-09-2015
07:01 AM
|
1
|
0
|
5342
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM | |
| 1 | 12-01-2025 06:19 AM |