|
@@ -2,13 +2,13 @@ import math
|
|
from datetime import datetime, timedelta
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
from django.db import models
|
|
from django.db import models
|
|
-from django.contrib.gis.db.models.fields import PointField
|
|
|
|
|
|
+from django.contrib.gis.db.models.fields import PointField, PolygonField, LineStringField
|
|
from django.contrib.gis.measure import D
|
|
from django.contrib.gis.measure import D
|
|
from colorfield.fields import ColorField
|
|
from colorfield.fields import ColorField
|
|
|
|
|
|
class Marker(models.Model):
|
|
class Marker(models.Model):
|
|
timestamp = models.DateTimeField(unique=True)
|
|
timestamp = models.DateTimeField(unique=True)
|
|
- location = PointField(dim=2)
|
|
|
|
|
|
+ location = PointField(dim=2, srid=4326)
|
|
alt = models.FloatField("Altitude")
|
|
alt = models.FloatField("Altitude")
|
|
hdop = models.IntegerField(null=True, blank=True)
|
|
hdop = models.IntegerField(null=True, blank=True)
|
|
speed = models.FloatField("Speed in km/h", null=True, blank=True)
|
|
speed = models.FloatField("Speed in km/h", null=True, blank=True)
|
|
@@ -21,13 +21,17 @@ class Trip(models.Model):
|
|
endTime = models.DateTimeField()
|
|
endTime = models.DateTimeField()
|
|
name = models.CharField(max_length=255)
|
|
name = models.CharField(max_length=255)
|
|
description = models.TextField(null=True, blank=True)
|
|
description = models.TextField(null=True, blank=True)
|
|
|
|
+ totalTime = models.DurationField("Total duration", default=timedelta(0))
|
|
|
|
+ center = PointField(dim=2, srid=4326, default=None)
|
|
|
|
+ line = LineStringField(dim=2, srid=4326, default=None, null=True)
|
|
|
|
+
|
|
color = ColorField()
|
|
color = ColorField()
|
|
distance = models.FloatField("Distance in m", default=0)
|
|
distance = models.FloatField("Distance in m", default=0)
|
|
topSpeed = models.FloatField("Top speed in km/h", default=0)
|
|
topSpeed = models.FloatField("Top speed in km/h", default=0)
|
|
avgSpeed = models.FloatField("Average speed in km/h", default=0)
|
|
avgSpeed = models.FloatField("Average speed in km/h", default=0)
|
|
ascendHeight = models.FloatField("Ascend height in m", default=0)
|
|
ascendHeight = models.FloatField("Ascend height in m", default=0)
|
|
descendHeight = models.FloatField("Descend height in m", default=0)
|
|
descendHeight = models.FloatField("Descend height in m", default=0)
|
|
- movementTime = models.DurationField("Movement time", default=timedelta(0))
|
|
|
|
|
|
+ movementTime = models.DurationField("Movement duration", default=timedelta(0))
|
|
|
|
|
|
path = models.BinaryField("Path", default=bytes())
|
|
path = models.BinaryField("Path", default=bytes())
|
|
|
|
|
|
@@ -36,7 +40,7 @@ class Trip(models.Model):
|
|
|
|
|
|
|
|
|
|
class CensoredLocation(models.Model):
|
|
class CensoredLocation(models.Model):
|
|
- location = PointField(dim=2)
|
|
|
|
|
|
+ location = PointField(dim=2, srid=4326)
|
|
radius = models.IntegerField(default=800)
|
|
radius = models.IntegerField(default=800)
|
|
name = models.CharField(max_length=255)
|
|
name = models.CharField(max_length=255)
|
|
|
|
|