|
POST
|
I'm confused. If you know the file name, why not just substitute the file name for "_stanislaus.img"? import arcpy
import sys, os, string
from arcpy.sa import *
from arcpy import env
arcpy.env.workspace = "D:\Project\Stanislaus\Timeseries\NDVI"
LstRst = arcpy.ListRasters("*", "img")
for Rst in LstRst:
Img1 = string.find(Rst, "aug08_2010_stanislaus.img")
if Img1 > -1:
print Rst
Or, are you looking for how to substitute a variable into the file name? import arcpy
import sys, os, string
from arcpy.sa import *
from arcpy import env
arcpy.env.workspace = "D:\Project\Stanislaus\Timeseries\NDVI"
LstRst = arcpy.ListRasters("*", "img")
fileprefix = "aug08_2010"
for Rst in LstRst:
Img1 = string.find(Rst, fileprefix + "_stanislaus.img")
if Img1 > -1:
print Rst
... View more
01-17-2012
12:39 PM
|
0
|
0
|
1043
|
|
POST
|
The Near tool (requires ArcInfo) will calculate the distance from each line feature to the nearest in the other line feature class. If the coastlines are made of many different line features, either dissolve all of the coastlines from each coastline together or simply the sort the output of Near to get the minimum. I don't know of any built-in tool to calculate mean distance. It seems to me you'd have to use some sort of linear referencing (don't ask me how, though), or Python, to chop your coastlines at some regular interval, then use Near and Summary Statistics to find the distance from each segment to the nearest point on the other coastline.
... View more
01-16-2012
06:41 AM
|
0
|
0
|
12859
|
|
POST
|
My MdDlgHelp_xsl.xsl does not even include BackgroundImage as a variable. You can add it, though. Change the line: <xsl:variable name="BackgroundColor">White</xsl:variable> to: <xsl:variable name="BackgroundImage">url(H:\Docs\Thumbnails\Jasper Map_thumb.gif)</xsl:variable> *change the above url to point to your image. Now, find and change the following line: background-color: <xsl:value-of select="$BackgroundColor"/> to: background-image: <xsl:value-of select="$BackgroundImage"/> Finally, go into your tool properties and point the Stylesheet to your modified file.
... View more
01-09-2012
01:46 PM
|
0
|
0
|
1767
|
|
POST
|
Honestly, your example is unnecessarily complicated. All you need is a list of your feature classes (gp.listfeatureclasses), loop through them one by one, and use either Define Projection (if you're assigning a projection to the feature classes for the first time) or Project (if you're changing projections from one projection to another). You could also use Batch Project.
... View more
01-06-2012
12:10 PM
|
0
|
0
|
737
|
|
POST
|
From the example on this page: "The {wildcard} can be used to filter the list of feature classes or rasters. Combination of * and characters that will help limit the results. The asterisk (*) is the same as saying ALL. If no wildcard is specified then all feature classes or rasters, in the workspace, will be returned.
... View more
01-06-2012
10:43 AM
|
0
|
0
|
737
|
|
POST
|
Is there any case where [Previous] = 0? If so, ArcMap gets confused when dividing by 0 (I bet your cheap calculator does, too). Skip over 0s with the code block.
... View more
11-04-2011
01:54 PM
|
0
|
0
|
1654
|
|
POST
|
If you follow this paper closely, it tells you how you could literally type out a shapefile, byte by byte. Have fun! :rolleyes:
... View more
10-31-2011
12:39 PM
|
0
|
0
|
1400
|
|
POST
|
I'll go out on a limb and say you can't make a dBase file in the in_memory workspace. My understanding is that in_memory is like a GDB-lite (only GDB tables and feature classes allowed). I'd try deleting all ".dbf"s.
... View more
10-26-2011
01:21 PM
|
0
|
0
|
2299
|
|
POST
|
I'm actually surprised it gets past GetParameterAsText(4) (a string) which gets directly calculated into a Long field.
... View more
10-26-2011
08:38 AM
|
0
|
0
|
1253
|
|
POST
|
This may save you some time (still takes some, though): 1.) Create Thiessen Polygons from your towns (pics 1 & 2) 2.) Spatial Join the polygon attributes to the town table (transfers INPUT_ID from polygons to points) 3.) Join by INPUT_ID to transfer polygon areas to the points 4.) Select and export the points associated with the top 90% polygon areas (the largest polygons = the farthest apart towns). If you're brave you could rather just delete the smallest 10% points. 5.) Make new Thiessen Polygons from the new set of points 6.) Repeat until you reach an acceptable level of dispersion (I got to pic 3 & 4 in three interations)
... View more
10-25-2011
11:33 AM
|
0
|
0
|
5282
|
|
POST
|
Since your problem is regarding loops, indentation is important -> use the tags above the posting text box, and you'll be more likely to get a response.
... View more
10-21-2011
08:35 AM
|
0
|
0
|
1574
|
|
POST
|
I assume it's getting confused at your use of "row" for both cursors. Change one to something else (e.g. "row2").
... View more
10-19-2011
12:58 PM
|
0
|
0
|
1405
|
|
POST
|
I assume since it's in feet, you're working with State Plane Coordinate System, Lambert Conformal Conic Projection - which will introduce some area distortion but I doubt it would account for losing 29 acres, unless you are working way outside the standard parallels. Is this your projection, and are you within the standard parallels (e.g. the US)? If not, where is your area of interest and what projection are you using? Other than that, I'd suggest looking closely at your before and after acreages to be certain the numbers are what they should be (e.g. was the before area calculated in a static field, then geometry changed?).
... View more
10-19-2011
12:40 PM
|
0
|
0
|
1254
|
|
POST
|
Are the values off by a little (rounding, resolution, etc.) or a lot (wrong units)?
... View more
10-19-2011
11:34 AM
|
0
|
0
|
1254
|
|
POST
|
"def concat(first,last):\ if first == '':\ return !LAST_NAME!\ else:\ return !FIRST_NAME! + ' ' + !LAST_NAME!" You've passed the values of FIRST_NAME and LAST_NAME into variables called first and last. Also, I'm pretty sure you need to maintain proper Python indentation. So: "def concat(first,last):\
if first == '':\
return last\
else:\
return first + ' ' + last"
... View more
10-18-2011
09:33 AM
|
0
|
0
|
956
|
| 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
|