I have inherited taking over and supporting and ArcSDE GIS database. We have a process that we must do every 6 months to export certain features from the ArcSDE database into shape files so that they can be imported into a Smallworld GIS data. Yeah, I know. Why is our company using two different GIS systems? Don't ask. This was already in place before I even got involved with all of this.

In any case, we have a set of Python scripts that are being used to join shape files to feature classes in the GIS database. We run the Python scripts via ArcMap via the Geoprocessing->Python console.

However, it only works if we log into our GIS server and run ArcMap from there. If we attempt to do this from outside the GIS server, then the resulting output shape file has the right number of records, but all the attributes are either zero (for number attributes) or null (for text attributes). Again, running this in ArcMap 10.0 sp4 on the ArcGIS server works. Running it from ArcMap 10.0 sp4 on say my local machine, which has access to the data and I can bring it up, results in the exported shape file having no attribute values.

My other question is, I don't understand all of the parameters passed into the arcpy.FeatureClassToFeatureClass_conversion function.

Here is an example from the script:

arcpy.FeatureClassToFeatureClass_conversion("AERIALTAP","C:\TGIS\Final","AERIALTAP","#","ID ID true false false 9 Long 0 9 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.ID,-1,-1;X X true false false 19 Double 10 18 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.X,-1,-1;Y Y true false false 19 Double 10 18 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.Y,-1,-1;REGION REGION true false false 4 Text 0 0 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.REGION,-1,-1;MAINT_RESP MAINT_RESP true false false 4 Text 0 0 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.MAINT_RESP,-1,-1;OBJECTID OBJECTID true false false 19 Text 0 18 ,First,#,C:\TGIS\First\AERIALTAP.shp,AERIALTAP.OBJECTID,-1,-1;STATUS STATUS true true false 50 Text 0 0 ,First,#,C:\TGIS\First\AERIALTAP.shp,TGIS.AE_STATUS.DESCRIPTION,-1,-1;LOCATION_S LOCATION_S true true false 50 Text 0 0 ,First,#,C:\TGIS\First\AERIALTAP.shp,TGIS.AE_LOCATION_SOURCE.DESCRIPTION,-1,-1","#")

I understand what the join calls are doing.

I understand the first three parameters into the conversion call (input feature class, output directory, output feature class name). The rest I have some sort of idea, but not completely sure. It definitely looks like it's mapping the input feature column to an output feature column. The "#" seems to be a definition of a delimiter between fields, but the rest confuses me.

I've searched the ArcSDE web site and nothing is very clear about it. I have yet to find an example like what I have.

Any help would be appreciate.

If I do just this it works, but that's without any joins defined:


This works. But once I enter the field mapping and the joins, forget it. It won't work unless I'm on the production ArcSDE GIS server.


It could be because absolute paths are mentioned in the field mapping. If you run the script on your own PC it would probably look for C:\TGIS... on your machine rather than the server. I don't know enough about field mappings or how the server deals with them to be certain or to suggest a fix, but I would be surprised if this wasn't an issue. Also, ESRI recommends creating a FieldMapping object instead of using a string. See http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00210000000s000000.

  • Thanks for the input. I do know that the C:\TGIS is pointing to a directory on my local machine as well. – bolski Dec 12 '13 at 15:21
  • Here is what we have to do. It's strange and I'm just learning all of this stuff, but we first create a map document. Then, we starting exporting certain layers to shape files to the c:\tgis\first directory. That's what the python script is accessing (or at least, that's what I'm assuming it is doing). Then, it puts the output into c:\tgis\final. I didn't write the scripts, someone else did and they are no longer at my place of work and we have no contact information for them. – bolski Dec 12 '13 at 15:24
  • In any case, I can try and see how to set up a FieldMapping object. I'm new to python and ArcSDE. We also have a huge number of tables that have to be exported and converted, hence the use of python to automate as much as possible. – bolski Dec 12 '13 at 15:25
  • Good luck, hope I helped! – aquavitae Dec 12 '13 at 16:27
  • It gave me some ideas, but I'd really like to know what it doesn't work anywhere except our production server. The database itself is on a different machine, but the ArcSDE service runs on the production server where the python scripts work. It seems like it can't "find" the data when on a non-ArcSDE production server. Not sure why as I have Soatuak Database Connection created and can see that data and export it directly. Just can't take the shape file and manipulate it to something else except on the prod ArcSDE server. Thanks anyways for your help. – bolski Dec 13 '13 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy