MS SQL table with geometry field to feature class

المشرف العام

Administrator
طاقم الإدارة
I have a table in a native SQL database (no geodatabase) 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.Based on this data I would like to create and update a feature class 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.

#importing arcpy libraryimport arcpy#define workspace, this is the native SQL databasearcpy.env.workspace = r"C:\scripts\dc_geobank.sde"print "changed workspace!"#we let the script overwrite existing feature classarcpy.env.overwriteOutput = Trueprint "output overwrite set!"#creating xy event layer from tablearcpy.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 createdarcpy.env.workspace = r"C:\scripts\dc_geobank_map.sde"print "changed workspace!"#convert event layer to feature classarcpy.CopyFeatures_management("furasxy","furas")So that's it. Anyone knows what the "Create feature class from XY data" tool might use that's so much faster?

Or what are my other options? So far I am not making use of the geometry field. In general, what's the best practice with this?



أكثر...
 
أعلى