0

I am trying to create a custom tool that take x,y coordinates, buffers them and then puts them into a new feature class. Whenever I try to run the tool I get:

ERROR000732 Input Features: Dataset (x, y coordinates) does not exist or is not supported

Here is my script:

import arcpy
import os
point = arcpy.GetParameterAsText(0)
outputFC = arcpy.GetParameterAsText(1)
buffDist = arcpy.GetParameterAsText(2)
arcpy.Buffer_analysis(point, outputFC, buffDist)

Here is the error from the tool after the script is run:

enter image description here

enter image description here

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 23, 2017 at 20:57
6
  • Coordinates should be float. Could you try this ? Could you show your script ? Commented Sep 23, 2017 at 21:11
  • I have XY coordinates = Point, Output FC = Feature Class and BuffDist = Linear Unit.... Under data type in the parameter properties I do not see Float as an option. The only one that makes sense to me right now is Point. Commented Sep 23, 2017 at 21:52
  • Related: gis.stackexchange.com/questions/256402/… Commented Sep 23, 2017 at 22:07
  • Perhaps try with decimals. Commented Sep 23, 2017 at 22:23
  • Welcome to GIS SE! As a new user be sure to take the Tour. For questions that involve error messages we ask that you show us them in full using text rather than a picture so that they can be searched and also read easily on all devices. There is an edit button beneath your question which will enable you to do that and " and {} buttons that enables you to format any highlighted text nicely. Commented Sep 23, 2017 at 22:37

2 Answers 2

1

According to its help page, the Buffer operation requires a feature layer input. When an ArcPy error includes "does not exist or is not supported", and you're sure* the input exists, the remaining option is that it isn't the right type of input. In this case, you can't just pass two numbers -- Buffer was not programmed to be able to handle that.

You're going to need more code in your Python script to turn the point (x, y) into a Point geometry type, and possibly also turn it into a feature layer. I mentioned that in another answer, here (the bit about arcpy.Point).


* Being sure the input exists should include debugging with print(point) or arcpy.AddMessage(point) so your script shows you what it thinks the value of point is. Sometimes it's totally valid, sometimes it's not, and eliminating the easy possibilities saves time.

answered Sep 24, 2017 at 11:50
1

When you use GetParameterAsText, it is literally a string. The input to arcpy.Buffer_analysis requires, in your case, a Point. By converting the string input to a Point object, you should be able to get the tool to run:

point2 = point.split(" ")
point3 = arcpy.Point(float(point2[0]),float(point2[1]))
arcpy.Buffer_analysis(point3, outputFC, buffDist)

Now that I think of it, a quicker way would be to just use GetParameter instead of GetParameterAsText. This will leave your point input as a Point object.

answered Oct 1, 2017 at 4:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.