fix get_altitudes() again

This commit is contained in:
Laura Klünder 2017-11-18 13:56:25 +01:00
parent 7575605aae
commit 92749a5f16

View file

@ -150,7 +150,7 @@ class AltitudeArea(LevelGeometryMixin, models.Model):
return np.full((points.shape[0], ), fill_value=float(self.altitude))
slope = np.array(self.point2) - np.array(self.point1)
distances = np.sum(((points - np.array(self.point1)) * slope), axis=1) / (slope ** 2).sum().clip(0, 1)
distances = (np.sum(((points - np.array(self.point1)) * slope), axis=1) / (slope ** 2).sum()).clip(0, 1)
return self.altitude + distances*(self.altitude2-self.altitude)
@classmethod