Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to select point feature classes in a feature dataset and merge them while setting the XYDomain using Python. If I do the merge manually and change the environment settings to use a feature class that encompasses the point data, all works well. However, I have many more geodatabases within this project that I'd like to do the exact same thing to. Using the code below, I get error 000594. I have also tried changing the xyDomain to point to a shapefile but that did not work either.

import arcpy
from arcpy import env
arcpy.env.XYDomain ="-5120900 -9998100 900714804574 900709927374"
env.workspace = "Q:\Project_Data\WSWS 2012 #660\WSWS_4.gdb\ALABAMA_GPS"
fcList = arcpy.ListFeatureClasses('','POINT','')
arcpy.Merge_management(fcList, "MergePNT6")

Code that worked:

import arcpy
from arcpy import env
arcpy.env.XYDomain ="-5120900 -9998100 900714804574 900709927374"
arcpy.env.outputMFlag = "Disabled"
env.workspace = "Q:\Project_Data\WSWS 2012 #660\WSWS_4.gdb\ALABAMA_GPS"
fcList = arcpy.ListFeatureClasses('','POINT','')
arcpy.Merge_management(fcList, "MergeOutputName")
share|improve this question
2  
the domain is already set on the feature dataset and cannot be modified by python. The domain environment only applies to standalone feature classes. Try changing your workspace to Q:\Project_Data\WSWS 2012 #660\WSWS_4.gdb. Note the '#' may cause problems in the path name. –  Michael Miles-Stimson Apr 16 at 21:58
    
After much review, I did find out that it wasn't my XY Domain that was giving me the merge problem, it was my M Values settings. If Disabled, my merge worked fine. As this too, is a Toolbox environment setting, I still needed to figure out how to do this programmatically. I did find that I could change or set the environment settings to both using Python. Above is the code I used successfully. Remember your XY Domain will be different. I recommend using the extent coordinates of your largest boundary. In my case I used the project boundary –  user29293 Apr 18 at 16:16
    
set the M domain help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… arcpy.env.MDomain = "0 10000000" to set the Z domain help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/… also arcpy.env.outputMFlag = 'Disabled' help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… turns of M, a similar one exists for Z. –  Michael Miles-Stimson Apr 19 at 2:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.