2

Using ArcGIS 10.2 for Desktop, I have some Shapefiles which I have no idea why their Geometry column (shape) contain ZM! now I need to remove all those ZM and get a clean polygon instead.

I thought I can use the FeatureClassToShapefile_conversion() but not sure how to disabled both Output has Z Values and Output has M Values through following ArcPy

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inFeature = ["climate.shp"]
outLocation = "C:/output"

arcpy.FeatureClassToShapefile_conversion(inFeatures, outLocation) 
  • Set environment variable Z and M to disabled – FelixIP Aug 19 '15 at 21:41
  • Thanks FelixIP, this is exactly my questing! how can I do it? I didn't find any thing on ArcGIS Online Help, I know this is doable trough ArcToolbox but how in ArcPy? – Behseini Aug 19 '15 at 21:50
6

Try this:

arcpy.env.outputZFlag = "Disabled"   
arcpy.env.outputMFlag = "Disabled" 

Resources can be found here Z and M

  • 3
    It's also worth mentioning that the only way you can find out which environment settings a tool honors is to look at the Help file for a particular tool. There is a section on every tools help page called Environment listing which ones it honors. – Hornbydd Aug 19 '15 at 22:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.