|
POST
|
I like the cut of your jib, I'll have to try implementing this somewhere.
... View more
03-08-2012
01:18 PM
|
0
|
0
|
2402
|
|
POST
|
Can't test this right now, so this is a shot in the dark, but I'd try replacing these two lines. pidLIST.append(row.PID) exprPID="\"PID\""+"="+str(x) With these pidLIST.append(str(row.PID)) exprPID = "\"PID\" = " + x
... View more
03-08-2012
01:15 PM
|
0
|
0
|
981
|
|
POST
|
You don't need any of those quotes except around the "_layer". The below is all you need as long as your workspace is set. arcpy.SaveToLayerFile_management(inLayer, inLayer + "_layer")
... View more
03-08-2012
09:14 AM
|
0
|
0
|
859
|
|
POST
|
This should get you started. Will delete every n row. The cursor will honour selections so just make sure you reference the feature layer you have the selection on. import arcpy
flayer = #your feature layer with the selection, hardcode name or passed parameter
rows = arcpy.UpdateCursor(flayer)
count = 0
n = 10
for row in rows:
count += 1
if count == n:
rows.deleteRow(row)
count = 0 Deleting random rows while ensuring 10% is deleted is also possible, but would involve a bit more coding.
... View more
03-07-2012
11:55 AM
|
0
|
0
|
1281
|
|
POST
|
Would you want these shapes randomly selected or would every 10th shape in the selection be fine?
... View more
03-07-2012
11:05 AM
|
0
|
0
|
1281
|
|
POST
|
You can still use VBA for 10.0, 10.1 it will no longer be usable. VBA no longer comes prepacked with a standard 10.0 install, you can get a VBA license from Esri to activate it.
... View more
03-07-2012
09:32 AM
|
0
|
0
|
1998
|
|
POST
|
I would try making a tableview with a where clause. Make a list of your where clauses or create them on the fly depending on the complexity. You may have to convert your data to a different table type first, I don't believe csv is directly supported for this tool.
... View more
03-07-2012
04:33 AM
|
0
|
0
|
2332
|
|
POST
|
Yes, I would implement Marcin's change. Your original script is running through every feature you want to delete for every row in your dataset. Uneconomical to say the least.
... View more
03-07-2012
04:28 AM
|
0
|
0
|
1110
|
|
POST
|
I tested this one and it works. Make sure your file names are less than 13 characters. # Import system modules
import arcgisscripting, os
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Set local variables
InAsciiFile = None
inDir = r"C:\GIS\ascii"
OutRaster = "C:/GIS/Exports"
gp.outputCoordinateSystem = r"Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
for InAsciiFile in os.listdir(inDir):
if InAsciiFile.rsplit(".")[-1] == "asc":
print InAsciiFile
# Process: ASCIIToRaster_conversion
gp.ASCIIToRaster_conversion(os.path.join(inDir,InAsciiFile), os.path.join(OutRaster,InAsciiFile.rsplit(".")[0]), "FLOAT")
... View more
03-06-2012
04:33 AM
|
0
|
0
|
4747
|
|
POST
|
Also untested # Import system modules
import arcgisscripting, os
# Create the Geoprocessor object
gp = arcgisscripting.create()
# Set local variables
InAsciiFile = None
inDir = "C:/Data"
OutRaster = "C:/Data/data_2001"
gp.outputCoordinateSystem = "Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
for InAsciiFile in os.listdir(inDir):
if InAsciiFile.rsplit(".")[-1] == "asc":
print InAsciiFile
try:
# Process: ASCIIToRaster_conversion
gp.ASCIIToRaster_conversion(os.path.join(inDir,InAsciiFile), OutRaster, "FLOAT")
except:
pass
... View more
03-05-2012
12:39 PM
|
0
|
0
|
4747
|
|
POST
|
It depends on what you want to do. You can add field summary values in text boxes with an outline.
... View more
03-05-2012
11:57 AM
|
0
|
0
|
1070
|
|
POST
|
I meant the field type as integer. But that is really outside the scope of what you are doing here. You're where clause is still not formatted properly. This won't work unless your month is called "value" arcpy.MakeFeatureLayer_management(inFC, lyrname, "[survey_month] = value") This should work for you. where = "[survey_month] = " + str(value)
arcpy.MakeFeatureLayer_management(inFC, lyrname, where)
... View more
03-05-2012
11:43 AM
|
0
|
0
|
443
|
|
POST
|
Try posting the code you are using now with the tags so it is formatted properly. If it is just 1-12, you could just use an integer, but that is beside the point. Have you put an arcpy.RefreshActiveView() in after you add your layers?
... View more
03-05-2012
11:26 AM
|
0
|
0
|
2398
|
|
POST
|
Just an aside, ArcMap is a 32-bit process, so it will never use more than 4GB of memory with large address enabled on a 64-bit OS. I would assume you are using a 64-bit OS based on your total memory limit. The default I think is 2GB out of the box.
... View more
03-05-2012
11:06 AM
|
0
|
0
|
3148
|
|
POST
|
If it is a string field it will need to be formatted as such. Something like this should work. where = "[survey_month] = '" + value + "'" You can try building a sample query in arcmap to get your formatting down.
... View more
03-05-2012
11:00 AM
|
0
|
0
|
2398
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-17-2011 10:36 AM | |
| 1 | 08-16-2012 10:48 AM | |
| 1 | 10-31-2012 08:39 AM | |
| 1 | 07-16-2012 01:52 PM | |
| 1 | 03-15-2012 10:57 AM |
| Online Status |
Offline
|
| Date Last Visited |
08-22-2024
11:12 PM
|