Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

create new point from centroid grid

$
0
0
Hey all,
I've been working on creating a point shapefile from the centroid of a polygon grid I created for mapbook purposes. I have a simple script that is coming back with this error:"Traceback (most recent call last):
File "C:\Users\RLong\Documents\NewPoint.py", line 19, in <module>
arcpy.FeaturetoPoint_management("GridIndex", "SamplesLoc", "Centroid")
AttributeError: 'module' object has no attribute 'FeaturetoPoint_management'"

Here is my code so far:
Code:

###Simple point shape file object for testing
###
###Import standard modules

import os, sys, math, arcpy, traceback, string, fileinput

###Setup your workspace or file you're going to use

from arcpy import env

arcpy.env.workspace = "C:/Users/RLong/GIS_Data/Conversions/GridIndex.shp"

###Setup Local variables
in_features = "GridIndex.shp"
point_location = "Centroid"
out_feature_class = "SamplesLoc"

###Create the points
arcpy.FeaturetoPoint_management("GridIndex", "SamplesLoc", "Centroid")

Could this error be coming up cuz I don't have arcinfo?

Any help is appreciated,
Randy

Viewing all articles
Browse latest Browse all 2485

Trending Articles