|
POST
|
Ahh, thanks, David. It doesn't look like this exists at 10.2.2.
... View more
05-31-2016
02:54 PM
|
0
|
1
|
5903
|
|
POST
|
Thanks, Rebecca. I wasn't aware that there was a right-click context menu for the Python window. My current "safety" method is to select my script and copy/paste to an external text editor in case of crash. I don't necessarily want to save script files for all my scratch scripts, and using "Save As..." I would still have to remember to do it before a crash. "Add to Results" only adds geoprocessing tool runs, and my scripts are generally more cursor-based, so that doesn't quite do what I need. In any case, I suppose the answer is to do the bulk of my work in a proper IDE that doesn't crash nearly as often as ArcMap, and also enables my compulsive "Ctrl+S" saving habit. edit: I'm still holding out hope that someone knows of a secret log file that records Python window activity.
... View more
05-31-2016
01:52 PM
|
0
|
1
|
5903
|
|
POST
|
Is there any way to retrieve Python code entered and executed in the Python window from a previous session, similar to Results? The situation is that I was debugging what evolved into a somewhat convoluted section of code, and then crashed ArcMap.
... View more
05-31-2016
11:12 AM
|
0
|
7
|
9837
|
|
POST
|
Your list of file extensions are four almost completely different things. .prj = a projection file specifying a coordinate system .map = never heard of this .tfw = a world file for positioning a tiff .tif = a raster (image) Luckily, both .prj and .tfw are plain text, so fairly easily to read through code.
... View more
05-30-2016
02:58 PM
|
1
|
0
|
6460
|
|
POST
|
The SearchCursor can only read a single file, so s should just be the lyr_source, if that's what you want to read.
... View more
05-27-2016
11:59 AM
|
0
|
1
|
2822
|
|
POST
|
I'm confused by this line, which apparently concatenates two full file paths together: s = (fullpath + lyr_source) Does this work differently with SDE paths than regular file paths?
... View more
05-27-2016
11:20 AM
|
0
|
3
|
2822
|
|
POST
|
Please post your entire script, exactly as it is, including the full error message.
... View more
05-27-2016
10:26 AM
|
0
|
15
|
2822
|
|
POST
|
Look closely at Blake's example for writing a path: workingDir = r"C:\temp" The r denotes a raw string, which means '\t' is not interpreted as a tab, as it otherwise would. Is this how you're writing your paths?
... View more
05-27-2016
09:12 AM
|
0
|
17
|
2822
|
|
POST
|
What is the error message? edit: if you want to write the value of the current row, reference it in the row object. csvwriter.writerow(row[0]) # would write the value in the first field in your field list
... View more
05-27-2016
08:46 AM
|
0
|
19
|
2822
|
|
POST
|
Yes, if you're reading a simple system file, like a CSV, you can do so using something like csv.reader. GIS feature classes are somewhat more complex and specific, so you need to use a cursor that knows how to crack into the file structure. One such cursor for reading a feature class table is a SearchCursor, although there are other options outside of arcpy. I'll just add an example why iterating through a file path string doesn't do much of anything: >>> s = r'C:\junk.shp' # the string itself is an iterable
... for char in s: # loop through the items in s
... print char # prints characters in s one at a time
...
C
:
\
j
u
n
k
.
s
h
p
... View more
05-26-2016
01:12 PM
|
1
|
3
|
8735
|
|
POST
|
I'm not quite sure what you're trying to achieve here. What is the variable 's' - a file path string? If so, Python won't know to open it and read it, you need to actually read the file or table, for example, with a SearchCursor.
... View more
05-26-2016
12:09 PM
|
0
|
5
|
8735
|
|
POST
|
If you're doing this for more than a few points, you can make a table of your coordinates, make an XY point event layer from the table, and then extract values to points (requires spatial analyst).
... View more
05-25-2016
11:45 AM
|
1
|
0
|
1466
|
|
POST
|
You should use ListFeatureClasses rather than ListFiles, because ListFiles will return all individual files from a shapefile (e.g. shp, and shx, and dbf, etc.). Also, as your code is now, you will overwrite your output KML over and over because you don't change the name on each iteration.
... View more
05-24-2016
01:08 PM
|
1
|
0
|
1611
|
|
POST
|
I would have guessed that you could change a graticule to DD, but it doesn't appear so. In that case, you can create a measured grid (second option in my image above) using WGS84 as the coordinate reference system. Then, if it's not already the default unit, change to DD in grid properties -> intervals tab. edit: just saw Neil's answer re: graticule label styles, which appears to work, although I could not force it to show decimal places for whole numbers (e.g. 122 vs. 122.00000). If that's not an issue for you, then that should also work. There seems to be more flexibility through grids, however.
... View more
05-24-2016
12:44 PM
|
2
|
1
|
4642
|
|
POST
|
Can you elaborate on how using the default values for a graticule (under data frame properties->Grids->New Grid...) doesn't work?
... View more
05-24-2016
11:29 AM
|
0
|
3
|
4642
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|