|
POST
|
tbh, I posted the wrong help the first time too and had to go correct myself, its easy to get the regular and data access cursors mixed up.
... View more
07-28-2014
01:49 PM
|
0
|
2
|
1458
|
|
POST
|
Anthony, he is calling the value of one field he is accessing with cursor with his index. You posted help for the old cursor, not the data access cursor, for which his syntax should be fine, since it takes a feature class name, and field(s) which he has(assuming his feature is called "Table") He isn't looping through multiple fields, just the one field.
... View more
07-28-2014
01:40 PM
|
1
|
4
|
1458
|
|
POST
|
you probably need this after row[0] = goodtext rows.updateRow(row) ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
07-28-2014
01:32 PM
|
0
|
1
|
1458
|
|
POST
|
V Stuart Foote you usually know a good bit about this kind of stuff, got any advice?
... View more
07-25-2014
01:32 PM
|
0
|
0
|
2208
|
|
POST
|
I'd just use a backslash as an escape character, that way it doesn't try doesn't crash since there isn't a second single quote to end the string. var = ["\'Name"] Generally it not advisable to have special characters in field names, or to have them start with numbers.
... View more
07-25-2014
11:19 AM
|
0
|
1
|
1783
|
|
POST
|
Thats true, but the changes that need to be made are not very major. While it would be best if the bug was addressed, I was merely suggesting this a workaround.
... View more
07-25-2014
11:15 AM
|
0
|
4
|
2883
|
|
POST
|
Could you convert the model to a python script then turn the script into a script tool? That way you would still have an GUI to work with, but it shouldn't run into the same error as running it as a regular tool.
... View more
07-25-2014
10:56 AM
|
1
|
6
|
2883
|
|
POST
|
since you are calling a function on a field, there is no need for an equal sign, since you are not setting a variable in your expression. instead of fnfindstation=( !district!) try fnfindstation(!district!)
... View more
07-25-2014
10:02 AM
|
0
|
1
|
728
|
|
POST
|
NSF OpenTopography Facility | Home Another good resources for LIDAR data, does not cover as much area as the NOAA repository, but most of the data on the site should be directly downloadable, as opposed to having to inquire with an independent agency about receiving the data. In addition, there are free tools available for processing and viewing LIDAR data, some of which can be integrated directly into ArcGIS, some are standalone. Site is supported by the NSF, Arizona State University, and University of California San Diego.
... View more
07-25-2014
09:40 AM
|
2
|
1
|
1139
|
|
POST
|
Have you tried using a data access cursor(arcpy.da.SearchCursor)? Its significantly faster than the old cursor. Also, your current cursor uses all fields, which takes mroe time, you can specify only the geometry field, which should cut down processing time. I don't see how using any geoprocessing tools would speed things up. for arcpy.da.SearchCursor usage and syntax: ArcGIS Help 10.1
import arcpy
# Input point coordinates
locX = 1303479.87779
locY = 485423.249288
dataMxdPath = r"C:\Projects\Parcels.mxd"
dataMxd = arcpy.mapping.MapDocument(dataMxdPath)
parcelsLayer = arcpy.mapping.ListLayers(dataMxd, "Parcels")[0]
point = arcpy.Point(locX, locY)
with arcpy.da.SearchCursor(parcelsLayer, ["SHAPE@"] ) as cursor:
for row in cursor:
polygonGeom = row[0]
if polygonGeom.contains(point):
print row.OBJECTID
break
Also I added the with statement for memory's sake. Your original code doesn't delete the cursor object after the script ends, but the with takes care of that.
... View more
07-24-2014
12:28 PM
|
3
|
3
|
1721
|
|
POST
|
Hi Mehrshad, First off, you never define what your mxd variable is. To use the arcpy.mapping.ListLayers, you need to make a map document object which you can call the ListLayers on. Use mxd = arcpy.mapping.MapDocument(r"Filepathtoyourmapdocumenthere") to create your MapDocument object first. Secondly, you are copying feature layers and making feature classes it seems, which is fine, but you shouldn't need the old = os.path.join(ws, layer), since feature layers are stored in memory and not on the hard drive. If you are referencing existing feature classes, then its fine as is. If not though I would take out the old = , and put in this CopyFeatures_management(layer.name, new) for your copy features statement. Also you would need to use that layer.name for checking agaisnt your dictionary. Hope this helps you out.
... View more
07-24-2014
11:16 AM
|
1
|
0
|
1908
|
|
POST
|
Hi Kevin, Actually, creating new layers wouldn't affect your gdb feature class at all. Layer's in the TOC are merely references to your existing data, so when you are creating layer files from them, you aren't actually editting or creating new files, just referencing different parts of them. You can save a .lyr to your harddisk but that just saves the symbology and definitions you assigned that layer, but it won't work without the original data. Are you trying to "group" for symbology purposes, or would you actually want to aggregate them into single features? If you want to symbolize the grouped polygons the same, either symbolize them by a common attribute from the attribute table, or you can create a new field to base your symbology off of, and use the field calculator to give all the ones in a group the same value(you would probably have to manually select them). Then under symbology, symbolize by category and select the filed you want ot base it off of. If neither of those is what you are looking for, give a little more detail on what you are trying to do and we can probably find a better solution. Ian
... View more
07-24-2014
08:13 AM
|
0
|
0
|
2687
|
|
POST
|
Hi again Subhasis, Is there any particular reason why you are using ESRI grids, instead of another raster format, which wouldn't have multiple folders, such as a .tif? If you want to to iterate over multiple rasters that are in seperate folders than have a common parent folders, you could use arcpy.da.walk, to iterate over them all in seperate folders, that way you wouldn't have to put all your info folders into a single folder. you can make a list of all the filepaths and names, then iterate over that list with your script(see example #2 in the link below) ArcGIS Help 10.1 - Walk (arcpy.da)
... View more
07-24-2014
07:54 AM
|
0
|
3
|
3728
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|