start implementing routing by creating new router

This commit is contained in:
Laura Klünder 2017-11-27 02:16:20 +01:00
parent 587b08a1e4
commit dd3a885749
14 changed files with 219 additions and 1735 deletions

View file

@ -162,7 +162,7 @@ class AltitudeArea(LevelGeometryMixin, models.Model):
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)
return self.altitude + distances*(self.altitude2-self.altitude)
return float(self.altitude) + distances*(float(self.altitude2)-float(self.altitude))
@classmethod
def recalculate(cls):