Skip to content

Commit

Permalink
v.centerline: use integer division to ensure that indices are ints - …
Browse files Browse the repository at this point in the history
…second occurence
  • Loading branch information
mlennert committed Apr 17, 2020
1 parent 2022d67 commit 4922fb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grass7/vector/v.centerline/v.centerline.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def main():
ytemp.append(y[i])
xtemp.sort()
ytemp.sort()
xmedian[c] = (xtemp[(len(xtemp)-1)/2]+xtemp[(len(xtemp))/2])/2
ymedian[c] = (ytemp[(len(ytemp)-1)/2]+ytemp[(len(ytemp))/2])/2
xmedian[c] = (xtemp[(len(xtemp)-1)//2]+xtemp[(len(xtemp))//2])/2
ymedian[c] = (ytemp[(len(ytemp)-1)//2]+ytemp[(len(ytemp))//2])/2

# Create new line and write to file
if median and nb_lines > 2:
Expand Down

0 comments on commit 4922fb4

Please sign in to comment.