|
POST
|
DatePart ("d", [date] ) works for me, calculating a text field from a date field. Maybe double check that the date field is actually a date field, and not text disguised as a date...?
... View more
04-05-2012
01:43 PM
|
0
|
0
|
2442
|
|
POST
|
What kind of file are you trying to select from? Your workspace is set to: "P:\CoWetlandTools\maps\distribution_maps_Johns_pytest" The file is: "counties_edited_datamergetest" ...which amounts to a file called "P:\CoWetlandTools\maps\distribution_maps_Johns_pytest\counties_edited_datamergetest" ...which is not any sort of feature class I know of. If it's inside a geodatabase, that should be in your workspace (e.g. "P:\CoWetlandTools\maps\distribution_maps_Johns_pytest.gdb" if that's what it's called). If it's a shapefile, that should be in the file name (e.g. "counties_edited_datamergetest.shp").
... View more
04-05-2012
01:30 PM
|
0
|
0
|
2135
|
|
POST
|
Does it happen to work if you change the name so it doesn't start with a number? I don't know about .flt or .tif, but some file formats don't like that. Also, does it work properly if you use the entire filename rather than relying on the workspace environment?
... View more
04-05-2012
01:18 PM
|
0
|
0
|
2589
|
|
POST
|
Numbers don't get quotes in SQL. And we had the quotes wrong anyways: field name gets double quotes, the whole thing is in single quotes. arcpy.SelectLayerByAttribute_management ("counties_edited_datamergetest", "NEW_SELECTION", ' " ' + species + ' " > 0') I'm pretty sure this is right (you have to have an even number of matching quotes): arcpy.mapping.ExportToJPEG(mxd, r"P:\CoWetlandTools\maps\" + species + ".jpg")
... View more
04-05-2012
01:08 PM
|
0
|
0
|
2135
|
|
POST
|
You need to feed in the variable (species) value. for species in speciesList:
#select counties each species is known to occur
arcpy.SelectLayerByAttribute_management ("counties_edited_datamergetest", "NEW_SELECTION", " ' " + species + " ' > '0'")
and... arcpy.mapping.ExportToJPEG(mxd, r"P:\CoWetlandTools\maps\" + species + ".jpg")
... View more
04-05-2012
12:38 PM
|
0
|
0
|
2135
|
|
POST
|
"The file must have a .flt extension. There must be a header file in association with the floating-point binary file, with a .hdr extension." Does your .flt have an associated .hdr file?
... View more
04-05-2012
08:03 AM
|
0
|
0
|
2589
|
|
POST
|
A cursor "returns an enumeration object that will, in turn, hand out row objects". I'm not quite sure why (I started with Python in ArcGIS 10), but in 9.3 I think it likes "while row:" rather than "for row in rows:".
... View more
04-05-2012
07:32 AM
|
0
|
0
|
3272
|
|
POST
|
Check out cursors. Also, reading and writing geometries.
... View more
04-04-2012
12:11 PM
|
0
|
0
|
3272
|
|
POST
|
The arcpy Layer object has a property called FIDSet that is "A semicolon-delimited string of selected feature IDs (record numbers)." So, you should be able to test against that to either count selected or determine if any features are selected.
... View more
04-04-2012
12:05 PM
|
1
|
0
|
7290
|
|
POST
|
I'm not sure of a one-tool solution, but you can Merge the environmental datasets, then Identity (or Intersect) to find areas of overlap. I'm not sure if it would be lazy or ambitious or just silly, but you could also Union everything together and query through the mess of attributes it spits out.
... View more
04-04-2012
10:02 AM
|
0
|
0
|
984
|
|
POST
|
Don't you calculate the radius in the function 'select_parcels'? Return the distance... def select_parcels(layer, distance): while True: print_search_distance(distance) arcpy.SelectLayerByLocation_management(layer, "WITHIN_A_DISTANCE", layer, "%i Feet"%(distance),"NEW_SELECTION") if get_count(layer): r = arcpy.GetCount_management(layer) cnt = int(r.getOutput(0)) print "%i Features selected at a distance of %i Feet."%(cnt, distance) arcpy.AddMessage("%i Features selected at a distance of %i Feet."%(int(cnt),distance)) break layer = reselect(layer, selstring) distance += 25 return distance ## End select_parcels function And assign it to a variable ('radius')... if val <= 1.0: radius = select_parcels(layer, 300) elif (val > 1.0 and val <= 40.0): radius = select_parcels(layer, 600) else: radius = select_parcels(layer, 1200) edit: "distance of the final radius" - are you looking for the radius or circumference of your final circle?
... View more
04-03-2012
02:11 PM
|
0
|
0
|
1348
|
|
POST
|
As far as the SQL is concerned, look at the examples in the 'where clause' section on this page (basically, enclose it in quotes in your favourite manner). I don't know about the workspace question, but just try it one way and if it doesn't work, try it the other (takes less time than waiting for an answer).
... View more
04-03-2012
11:20 AM
|
0
|
0
|
681
|
|
POST
|
Greetings! Please try the following syntax: Con(IsNull("myraster"), FocalStatistics("myraster", NbrRectangle(2,2, "CELL"), "MEAN"), "myraster") Tarun, the only difference between your statement and cooperkn's is the additional of the units parameter ("CELL"), which is clearly labelled in the help pages as optional. Is this, in fact, not optional? If so, how does a person report errors in the help documentation? edit: nevermind, I found the feedback button. We'll see if it gets changed.
... View more
04-02-2012
12:58 PM
|
0
|
0
|
1847
|
|
POST
|
NbrRectang¬le(2,2) Is there really a strange character in there?
... View more
04-02-2012
12:40 PM
|
0
|
0
|
1847
|
| 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
|