how to set up automate from shapefile to sde feature class connection? Can it be command or other recommend? Please advise.
Thank you.
Hi Alexis,
You can use the feature class to feature class function via Python to automate converting a shapefile to an SDE feature class.
Feature Class to Feature Class—Help | ArcGIS Desktop
I set it up and it is working however how do i set it up every time I make change from shapefile to SDE feature class? I don't see change on SDE feature from shapefile. Am I missing something? For example, weekly Monday import shapefile from SDE feature class.
Alexis,
It sounds like Windows Task Scheduler offers the functionality that you're seeking.
Yes. This is what I am looking for. However, python script turned out an error when it tried to run. It is working fine inside ArcMap with Pyrhon window (arcpy)? I put overwrite the outputs of geoprocessing operations. It is succeeded. However, when I tried to run on Python script itself, it gave me an error. How can I fix it? See this message below.
I used script in ArcMap with Python Window and it succeeded:
import arcpyarcpy.env.workspace = "N:\_Alexis\GISData\Pubshp\CityHall.shp"arcpy.FeatureClassToFeatureClass_conversion("CityHall", "Database Connections\SDE.sde", "CityHall2")
This is used in python script I used the same from ArcMap and gave me an error when I tried to run it.
Traceback (most recent call last): File "N:\_Alexis\GIS ArcPy\TEST_CityHall2.py", line 5, in <module> "CityHall2") File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\conversion.py", line 1790, in FeatureClassToFeatureClass raise eExecuteError: ERROR 000258: Output Database Connections\SDE.sde\CityHall2 already existsFailed to execute (FeatureClassToFeatureClass).
It's important to keep in mind that enterprise geodatabases contain tables, not files, and that some of the usual practices which are casual about deletion and re-population in file-based storage mechanisms would be better off being redesigned to be less brutal on table elimination and creation in databases. For example, if the shapefile schema isn't changing with each release, using Truncate Table and Append would be less burdensome on the database, and would have the side effect of not needing an explicit delete or initializing the environment to permit target overwrite.
- V
I added it and there is no error message. I think it is working. Thanks!
import arcpyarcpy.env.overwriteOutput = Truearcpy.env.workspace = "N:\_Alexis\GISData\Pubshp\CityHall.shp"arcpy.FeatureClassToFeatureClass_conversion("CityHall", "Database Connections\SDE.sde", "CityHall2")
This is what I got result: It seems working.
>>> ================================ RESTART ================================>>> >>>
Do you know what script is it? What do you recommend to set up python script that included whole feature class like drawing and tables?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.