I would like to create new shapefile layer or memory layer with one point with certain coordinates in ArcGIS 10.2 with Python Toolbox. Which function should I use? I wrote this code:
import arcpy
class Toolbox(object):
def __init__(self):
self.label = "Python Toolbox"
self.alias = ""
self.tools = [XY]
class XY(object):
def __init__(self):
self.label = "XY"
self.description = "Coordinates to point"
self.canRunInBackground = False
def getParameterInfo(self):
parameters = []
x = arcpy.Parameter(
displayName="X",
name="x",
datatype="String",
parameterType="Required",
direction="Input")
parameters.append(x)
y = arcpy.Parameter(
displayName="Y",
name="y",
datatype="String",
parameterType="Required",
direction="Input")
parameters.append(y)
return parameters
def isLicensed(self):
return True
def updateParameters(self, parameters):
return
def updateMessages(self, parameters):
return
def execute(self, parameters, messages):
x = float(parameters[0].valueAsText)
y = float(parameters[1].valueAsText)