POST
|
vb function is: EXPAND ([Streams_rr2m],10,LIST,1.2 )
... View more
01-15-2011
02:17 PM
|
0
|
0
|
661
|
POST
|
OK, i will say you the story from the start, i want to make a (tip) to make a buffering raster by spatial analyst tool, so to make this, we must be open (Raster Calc) and then type this syntax in the field raster calc: EXPAND ([Streams_rr2m],10,LIST,1.2 ) it was made by vb, so tha spatial analyst command, EXPAND: it mean that fatten up the zones, which is reputed to be the raster equivalent of the vector produce BUFFER. so i just need only, if this proper syntax in Python field, i do not know this exactly. thank you
... View more
01-15-2011
12:03 PM
|
0
|
0
|
661
|
POST
|
Here is a python crash course for the field calculator (assuming ArcGIS 10): First of all python is just as easy as VB (if not easier). It's just a different language, so the syntax is not identical to VB. That means that you can't write VB in python, just as you can't write C++, Perl or C# in python, so yes you need to learn a little python to write python. Second: The field calculator is actually extending the python language with the notation of "fields names" just as it did with VB. In VB field calculator you quote field names with sqaure brackets: [field_name]. In python you do the same, but with exclamation marks instead: !field_name!. That is because square brackets already have a different meaning in python. Third: String formatting in python is much more powerful than i VB, and also very different from VB. To format a string in python one creates a "format string" and then use the format operator:
"This is a %s with the integer %d and the float %.4f" % ('format string', 42, 3.14159265) Fourth: To pick substring from a string, one use index and slicing:
"mississippi"[0] # -> "m"
"mississippi"[:4] # -> "miss" # End at the 4th character
"mississippi"[-4:] # ->"ippi" # Start is 4th from the right
"mississippi"[::-1] # -> "ippississim" # Stepping backwards
"mississippi"[1::3] # -> "iiii" # Start at 1, and step 3
So for some field calculator examples: To copy the contents from one field to another, just quote the source field name in exclamation marks:
!source_field!
To copy and format floating point numbers to a text field, use a format string:
"%.3f" % !source_float_field!
To fill a column with the time of day, formatted in 12 hour format: First check the "Show codeblock" checkbox, then in the Pre-Logic Script Code box enter the following:
import datetime
t = datetime.datetime.now()
Then in the calc field code box below enter the following:
t.strftime('%I:%M:%S %p) # See python help for strftime for details
Given a float field with POSIX timestamps (seconds since epoch). To convert that to a date and time string in ISO format (2010-01-15 06:43:12): in the pre-logic box enter:
import datetime
and in the calc window enter:
datetime.datetime.fromtimestamp(!time_stamp_field!).strftime('%Y-%m-%d %H:%M:%S')
Try these examples out and then come back with more specific questions about the Calculate Field functionallity. Also keep in mind that some people here (me included), might not be fluent in VB, so examples of what you expect specific VB code snippets to do is helpful. Thank u very much niklas.norrthon, i had tried to write the syntax again by following ur post,put the same problem had appeared again, so if you want to try this by urself, and what can i do with this expression for example Streams_rr2m],10,LIST,1.2)(vb) thank you very much again
... View more
01-15-2011
05:27 AM
|
0
|
0
|
1059
|
POST
|
I have ArcGis 10, i have tried to apply this syntax ("expand(" + inputGrd + ", 10, 'LIST', 1.2)"), but i have the same error. thank you
... View more
01-14-2011
09:56 AM
|
0
|
0
|
1059
|
POST
|
OK, thank you very much, for example, EXPAND([Streams_rr2m],10,LIST,1.2) INT([Ran_Ras] * 10) + 1 [Angles] * 57.296 so if you have any information about typing expressions by python plz help me, precisely (Raster Calculator operators and functions) thank you very much again for interesting and following my post
... View more
01-14-2011
08:50 AM
|
0
|
0
|
1059
|
POST
|
i have the same problem,how can i write expression by Python in Raster Calculator,i have many problem with applied expression (syntax) by Python, there were many different in VB and Python, so can any one help me how can i do it in Python....please
... View more
01-14-2011
04:39 AM
|
0
|
0
|
1059
|
POST
|
thank u very much, i do not make any change in direction configuration file, and i tried to work arcgis 10 data and still message error appears :confused:
... View more
12-06-2010
11:29 AM
|
0
|
0
|
1363
|
POST
|
i followed your steps and i found (direction)it marked:yes,it is work look at this pic and this
... View more
12-06-2010
08:03 AM
|
0
|
0
|
1363
|
POST
|
So for the last week or so, i have been working on a project, and have been able to generate directions in the past. However now every time i try to generate directions i receive the error "Failed to Generate directions. Network dataset does not support driving directions." I did this several times, didn't work: http://resources.arcgis.com/content/kbase?fa=articleShow&d=29034 The only thing that seems to work i just nuking my entire network dataset and recreating everything (which i absolutely do not want to do). I have restarted ArcGIS, repaired ArcGIS, everything seems fine. I am guessing somehow my network dataset has become corrupt? I am using ArcGIS 10 I have same this problem with arcgis10, please any 1 help me how to resolve this problem
... View more
12-05-2010
09:46 AM
|
0
|
0
|
1363
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|