1

Assume I have recorded the following values during a bike trip. One such dataset has been recorded every 5 seconds:

timestamp, longitute, latitude, pulse rate, pedal frequency

What is the best way to store them in a GeoDjango application? I thought about using a model similar to the following.

class Measurement(models.Model):
    comment = models.CharField()

class MeasurementPoint(models.Model):
    measurement = models.ForeignKey(Measurement)
    timestamp = models.DateTimeField()
    point = models.PointField(srid=4326)
    pulse = models.IntegerField()
    pedal = models.IntegerField()

This works and I can query the measurement points. But now I want to display the bike trip on a map, so I have to convert the individual points to a LineString. How is this done? And how would it bit possible to use different colors to highlight for example the pulse rate with different colors?

W. Alpha
  • 177
  • 1
  • 5

1 Answers1

0

Probably should store it into a file field as recommended here for timeseries data. The other option is to use a JSON field in Postgres.

ccsv
  • 8,188
  • 12
  • 53
  • 97