|
POST
|
I don't think it will since the field type is already defined. However, you can replace the null values as seen here. Then you should be able to make the new numeric field and use the field calculator and have <new field>=<old field> and then you should be able to find it for the quantities symbology.
... View more
06-06-2014
11:51 AM
|
0
|
0
|
7072
|
|
POST
|
That should be fine as long as all the values in the other fields are numbers. A double field type won't support any letters or symbols.
... View more
06-06-2014
10:45 AM
|
0
|
0
|
7072
|
|
POST
|
firstpnt = part[len(part) + 0] needs to be firstpnt = part[0] that will get the first value. prior he was doing len(part) - 1 to get the last one since python lists are 0 indexed, so it took the total number of entries( imagine 755 points the first with index 0, so the last would be index 754 and 755 - 1 = 754.)
... View more
06-06-2014
07:14 AM
|
0
|
0
|
1845
|
|
POST
|
I'm fairly certain that for the Quantities symbology, you must have a field that is a numeric type, that is to say Short Integer, Long Integer, Float or Double. I'm guessing you are using a text field, which won't show up as a possible selection for the quantities symbology. If all your data in your text field is numbers, then you should be able to make a new numeric field and set that field equal to the text field and symboloize off that field. Either that or if the field is a joined field, it will not show up, you need to make a new field and copy the values of the joined field to it.
... View more
06-06-2014
04:57 AM
|
1
|
1
|
7072
|
|
POST
|
Depending on how large the gaps are, you might want to try the Resample Tool (Data Management). Check the help to see which method to use
... View more
06-05-2014
12:30 PM
|
0
|
0
|
680
|
|
POST
|
Wayne I appreciate the further feedback, but I felt you had explained that as best you could before, and that was more of a question to any possible ESRI staff to comment about it if they had some insight into that issue. Also I appreciate the feedback on some good practices for coding the file locations with workspace and the os module. I'm a grad student with one class in python under his belt, with no prior programming experience so I always appreciate feedback on how I can improve my code. I've known of the os module for a while, but still getting use to the proper ways to use it. As with most things I went with what I knew first and ran into some errors, now I'm a bit more comfortable with that useful module and can apply it towards my work in the future.
... View more
06-05-2014
10:43 AM
|
0
|
0
|
484
|
|
POST
|
Rather ironically, I the work I was doing was at someone elses request, and they decided to have the list exported the other way, using the second layer as the selector. This made the script that much more annoying, since I have 1100+ features to go through instead of ~150. ArcGIS crashed out while running the script while using the interactive python window while going through the larger number of features, so this has been most useful in getting the script to work outside of ArcGIS, which is probably about 10x faster to boot. I'd rather have done it this way from the start, but that nagging error kept getting me. I would like an explanation though why a fully qualified file path is necessary, and why just connecting to the data with env.workspace caused an issue. Thank you Wayne for your help. I've been meaning to get back on this sooner if nothing else just to discuss this interesting problem, but I was out of town a few days and now your help has paid off big time.
... View more
06-05-2014
07:06 AM
|
0
|
0
|
3160
|
|
POST
|
I see the problem. You selected the iterate feature classes iterator, you need to select the iterate raster iterator. The output of that you should be able to connect to the dem to raster, as they are the correct data type for that tool.
... View more
06-02-2014
11:11 AM
|
0
|
0
|
1692
|
|
POST
|
Baden if you could post your model thus far, and a screenshot on what inputs you are using on your iterator, that would be helpful. Also all your raster need to be in the same folder, or if they are in subfolders, you need to select a parent folder in which they are located, and select the recursive option so it will iterate through all subfolders. Your iterator should be at the beginning of the model, with the folder that contains the rasters being the input. the output "Raster" from that should then be the input of the DEM to Raster tool. Hope this helps.
... View more
06-02-2014
09:19 AM
|
0
|
0
|
1692
|
|
POST
|
This sounds something similar to what happened in my thread here. If anything you have is running out of GDB, make sure you are usually a fully qualified pathname line (os.path.join etc etc). I have no idea if that is possibly related or not.
... View more
06-02-2014
09:10 AM
|
0
|
0
|
373
|
|
POST
|
Yes that can be done. I'd take a look at this so it would be something like df = arcpy.mapping.ListDataFrames(mxd, "#Yourmapdocumentnamehere") df.rotation = 3.5 Hope this helps!
... View more
06-02-2014
08:44 AM
|
0
|
0
|
1700
|
|
POST
|
ah, it seems the python script you included in the model is probably from arcgis 9.3 or prior, which used different syntax for certain tools then what is being used for 10.0 to current. the gp you see is the older version syntax they used. If you could post the python script that was included in the model, we could probably help you debug or update it so it can run for 10.0 - 10.2
... View more
06-02-2014
08:28 AM
|
0
|
0
|
1514
|
|
POST
|
You should just be able to convert the entire model to a python script which can be run outside of ArcGIS (you would still have to run it on a computer with ArcGIS licensing). In the model you simply need to go to Model>export>to python script. From there you probably could integrate it into whatever you need to make it an .exe file.
... View more
06-02-2014
05:38 AM
|
0
|
0
|
1514
|
|
POST
|
I know right? I was having the same issue with gdb feature classes in doing something similar on this thread I had to end up running my script in the interactive python window in ArcGIS on the shapefiles I brought into my map that I made converted from gdb feature classes. Perhaps making a feature layer first from your feature classes then running the select by location tool would work better?
... View more
05-30-2014
07:57 AM
|
0
|
0
|
1002
|
|
POST
|
Okay so not sure why this fixed it but it did. Originally I was using feature classes in a gdb, and I got this error on time second time through the for-loop. Runtime error Traceback (most recent call last): File "<string>", line 20, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer raise e ExecuteError: ERROR 000622: Failed to execute (Make Feature Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter in_features. I merely converted them to shapefiles and brought them into arcmap instead of the feature classes from a GDB and it worked after switching the selecting field name. There must be something about the gdb that puts some sort of lock it on for subsequent iterations where it does not for shapefiles. this is the code that ended up working
import arcpy
from arcpy import env
env.overwriteOutput = 1
arcpy.env.overwriteOutput = True
output = open(r"C:\Users\iamurray\Desktop\Output.csv", "w")
input1 = "TVA_Distributors"
input2 = "TVA_PSA_Zips"
outlayer2 = "TVA_PSA_Zips_Layer"
for item in range(0,162,1):
print item
arcpy.MakeFeatureLayer_management(input1, "TVA_Distributors" + str(item), "\"FID\" = " + str(item))
cursor = arcpy.da.SearchCursor("TVA_Distributors" + str(item), ["DISTRIBU_1"])
for row in cursor:
output.write(str(row[0])+ "\n")
print row[0]
del cursor
arcpy.SelectLayerByLocation_management(input2, "INTERSECT", "TVA_Distributors" + str(item), "", "NEW_SELECTION")
# Process: Make Feature Layer (2)
arcpy.MakeFeatureLayer_management(input2, outlayer2)
field = "ZIP"
cursor = arcpy.SearchCursor(outlayer2)
for row in cursor:
output.write(str(row.getValue(field))+ "\n")
print "The Current number of Distributors Processed is " + str(item)
arcpy.Delete_management("TVA_Distributors" + str(item))
arcpy.Delete_management(outlayer2)
del row
del cursor
output.close()
This is the code I used for the gdb feature classes which failed, the only changes made were changing FID to ObjectID and the range from 0,162,1 to 1,163,1
import arcpy
from arcpy import env
env.overwriteOutput = 1
arcpy.env.overwriteOutput = True
output = open(r"C:\Users\iamurray\Desktop\Output.csv", "w")
input1 = "TVA_Distributors"
input2 = "TVA_PSA_Zips"
outlayer2 = "TVA_PSA_Zips_Layer"
for item in range(1,163,1):
print item
arcpy.MakeFeatureLayer_management(input1, "TVA_Distributors" + str(item), "\"OBJECTID\" = " + str(item))
cursor = arcpy.da.SearchCursor("TVA_Distributors" + str(item), ["DISTRIBU_1"])
for row in cursor:
output.write(str(row[0])+ "\n")
print row[0]
del cursor
# Process: Select Layer By Location
arcpy.SelectLayerByLocation_management(input2, "INTERSECT", "TVA_Distributors" + str(item), "", "NEW_SELECTION")
# Process: Make Feature Layer (2)
arcpy.MakeFeatureLayer_management(input2, outlayer2)
field = "ZIP"
cursor = arcpy.SearchCursor(outlayer2)
for row in cursor:
output.write(str(row.getValue(field))+ "\n")
print "The Current number of Distributors Processed is " + str(item)
arcpy.Delete_management("TVA_Distributors" + str(item))
arcpy.Delete_management(outlayer2)
del row
del cursor
output.close()
And this was the error I was getting Runtime error Traceback (most recent call last): File "<string>", line 20, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer raise e ExecuteError: ERROR 000622: Failed to execute (Make Feature Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter in_features. I'm really curious why using the interactive python window that shapefiles would work and gdb feature classes would not. Both had the same names. The syntax had to be correct, because for the feature class code it would run the first iteration, but throw that error on the subsequent ones. With the shapefiles it ran through without a hiccup. In both instances the files were the only items in the TOC. When I attempt to run it outside of ArcGIS with env.workspace set to the gdb, or the file path hardcoded, it crashes with ERROR 000386. Traceback (most recent call last): File "C:\Users\iamurray\Desktop\Zipcode.py", line 31, in <module> arcpy.SelectLayerByLocation_management(input2, "INTERSECT", "TVA_Distributors" + str(item), "", "NEW_SELECTION") File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 6559, in SelectLayerByLocation raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000368: Invalid input data. Failed to execute (SelectLayerByLocation). >>> Similarly when I run it in the interactive window with env.workspace set or the file paths hard-coded it crashes with same error If I run it with just the file names with both feature classes brought into the dataframe it runs through the first time successfully and crashes with the error code from my first post. Runtime error Traceback (most recent call last): File "<string>", line 20, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 5748, in MakeFeatureLayer raise e ExecuteError: ERROR 000622: Failed to execute (Make Feature Layer). Parameters are not valid. ERROR 000628: Cannot set input into parameter in_features. When I try to run it with the shapefiles using env.workspace set to their folder location it crashes, since the input must be a feature layer or feature class. So I'm really curious how my only solution to this was to bring the shapefiles into the TOC as feature layers and run the program in the interactive python window using only that workspace. Wayne and Adam, thank you for your attempts to help on this, it did get my brain thinking in different ways and eventually got me to a solution.
... View more
05-30-2014
06:36 AM
|
0
|
0
|
3160
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|