RBTDevelopmentGroup / rivertools

scripts for generating GIS layers that represent rivers
GNU General Public License v3.0
4 stars 0 forks source link

Centreline fails with river banks possessing Z values #15

Open philipbaileynar opened 6 years ago

philipbaileynar commented 6 years ago

The centerline tool fails when the banks polygon layer has Z values.

When attempting to find the centroid of the banks the tuple returned has three values if the river banks shapefile includes Z values. The code then attempts to subtract this centroid from the banks vertices and fails because the shape of the numpy array is two dimensional whereas the tuple has three dimensions.

This problem can be overcome by changing line 27 to the following three dimensional tuple:

self.centroid = (self.centroid[0], self.centroid[1], 0.0)

This issue requires a more permanent solution to be found that works for both 2 and 3 dimensional ShapeFiles.