|
POST
|
You say it is working just fine in ArcMap, if Table to Table is working in ArcMap, then it will run as standalone as well (I use this all the time in my standalone scripts. however, some datasets don't support it, and CopyRows can often be used to achieve same result on these). Have you ran it in ArcMap, then after it finishes, Go to the Geoprocessing window, Results, expand Current Session and right-click on the Table to Table entry. Then pick, "Copy as python snippet". Then you should be able to paste that snippet directly in python as standalone or within ArcDesktop (might have to change paths/variable names). Sorry I can't be more help, but have never had the need for numpy stuff, don't know what the .solve, .getOutput results would look like, or what they contain. Without understanding what the "data" itself looks like/formatted, my input will be limited. R_
... View more
06-11-2013
02:23 PM
|
0
|
0
|
2294
|
|
POST
|
That really shouldn't be necessary. I'd try just adding a print statement after your refresh active view. That is all I have and it works fine. Well, without enough information, I was assuming that they are running this script outside of ArcMap, and not within the python window. Not sure in the python window, as I do all my python stand alone. When using arcpy.mapping in standalone, I absolutly have to do a mxd.save() before I export to pdf, or the export looks exactly like the one the last time I did a save regardless of the chages arcpy.mapping just made. also, you say you put a print statement after the refresh in yours, curious what adding a print statement after the refresh does? Print what, and how is it changing the output to pdf? R_
... View more
06-11-2013
02:12 PM
|
0
|
0
|
3296
|
|
POST
|
I was able to reproduce this as well. I didn't see anything logged in our system for this issue so I have submitted the following bug: [NIM092338 When using arcpy.MultipleRingBuffer_analysis with the dissolve parameter set to "None", it will fail with error ERROR 000466: \Temp\scratch.gdb\buffer0 does not match the schema of target. Failed to execute (Append).] Thank you for reporting this issue! Curious as to what type of data you tried this on. I have tried on a point, line, and polygon FGDB FC in both 32 and 64 py, and no matter what I change, I can not get the error you mention. All I seem to be able to get is successful <Result Obj>. R_
... View more
06-11-2013
01:58 PM
|
0
|
0
|
1938
|
|
POST
|
I don't see where you are assigning ODCM_LYR to anything, is that just missing from the posted code. also, if you are trying to convert from the numpyarray to FC, wouldn't that be NumPyArrayToFeatureClass instead of FeatureClassToNumPyArray ? R_
... View more
06-11-2013
01:44 PM
|
0
|
0
|
2294
|
|
POST
|
I was able to reproduce this as well. I didn't see anything logged in our system for this issue so I have submitted the following bug: [NIM092338 When using arcpy.MultipleRingBuffer_analysis with the dissolve parameter set to "None", it will fail with error ERROR 000466: \Temp\scratch.gdb\buffer0 does not match the schema of target. Failed to execute (Append).] Thank you for reporting this issue! Can you actually repeat this when filling out the command properly? i still can't make it happen in 10.1 sp1. R-
... View more
06-11-2013
01:12 PM
|
0
|
0
|
1938
|
|
POST
|
Is working just fine for me. Can not get it to fail with 32 and 64 bit IDE. buffering 6088 line features.
>>> import arcpy
>>> arcpy.env.overwriteOutput = True
>>> listTable1 = "\\\\mcflight01\\MCFlightData\\HGIS\\Data\\WCH.gdb\\WasteSites\WasteSitesLine"
>>> distances = [100,300]
>>> bufferunit = "Feet"
>>> arcpy.MultipleRingBuffer_analysis(listTable1,"C:/Users/rkzufelt/Documents/ArcGIS/Default.gdb/WasteSitesLine_MultipleRingB",distances,bufferunit,"distance","NONE")
<Result 'C:\\Users\\rkzufelt\\Documents\\ArcGIS\\Default.gdb\\WasteSitesLine_MultipleRingB'>
>>> I can not get it to work the way you have your distances in Also, if I try to set distances[0]= anything, I get list assignment index out of range error unless you have already assigned the list objects for the two index positions, in which case, no need to re-set them. The only snippet of your code that I can get python to accept without error is the bufferUnit= "feet". code example:
distances[0] = 100
distances[1] = 300
bufferUnit = "feet"
arcpy.MultipleRingBuffer_analysis(inFeatures, outFeatureClass, distances, bufferUnit,"","NONE")
Take a look at my code, and see if that works for you (substituting your data of course), R_ If still not working, other posts about this issue have had "corrupt" data sets. Once they cleaned them up, the errors went away. Might try on a smaller, "clean" data set and see if you can get it working.
... View more
06-11-2013
01:09 PM
|
0
|
0
|
1938
|
|
POST
|
Hello all , I am creating a map for each feature in a feature class . I export the map to pdf using python . When i open the map ,I see there are bits and pieces of line features . I suspect I am refreshing my activeview just before exporting the pdf . Before refresh process completes , export to pdf executes and gives me this problem . I am using ArcGIS 10 . Can anyone please help me
df = arcpy.mapping.ListDataFrames(mxd)[0]
df.extent = extent
arcpy.RefreshActiveView()
mxd.save()
arcpy.mapping.ExportToPDF(mxd,os.path.join(Report_Path,str(oid).upper()))
Have you tried to save the mxd before the export so that the changes you made take effect? R_
... View more
06-11-2013
11:40 AM
|
0
|
0
|
3296
|
|
POST
|
You didn't say if these are "your" files, or if you are loading them from elsewhere, but, KML files are just text files. If they are your files, You could look at one that displays the way you like, then copy/modify the symbology of the kml you want to change with any text editor. R_
... View more
06-11-2013
11:27 AM
|
0
|
0
|
1211
|
|
POST
|
Well, since you are going to be editing, you obviously are loading a FeatureService rather than a mapservice, you might look at the layer tag "mode" setting and possibly the "disableclientcaching" settings and see if you can get better results. http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag_overview/01m30000000p000000/ http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Dynamic_Tiled_Feature_and_Image_layer_types/01m300000053000000/ R_
... View more
06-11-2013
11:22 AM
|
0
|
0
|
1370
|
|
POST
|
You could do something like this:
import arcpy
# Overwrite pre-existing files
arcpy.env.overwriteOutput = True
# Local variables:
test_csv = "D:\\baks\\dont_use\\test.csv"
in_memory = "in_memory"
temp_gdb = "D:\\baks\\dont_use\\temp.gdb"
testHaul = "in_memory\\testHaul"
# Process: Table to Table
arcpy.TableToTable_conversion(test_csv, in_memory, "testHaul")
arcpy.TableToTable_conversion(testHaul, temp_gdb, "testHaul_nonnull", "\"COMMENT\" IS NOT NULL AND \"COMMENT\" <> '' AND \"COMMENT\" <> ' '")
arcpy.TableToTable_conversion(testHaul, temp_gdb, "testHaul_nulls", "\"COMMENT\" IS NULL OR \"COMMENT\" = '' OR \"COMMENT\" = ' '")
which would put your temp table in memory, which is much faster (since the expressions doesn't appear to work in table2table with csv files....another bug??), then convert to FGDB table using the expression on the second table2table. My data, COMMENT is the field I am testing for NULL. Actually, my expression tests if NULL, or if equal to blank or if equal to single space (all not valid data). So, when run, I get one table "testHaul_nonnull" with the all rows where COMMENT is not Null or blank. The last TableToTable is basically a reverse of the expression of the one before it. So, it will make a new table with all rows with COMMENT = null, blank, and single space as a new table with testHaul_nulls. You could also iterate through and use a cursor, put expression on the cursor, etc., but I think that would take longer. the above seems like a quick/easy way to get both the non nulls to a "clean" table you can use for input as well as a table with all the "errors" that were stripped out. R_
... View more
06-11-2013
11:13 AM
|
0
|
0
|
1556
|
|
POST
|
Wayne, now I need to figure out how to get it to check for null values.. Could probably do a TableToTable_conversion on your input file. the TableToTable allows an expression so you could only copy the rows without nulls/blanks to the new table (possibly in memory) and use that table for your input. Just a thought that doesn't need an if/then statement for each iteration. R_
... View more
06-11-2013
09:23 AM
|
0
|
0
|
4386
|
|
POST
|
It almost sounds to me like you have a corrupt python install. In python.exe, IDE, or the python window in ArcMap, I can not repeat. The only time I can get the ... is if I do a multiline entry ( IE, if this == "that":) or nested code. an import statement should never be "seen" as a multiline entry or nested code. Curious what happens if you type this: >>>print "testing" Do you get: >>>print "testing" testing >>> or do you get: >>>print "testing" ... If you get the latter, I would try a remove/re-install of your python. R_
... View more
06-10-2013
05:31 PM
|
0
|
0
|
772
|
|
POST
|
Often when things like this work in ArcMap, but not stand alone python, I find that it is because ArcMap converts needed layers/tables to featureLayers/featuretables on the fly, and is transparent to the user (what you pick from the dropdown in ArcMap is often a featurelayer, not the layer itself). When this happens, I just makeFeatureLayer (or makefeaturetable) in python first, then do my select on that. Not sure if you just edited these for posting, but if not, You might also need to update your paths. These look like they are "relative" to the map document scratch gdb or something, as they don't look "pytonic", so not sure it knows where to look/save. I.e., how does python know what drive/server/etc to look for the path "OD_Matrix\"? Is that r"C:\OD_Matrix\", r"\\servername\share\OD_Matrix\" or where? ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"
I have no experience in OD matricies, so not sure if I'm even in the ballpark here. But, In case this is your issue, R_
... View more
06-10-2013
05:19 PM
|
0
|
0
|
3217
|
|
POST
|
Often when things like this work in ArcMap, but not stand alone python, I find that it is because ArcMap converts needed layers/tables to featureLayers/featuretables on the fly, and is transparent to the user. When this happens, I just makeFeatureLayer (or makefeaturetable) first, then do my select on that. You might also need to update your paths. These look like they are "relative" to the map document scratch gdb or something, as they are not complete. ND = "your network dataset"
OD_Lines = "output location for table
Lines = r"OD_Matrix\Lines"
OD_Matrix = "OD_Matrix"
In case this is your issue, R_
... View more
06-10-2013
05:15 PM
|
0
|
0
|
3217
|
|
POST
|
Ok - I'm a beginner trying to figure out how to modify one of the scripts I located. The original script is designed to search a folder with MXDs and print out report off all the MXDs that contain a particular data source. I want to take this one step further - so if the data source is located then I would like to replace it. I tried adding this to the sample code - lyr.findAndReplaceWorkspacePath("dateSource", "newSource") #TH Testing mxd.save() #TH Testing The script runs but the change doesn't take place or if it does it isn't saved. Any help would be great. # Author: ESRI
# Date: July 5, 2010
# Version: ArcGIS 10.0 Final
# Purpose: This script will iterate through each MXD in a folder and report the
# name of each map document that contains a specific data source. The
# script is intended to run from a script tool that requires three
# input parameters:
# 1) A folder that contains the set of MXDs that will be searched,
# 2) A data source that you want to search for,
# 3) An output text file.
# The resulting text file will automatically open.
import arcpy, datetime, os
try:
#Read input parameters from GP dialog
folderPath = arcpy.GetParameterAsText(0)
dataSource = arcpy.GetParameterAsText(1)
output = arcpy.GetParameterAsText(3)
newSource = arcpy.GetParameterAsText(2)
#Loop through ech MXD file
mCnt = 0
for filename in os.listdir(folderPath):
fullpath = os.path.join(folderPath, filename)
if os.path.isfile(fullpath):
if filename.lower().endswith(".mxd"):
#Reference MXD
mxd = arcpy.mapping.MapDocument(fullpath)
#Determine if the data source exists within the data frames/map document
#If exist then update the datasource - TH Testing 06/05/2013
sCnt = 0
for df in arcpy.mapping.ListDataFrames(mxd):
layerList = []
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.supports("dataSource"):
if lyr.dataSource == dataSource:
lyr.findAndReplaceWorkspacePath("dateSource", "newSource") #TH Testing
mxd.save() #TH Testing
mCnt = 1
sCnt = sCnt + 1
)) Perhaps its due to trying to set it to a variable that hasn't been defined? Not sure the exact syntax for that command, but dateSource <> dataSource R_
... View more
06-10-2013
04:43 PM
|
0
|
0
|
2336
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-14-2026 04:00 PM | |
| 1 | 09-14-2022 07:53 AM | |
| 1 | 09-14-2022 08:23 AM | |
| 1 | 05-21-2026 08:53 AM | |
| 1 | 05-14-2026 04:28 PM |
| Online Status |
Online
|
| Date Last Visited |
Wednesday
|