|
POST
|
Luke that appears to be the case, which appears to go against the documentation which suggests that X and Y would be assigned a value of none
>>> from arcpy import Point
>>> pnt = Point()
>>> print str(pnt)
0 0 NaN NaN
>>> | Methods inherited from arcpy.arcobjects.mixins.PointMixin: | | __init__(self, X=None, Y=None, Z=None, M=None, ID=None) | Point({X}, {Y}, {Z}, {M}, {ID}) which suggests that None is being translated to 0...perhaps ESRI could provide some rationale which I presume has something to do with None not being able to be represented as a numeric value for coordinates...go figure
... View more
12-09-2010
10:02 AM
|
1
|
0
|
4913
|
|
POST
|
Luke...a quick test...
# Globals
outputFeatureClass = r"c:\temp\donutdemo.shp"
coordList = [[[[0,0],[0,10],[10,10],[10,0],[0,0]],
[[1,1],[2,1],[2,2],[1,2],[1,1]],
[[8,8],[9,8],[9,9],[8,9],[8,8]],
[[8,1],[9,1],[9,2],[8,2],[8,1]],
[[1,8],[2,8],[2,9],[1,9],[1,8]]],
[[[10,10], [11,11], [12,10], [10,10]]]]
def main():
array = arcpy.Array()
point = arcpy.Point()
# Create a list to store the features
features = []
# Read the coordinates
for feature in coordList:
print "feature", feature
for part in feature:
for coordPair in part:
point.X = coordPair[0]
point.Y = coordPair[1]
array.add(point)
null_point = arcpy.Point()
array.add(null_point)
# Create the polygon object
polygon = arcpy.Polygon(array)
# Clear the array for the next feature
array.removeAll()
# Append to the feature list
features.append(polygon)
# Copy the features to an output feature class
arcpy.CopyFeatures_management(features, outputFeatureClass)
if __name__ == '__main__':
import arcpy
arcpy.env.overwriteOutput = True
main()
... View more
12-09-2010
08:06 AM
|
2
|
0
|
4913
|
|
POST
|
Karen check all syntax on the online help http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html?TopicName=welcome or for quick reference, launch your ide and use the following >>> from arcpy import sa >>> dir(sa) it will print a list and you will see what I mean
... View more
12-08-2010
02:30 PM
|
0
|
0
|
535
|
|
POST
|
begin by checking case which may be the issue http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000m8000000.htm isnull != IsNull
... View more
12-08-2010
12:22 PM
|
0
|
0
|
535
|
|
POST
|
can't comment on the whole problem but this line tsFolder = "D:\Timeseries_All" is going to cause problems since Python expects paths to be written as tsFolder = "D:\\Timeseries_All" or tsFolder = r"D:\Timeseries_All" or tsFolder = "D:/Timeseries_All" print it out as well, since you may be missing the required \\ or / in the full path/filename
... View more
12-08-2010
07:22 AM
|
0
|
0
|
791
|
|
POST
|
selections are only honored when a layer is the input, if you then need a summary operation on the same file, then do it on the featureclass on disk associated with the layer.
... View more
12-02-2010
01:58 PM
|
0
|
0
|
3295
|
|
POST
|
what is the aversion to using tools in ArcToolbox? they add the extra dimension of being used in models etc and the toolboxes and scripts are easily distributed...the only difference is clicking a button versus clicking a tool in terms of the interface
... View more
12-02-2010
01:14 PM
|
0
|
0
|
1053
|
|
POST
|
did you create a tool in arctoolbox which contains the 4 parameters as specified below folderLocation = arcpy.GetParameterAsText(0) # a folder which be required and an input parameter layerFile = arcpy.GetParameterAsText(1) # a layer which be required and an input parameter dfName = arcpy.GetParameterAsText(2) # a filename, required and input position = arcpy.GetParameterAsText(3) #a numeric value, index presumed to be short integer or are you getting a specific error message?
... View more
11-27-2010
10:29 AM
|
0
|
0
|
2516
|
|
POST
|
Sorry Cedric, don't have a 9.3.x installation here, acrpy does open up a whole new world which didn't exist in previous versions.
... View more
11-26-2010
02:07 PM
|
0
|
0
|
1309
|
|
POST
|
Cedric I haven't had much time to explore all the intricacies of arcpy but you could begin by exploring sa >>> from arcpy import sa >>> help(sa.Extent) provides some clues, if you know the extent that you need, then you can set it
... View more
11-26-2010
12:19 PM
|
0
|
0
|
1309
|
|
POST
|
perhaps print gp.GetMessages() should be unindented such as print gp.GetMessages()
... View more
11-26-2010
04:35 AM
|
0
|
0
|
1455
|
|
POST
|
Given Bill's interesting example, what is returned...and what should be considered a cluster given such a circumstance?
... View more
11-23-2010
04:02 PM
|
0
|
0
|
2161
|
|
POST
|
start here http://resources.arcgis.com/gallery/file/geoprocessing download every toolbox/document/presentation that is associated with python, open them up and learn Also, the online help files are generally pretty good once you get a sense of what is going on.
... View more
11-23-2010
12:51 PM
|
0
|
0
|
1991
|
|
POST
|
careful Chris, we don't want JB to get the idea that if he sides with you he can add his name to the BDFL list under the ESRI banner
... View more
11-19-2010
01:41 PM
|
0
|
0
|
812
|
|
POST
|
Are you trying to define the projection for a file that doesn't have a defined coordinate system or are you trying to project geographic data (aka decimal degree data) to some other coordinate system? If it is the former, then you need to find out from the source what the projection was before using the Define Projection Tool...if it is the latter, then select from the many projected coordinate systems that can be used for Canada or Ontario depending upon your needs (Project tool in Arctoolbox)
... View more
11-19-2010
12:14 PM
|
0
|
0
|
1302
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM | |
| 1 | 02-20-2020 02:55 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|