I have a table in a native SQL database (no geodatabase, dc_geobank_public.sde in the code) with cca. 300 000 records and 18 fields. Two of the field contains projected X and Y coordinates, and one field contains geometry with SQL geometry type. The spatial index is rebuilt regularly with default parameters in MS SQL Server. The projection code is EPSG:23700. Based on this data I would like to create and update a feature class in a geodatabase (dc_geobank_map.sde in the code) on a daily basis.
So far I have written the following script, and it does the job, but clicking on the table in ArcCatalog and using the "Create table... from XY data" runs 100 times faster. (The script runs for 6 hours, and the "Create table... from XY data" tool runs for 3 minutes). Here is the script:
#importing arcpy library import arcpy #define workspace, this is the native SQL database arcpy.env.workspace = r"C:\scripts\dc_geobank.sde" print "changed workspace!" #we let the script overwrite existing feature class arcpy.env.overwriteOutput = True print "output overwrite set!" #creating xy event layer from table arcpy.MakeXYEventLayer_management("geobank.dbo.FRS_fullos","EOV_X","EOV_Y","furasxy","23700") print "eventlayer ready!" #change workspace, that's where the feature class should be created, and THIS is a geodatabase arcpy.env.workspace = r"C:\scripts\dc_geobank_map.sde" print "changed workspace!" #convert event layer to feature class arcpy.CopyFeatures_management("furasxy","furas") #project the feature class to Web Mercator projection arcpy.Project_management("geobank_map.DBO.furas"","furasprojected","3857")
Anyone knows what the "Create feature class from XY data" tool might use that's so much faster? So far I am not making use of the geometry field, but I guess it should be useful.
EDIT: For better understanding of the issue: later on I would like to make a map service and a web mapping application based on this feature class. So my question:
How to make a feature class from the table faster?
I am on the 10.2.1 ArcGIS stack.