[Tutor] Problem in running script
dadfar.narguess at gmail.com
Tue Nov 1 22:47:02 CET 2011
I want to prepare a script in python that updates the attributes of the
crime incidents falling within the patrol zone. I have a point feature
class of crime incidents and a polygon feature class of patrol zone.
I used the getcount. method to take a count of the incidents in the current
layer as the script goes the each loop, returns an integer value, and adds
1. The update cursor then updates the “INCIDENT” field. The calculations to
be performed in order to determine the incidents per square mile are:
taking the Shape_area in meters and converting it to miles by dividing it
by the constant provided and then dividing the number of incident by the
converted shape area(in miles). The incidents per square mile will then be
used to rank the priority of graffiti incidents in each zone. This was done
with an” if/elif/else” statement where the first “if” is the “Top Priority”
and the rest of the ranks follow as they meet the conditions in the
consecutive statement. An update cursor is written into each of the
“if/elif/else” parts of the statement to update the “PRIORITY “ field while
the script is running through the current zone each time it loops.But I ran
to problem. Please let me know what I should change.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor