|
POST
|
enclose your code in code blocks (# in the html editor window) so that indentation can be checked. Include a screen grab so the whole field calculator dialog window can be checked for missing elements (like how you pass the field name to the function and to make sure that the Python radiobutton is checked on) also any further details on the field's properties (perhaps a wrong field type, precision or scale)
... View more
02-14-2011
11:26 AM
|
0
|
0
|
3462
|
|
POST
|
Kevin, perhaps the transfer from 9.2 to 10 is causing more of a problem (aka the switch from enumerations to python lists etc). The only thing that I can think of off hand is that 9.3 had an ARCGISHOME environment variable which no longer exists in 10. i used it frequently to import toolboxes that may reside there along with the system toolboxes, however, unless an alias was established, the method in V10 is a little more circuitous... ...code before
sub_folder = "ArcToolbox/Toolboxes/"
install_dir = arcpy.GetInstallInfo()['InstallDir'].replace("\\","/")
tbx_home = os.path.join(install_dir, sub_folder)
...code after unless I have missed something obvious
... View more
02-14-2011
10:59 AM
|
0
|
0
|
670
|
|
POST
|
the file has x/y coordinates of decimal degrees (aka unprojected, aka decimal degree data), it has a NAD 83 data, if it wasn't defined, then you can define it as a GCS NAD83 (in the unprojected coordinate system, north american datum section). The Z values will either be in feet (possible if in the US) or meters (possible in the US but almost guaranteed in the rest of the world...some countries and legacy datasets excepted). Once you have a defined coordinate system using the Define Projection tool, you then...and only then...may proceed to project it using the Project tools (either within the raster or vector section of the Data management tool, Projections and coordinate systems...yadditty, yaddity, yaddity...depending upon your version. I yearn for the days where you couldn't use a grid or shapefile unless it had a coordinate system defined...projection on the fly and weak warnings about coordinate systems not being defined, produce a lot of traffic on this forum, confusion amongst users (of many levels) and should be rectified within the software...rant over...give it a try and document your exact steps should any of the above fail to produce a dataset from which you can determine a slope grid. Good luck
... View more
02-14-2011
10:46 AM
|
0
|
0
|
4312
|
|
POST
|
John Good summary...distribute amongst your fellow students and keep a copy for yourself should you choose to go into teaching 🙂
... View more
02-12-2011
10:36 AM
|
0
|
0
|
878
|
|
POST
|
The only time you define the projection of a dataset is when it doesn't have one. You don't define it to what you want it to be, you must project it. If your data are indeed in decimal degrees, then you need to project it to a planar coordinate system such as UTM etc etc. When that is done, ensure that your Z values are the same as your X, Y units (eg meters) or apply the appropriate correction (ie feet to meters etc) before calculating slope
... View more
02-12-2011
01:33 AM
|
0
|
0
|
4312
|
|
POST
|
did you try out_file.appendPages(tmp_pdf) where out_file is an existing pdf and tmp_pdf is another one
... View more
02-11-2011
01:22 PM
|
0
|
0
|
1586
|
|
POST
|
are you sure float(%A%/%B%), will return what is needed if it casts the result using integer division? If you can't float(A) and/or float(B) (as one can in Python), I am not sure that the desired result will be returned ie
>>> a = 1
>>> b = 3
>>> float(a/b)
0.0
>>> float(a)/b
0.33333333333333331
>>> a/float(b)
0.33333333333333331
>>>
... View more
02-10-2011
03:23 PM
|
0
|
0
|
1640
|
|
POST
|
I am not sure what you need, but the demo below may be of some help or will further confuse the issue. It assumes that you have a bunch of functions (defs) that you want to call based upon some index number (or other dictionary structure), it doesn't do much but it demos what can be done.
def func1(inputs=None):
x = sum(inputs)
return "sum some numbers: ", x
'''
more functions
'''
def func5(inputs=None):
x_sq = 0
for x in inputs:
x_sq += x**2
return "sum of squares: ", x_sq
'''
more functions
'''
def func8(inputs=None):
return "hello from 8: ", inputs
'''
more functions
'''
a_list = [1,2,3,4,5,6,7,8,9,10]
inputs = "test inputs"
a_dict = {1:[func1([1,2,3]) ],
5:[func5([1,2,3])],
8:[func8("inputs to 8")]}
needed = [1,5,8]
for akey in needed:
if akey in a_list:
action = a_dict[akey]
print "\naction: ", action
... View more
02-10-2011
12:30 PM
|
0
|
0
|
830
|
|
POST
|
the online help files... http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html?TopicName=welcome where the following link was found... http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t000000mn000000.htm re: "my goal is to convert geodetic lat/lon coordinates into raster x,y coordinates" why don't you project the data to an appropriate projection? or am I missing something?
... View more
02-10-2011
11:46 AM
|
0
|
0
|
458
|
|
POST
|
done so you can see the logic
>>> a_list = [1,2,3,4,5,6,7,8,9,10]
>>> needed = [1,5,8]
>>> for aval in needed:
... if aval in a_list:
... print "found ", aval
...
found 1
found 5
found 8
>>>
you can also use dictionaries etc
... View more
02-10-2011
08:27 AM
|
0
|
0
|
830
|
|
POST
|
add two Double fields to the table with appropriate precision and scale and check out the topic on field calculations http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005s00000025000000.htm once the centroid X and Y are determined add the table in as an event layer using the X and Y fields...there are alternates that require different extensions or license levels, also check the various script sites for tools to convert poly* features to their centroid representations
... View more
02-07-2011
08:47 AM
|
0
|
0
|
1244
|
|
POST
|
detailed specifics are needed..aka source files...destination location and anything else you can provide...looks like a user error so far since I can't find any NIM's relating to this issue so far
... View more
02-03-2011
04:49 PM
|
0
|
0
|
666
|
|
POST
|
try exporting the file out to a shapefile with a simple name (ie x.shp) and see if the error persists
... View more
02-02-2011
05:06 AM
|
0
|
0
|
4463
|
|
POST
|
did you rule out putting in a value that you know would extend beyond the extents of your input layer?...then clip to your extents to limit the excess?
... View more
02-01-2011
05:34 PM
|
0
|
0
|
465
|
|
POST
|
check these two threads regarding Con statements http://forums.arcgis.com/threads/13219-Con-statement-error-in-raster-calculator?p=40419&posted=1#post40419 http://forums.arcgis.com/threads/21664-con-function-use-in-the-raster-calculator?p=70771&posted=1#post70771
... View more
02-01-2011
10:55 AM
|
0
|
0
|
353
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM | |
| 1 | 02-20-2020 02:55 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|