POST
|
If you are still baffled, there is a difference in inputs and how print statements work: print '"' + "'" + refLocator + "' " + "'" + primTbl + "'" + '"'
"'C:\Working Folders\GIS\Dashboard_UpdatesPSEG_Land.gdb\DM_AdjustedStreet_LN_Geocoding' 'Primary Table'"
x = '"' + "'" + refLocator + "' " + "'" + primTbl + "'" + '"'
x
'"\'C:\\Working Folders\\GIS\\Dashboard_UpdatesPSEG_Land.gdb\\DM_AdjustedStreet_LN_Geocoding\' \'Primary Table\'"' Another quick example: xyz = "x\ny\nz"
xyz
'x\ny\nz'
print xyz
x
y
z try this, minding the variable names: import os
old_gdb_name = "PSEG_Land.gdb"
old_path = os.path.join(Path, old_gdb_name)
old_path
'C:\\Working Folders\\GIS\\Dashboard_Updates\\PSEG_Land.gdb' and you can put this in as: old_path + " " + primTbl
'C:\\Working Folders\\GIS\\Dashboard_Updates\\PSEG_Land Primary Table' which should work according to the esri docs. They also have [[path, role], ...] listed, but I think if you are only using the single reference data as a primary table you won't need the list.
... View more
06-19-2013
06:34 AM
|
0
|
0
|
205
|
POST
|
Then why even bother with one a one step process since two is too many? Why not pay a geocoding service to get the data in point format? I think the time you spent replying to the thread was more than enough to complete a search and replace in excel or word. You cannot take raw data, run a locator, and expect magical results. Data integrity, in collection and analysis, is extremely important in achieving meaningful results in any project, even outside of the scope of GIS.
... View more
06-13-2013
07:15 AM
|
0
|
0
|
554
|
POST
|
Scrub your data before you geocode. Simply, in excel: highlight the column and Replace, Ctrl+H. Replace "/" with " / " (no quotation marks, but notice the spaces around the replacing value). Or replace "&" with " & ". You could run a update cursor with python to replace the values as well.
... View more
06-11-2013
01:02 PM
|
0
|
0
|
554
|
POST
|
What you get from esri: "The data is not accessible. It is likely either invalid or not available." I got this error from a permissions issue from an IDLE window (no arcmap/toolbox/catalog/toc). The SDE database connection doesn't give me access to view/edit/etc the feature classes, hence the not available error. Changing the path to something knowingly wrong gives the usual error000732:"...does not exist or not supported" Also had problems at home with Windows being wonky about permissions. edit: My admin guy just ran the script on the files I couldn't access
... View more
03-22-2013
12:52 PM
|
0
|
0
|
1306
|
POST
|
I don't know about Quick Export, but this exports a feature class to csv, with headers. import arcpy, csv
fc = "H:/GIS_Data/TEMP.gdb/points" #input feature class
rows = arcpy.SearchCursor(fc)
csvFile = csv.writer(open("H:/GIS_Data/csvfile.csv", 'wb')) #output csv
fieldnames = [f.name for f in arcpy.ListFields(fc)]
allRows = []
for row in rows:
rowlist = []
for field in fieldnames:
rowlist.append(row.getValue(field))
allRows.append(rowlist)
csvFile.writerow(fieldnames)
for row in allRows:
csvFile.writerow(row) *mostly stolen from here Thanks This works for the most part. Someone used degrees symbols and other odd characters and i'm having encoding/decoding issues.
... View more
06-23-2012
03:03 PM
|
0
|
0
|
369
|
POST
|
That would be what i posted above. Is there a special way to copy as python snippet? I tried this
arcpy.QuickExport_interop('S:\Tech\Greg_Mohler\pythonwork\gm_sw_py.gdb\SW_LINE CSV','S:\Tech\Greg_Mohler\pythonwork',"RUNTIME_MACROS,""APPEND,No,FIELD_NAMES,yes,SEPARATOR,"""","""",EXTENSION,csv"",META_MACROS,""DestAPPEND,No,DestFIELD_NAMES,yes,DestSEPARATOR,"""","""",DestEXTENSION,csv"",METAFILE,CSV,COORDSYS,,__FME_DATASET_IS_SOURCE__,false")
and I got this:
TypeError: QuickExport() takes at most 2 arguments (3 given)
... View more
06-22-2012
12:14 PM
|
0
|
0
|
369
|
POST
|
Hello, I'm looking to export a large feature class (55k+ records) to csv with headers. Can anyone help with how to set the parameters in python? Using Arcmap and looking in the results windows after setting parameters gives: CSV,S:\\Folder,"RUNTIME_MACROS,""APPEND,No,FIELD_NAMES,yes,SEPARATOR,"""","""",EXTENSION,csv"",META_MACROS,""DestAPPEND,No,DestFIELD_NAMES,yes,DestSEPARATOR,"""","""",DestEXTENSION,csv"",METAFILE,CSV,COORDSYS,,__FME_DATASET_IS_SOURCE__,false" This gives me what i need, but I would rather not open Arcmap. I've tried setting these items above a few ways to no avail. I just need the input, output, and headers to be written. From python with just input and output gives me a csv with no headers. Python 2.6 with arc10.0. Thanks for any help.
... View more
06-22-2012
11:17 AM
|
0
|
4
|
4452
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|