Wednesday, 8 November 2017

arcpy - Python script to read coordinate system of an input feature class?



How to read the coordinate system of an input feature class in python script.

How we can use "Describe()" function and tool validator for that purpose



Answer



you can do lots of things with Describe() function as Calvin mentioned like spatialReference.. get more information here.


import arcpy
dataset = r"c:\features.shp"
desc = arcpy.Describe(dataset)

extent = desc.extent
spatialReference = desc.spatialReference
name = desc.name

dataType = desc.dataType

i hope it helps you..


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...