Select to view content in your preferred language

create new point from centroid grid

707
1
12-05-2012 06:42 AM
nimitz
by
Frequent Contributor
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:
###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
Tags (2)
0 Kudos
1 Reply
ArkadiuszMatoszka
Frequent Contributor
Hi,
Yes, error shows up because You don't have licence for this tool (Advanced is needed). I think simplest workaround would be using data access search cursor with Shape@centroid and insert cursor to create points.
Cheers.
Arek
0 Kudos