POST
|
Thanks. I've gotten pulled off onto another task but will give this a try once that is complete. It doesn't make sense because this is the exact same script we've been using for a good while. The only difference is we're trying to do the join to get more attributes.
... View more
11-07-2022
12:20 PM
|
0
|
0
|
304
|
POST
|
I have a custom geoprocessing task written for me in python that takes 2 inputs - input_rows.csv and event_rows.csv - and creates a file gdb with a feature class of a join of these 2 tables. input_rows has the x,y coordinates for the feature class. event_rows.csv contains the attributes. When I run it locally in ArcCatalog (10.7.1), it runs fine. If I publish it to our ArcGIS 10.81 Linux server and run that in ArcCatalog, it also runs fine. If I try to execute it thru a call in my C# application, I get a generic error on TableToTable_conversion: <Msg time='2022-10-25T13:01:43,305' type='SEVERE' code='20010' target='export/Download_v3.GPServer' methodName='GPServerSync.CheckMessages' machine='xxx' process='116658' thread='505' user='null' requestId='xxx'>Error executing tool. Download Job ID: j46c9f46dd97642e4890778604255a1fb :
Traceback (most recent call last):
File "<string>", line 248, in execute
File "<string>", line 190, in zip_GIS
File "z:\home\esri\arcgis\server\arcpy\arcpy\conversion.py", line 2272, in TableToTable
raise e
ExecuteError: ERROR 999999: Error executing function.
Failed to execute (TableToTable). Here is the code to do the conversion: x_coords = "S4_X"
y_coords = "S4_Y"
out_event_lyr = "event_layer"
v_scratchFolder_ = "%scratchFolder%"
# create Folder
arcpy.CreateFolder_management(v_scratchFolder_, "Geodatabase")
# create File GDB
arcpy.CreateFileGDB_management(x, gdb_name)
wkt = "PROJCS['NAD_1983_HARN_Florida_GDL_Albers',GEOGCS['GCS_North_American_1983_HARN',DATUM['D_North_American_1983_HARN',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Albers'],PARAMETER['False_Easting',400000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.0],PARAMETER['Standard_Parallel_1',24.0],PARAMETER['Standard_Parallel_2',31.5],PARAMETER['Latitude_Of_Origin',24.0],UNIT['Meter',1.0],AUTHORITY['EPSG',3087]]"
sr = arcpy.SpatialReference()
sr.loadFromString(wkt)
out_event_lyr = arcpy.MakeXYEventLayer_management(input_rows, x_coords, y_coords, out_event_lyr, sr)
crash_fc = arcpy.CopyFeatures_management(out_event_lyr, os.path.join("%scratchFolder%\Geodatabase", gdb_name, out_event_fc))
event_tab = arcpy.TableToTable_conversion(event_rows, os.path.join("%scratchFolder%\Geodatabase", gdb_name), "EventTab")
crash_fc_lyr = arcpy.MakeFeatureLayer_management(crash_fc, "fc_lyr")
out_event_lyr_join = arcpy.AddJoin_management(crash_fc_lyr, "REPORT_NUMBER", event_tab, "REPORT_NUMBER")
arcpy.CopyFeatures_management(out_event_lyr_join, os.path.join("%scratchFolder%\Geodatabase", gdb_name, out_event_fc1)) We changed the script to do a CopyFeatures instead of TableToTable to see if that would work but I get a different error: ExecuteError: ERROR 000210: Cannot create output Z:\opt\esri\arcgis\server\usr\directories\arcgisjobs\export\download_v3_1_gpserver\j46744155824f44e1ad5f7c1a1a6afc71\scratch\Geodatabase\s4_mapped_crashes_gdb.gdb\att
Failed to execute (CopyFeatures). Here is the CopyFeature version: x_coords = "S4_X"
y_coords = "S4_Y"
out_event_lyr = "event_layer"
v_scratchFolder_ = "%scratchFolder%"
Geodatabase = v_scratchFolder_
s4_crash_gdb_gdb = Geodatabase
# create Folder
x = arcpy.CreateFolder_management(v_scratchFolder_, "Geodatabase")
arcpy.AddMessage(x)
# create File GDB
arcpy.CreateFileGDB_management(x, gdb_name)
wkt = "PROJCS['NAD_1983_HARN_Florida_GDL_Albers',GEOGCS['GCS_North_American_1983_HARN',DATUM['D_North_American_1983_HARN',SPHEROID['G RS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Albers'],PARAMETER['False_Easting',400000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-84.0],PARAMETER['Standard_Parallel_1',24.0],PARAMETER['Standard_Parallel_2',31.5],PARAMETER['Latitude_Of_Origin',24.0],UNIT['Meter',1.0],AUTHORITY['EPSG',3087]]"
sr = arcpy.SpatialReference()
sr.loadFromString(wkt)
# create GIS file in geodatabase
out_event_lyr = arcpy.MakeXYEventLayer_management(input_rows, x_coords, y_coords, out_event_lyr, sr)
crash_fc = arcpy.CopyFeatures_management(out_event_lyr, os.path.join("%scratchFolder%\Geodatabase", gdb_name, out_event_fc))
crash_fc_lyr = arcpy.MakeFeatureLayer_management(crash_fc, "fc_lyr")
out_event_lyr_join = arcpy.AddJoin_management(crash_fc_lyr, "REPORT_NUMBER", event_rows, "REPORT_NUMBER")
arcpy.CopyFeatures_management(out_event_lyr_join, os.path.join("%scratchFolder%\Geodatabase", gdb_name, out_event_fc1)) My ArcGIS and Python skills are pretty rudimentary so I'm struggling trying to figure out what the issue is. I've been at it for almost 2 weeks! Doesn't seem like an unreasonable task I'm trying to accomplish but it has me stumped. What am I missing?
... View more
11-02-2022
08:34 AM
|
0
|
2
|
357
|
POST
|
I need to do this exact same thing. Any suggestions?
... View more
06-28-2012
07:25 AM
|
0
|
0
|
206
|
POST
|
I have made a customization to the US Streets locator style for our application. We've changed "SR" to map to "STATE ROAD" instead of "HC" in the us_addr.cls file in the C:\Program Files (x86)\ArcGIS directory. When I run StanEdit, it maps "SR" correctly. When I do a test in ArcMap using the Geocoding Standardize Addresses tool, picking the the US Streets with City, State, Zip and AltName, it works correctly also. I've created a locator in ArcCatalog using the US Streets with City, State, Zip and AltName style and registered it on my local server (which is the same machine I did the above testing on). When I run the batch geocoding tool using that locator or use the Find Address tool, it maps "SR" to "HC". So I'm thinking that I'm not editing the correct us_addr.cls file. But I have no idea where the locator is pulling from. Is there any documentation anywhere (besides the Geocoding Rule Base Developer Guide - been all thru that) that explains how to modify the locator syles? We are running ArcGIS 9.3.1 SP 2.
... View more
03-09-2011
06:21 AM
|
0
|
1
|
719
|
POST
|
This is from an old discussion I found about adding an autonumber to sde geodatabase. "You can't use DBMS level autonumbering on SDE versioned feature classes. Since edits actually occur in the delta tables, and aren't pushed to the business table until compression occurs, new numbers wouldn't be assigned until compression time (and this type of implementation would like cause compression to fail). You need to implement your numbering using ArcObjects (or wait until 9.2 which will support editing of non-versioned feature classes which will allow you to to rdbms sequence generation for stand alone feature classes)." Could someone explain how to do what is mentioned in the parenthesis at the end of the paragraph? This sounds like exactly what I need. I am developing in C#.
... View more
04-15-2010
04:53 AM
|
0
|
0
|
585
|
Online Status |
Offline
|
Date Last Visited |
11-08-2022
10:01 AM
|