When I run the script below in IDLE it gives the following output/
errors

Importing arcpy site package...
Setting workspace...
Z:\atGIS\training\Python_Alaska_Course\George\2
Please enter  output polygon shapefile name, including .shp
extensionggg.shp
Please enter longitude of lower left corner15
Please enter latitude of lower left corner20
Traceback (most recent call last):
  File "Z:\atGIS\training\Python_Alaska_Course\George
\2\2_Create_Tiled_polygons.py", line 19, in <module>
    origin = strX + ' ' + strY
TypeError: unsupported operand type(s) for +: 'float' and 'str'

-----------

When I run it in ArcCatalog
I
mporting arcpy site package...

Setting workspace...

Z:\atGIS\training\Python_Alaska_Course\George\2

Runtime error <type 'exceptions.EOFError'>: EOF when reading a line

I am just learning python and can't figure out what is causing
these ...

[code]
#Python script to create 24 map collars for 1:63,360 series quads
#
# import system module
print 'Importing arcpy site package...'
import arcpy,os

#set workspace environment
print 'Setting workspace...'
myPath = os.getcwd()
arcpy.env.workspace = myPath
print myPath

# Set output shapefile name:
outPolygonTheme = raw_input('Please enter  output polygon shapefile
name, including .shp extension')

# Set the origin of the fishnet
strX  = float(raw_input('Please enter longitude of lower left
corner'))
strY  = float(raw_input('Please enter latitude of lower left corner'))
origin = strX + ' ' + strY

#yaxis straight north:
yAxisCoordinate = strX + ' ' + strY +'.5' #half a degree north of
origin


# Each map collar is .5 wide, 0.25 degrees high
Width = '0.5'
Height = '0.25'

# Number of rows and columns
nRows =  '4'
nCols = '6'

# Each output cell will be a polygon
geometryType = 'POLYGON'
print '\n Creating polygons in ',outPolygonTheme,'....'
arcpy.CreateFishnet_management(outPolygonTheme, origin,
yAxisCoordinate, Width, Height, nRows, nCols, '#', '#', '#',
geometryType)
print arcpy.GetMessage(2)
print '\n Defining polygon theme coordsys as Geographic NAD27'
Projection = 'GCS_NAD_1927.prj'
arcpy.DefineProjection_management(outPolygonTheme, Projection)

print 'All Done...Good Bye'

[/code]

Reply via email to