Live monitoring of ski tracks in Norway Cross-country skiing The - - PowerPoint PPT Presentation

live monitoring
SMART_READER_LITE
LIVE PREVIEW

Live monitoring of ski tracks in Norway Cross-country skiing The - - PowerPoint PPT Presentation

Live monitoring of ski tracks in Norway Cross-country skiing The problem Snow grooming Where does it occur and when? A spatiotemporal problem alreaday solved? Google, Runkeeper, Nike etc. Ski-specific solutions:


slide-1
SLIDE 1

Live monitoring

  • f ski tracks in Norway
slide-2
SLIDE 2

Cross-country skiing

slide-3
SLIDE 3

The problem

  • Snow grooming
  • Where does it occur and

when?

  • A spatiotemporal problem
slide-4
SLIDE 4

…alreaday solved?

  • Google, Runkeeper, Nike etc.
  • Ski-specific solutions: Skisporet.no ++
  • …why do it?
slide-5
SLIDE 5

Solution overview

Snow groomer + Tracking unit

Web Application

Server

slide-6
SLIDE 6

The solution

  • GNSS unit + network connection
  • A server
  • One developer
  • A bunch of open source projects
slide-7
SLIDE 7
  • 1. Tracking unit
  • Arduino
  • GPS/3G shield
  • Serial communication between the two
  • Wrote “C” application for Arduino
  • HTTP request to server
slide-8
SLIDE 8
  • 3D-printed case
  • Only (half-)useful thing I’ve done with it
slide-9
SLIDE 9
  • 2. Tracking server
  • Consume, store, analyze position updates => serve ski track info
  • PostGIS
  • Apache2
  • Libpq
  • Php

PostGIS Apache

slide-10
SLIDE 10

Presenting tracks and time

slide-11
SLIDE 11

Presenting tracks and time

  • One track can consist of many

segments

  • Two tracks can share segments
  • Segments can be split up into an

arbitrary number of sub-segments

  • Based on “temporal segmentation”

Segments TempSegments /w sub-segment

  • rder info

Track

slide-12
SLIDE 12

4D-data in PostGIS

  • Each position in the network

has X, Y, Z and M

  • Spatial + Temporal dimension
  • But not so easy to selectively

update M-dimension of MultPoint and MultiLinestring..

slide-13
SLIDE 13

PostgreSQL Extension

  • Quite easy if you keep to PL/PgSQL

“programming”

  • Put SQL file + Control file in:

/usr/share/postgresql/9.3/extension/

  • CREATE EXTENSION langeland
  • Voila – new functions
slide-14
SLIDE 14

Skitrack Extension

  • LS_BuildTimeline
  • LS_UpdateTimelineAtPoint
  • LS_NForMostRecentPoint
  • LS_SegmentMeanTime
  • +++
  • LS_SplitTimeline
  • Splits up LINESTRINGZM based on temporal aggregation
slide-15
SLIDE 15

Triggers

Raw positions X – Y – Z - Time Segment X – Y – Z - Time TempSegment X – Y – Z - Time

On insert Trigger: LS_UpdateTimeline on Segment table On update trigger: LS_BuildTempSegment Where SID = Segment.ID

slide-16
SLIDE 16

Getting the data

  • Simple REST API with PHP
  • /langeland/spatiotemporal => Returns all temporary segments as

geojson

  • /langeland/tracks => Returns the track metadata
slide-17
SLIDE 17
  • 3. Web client
  • Needs to visualize
  • Ski tracks themselves
  • Their temporal status
  • Leaflet – easy it use
slide-18
SLIDE 18

Displaying 4D segments

  • 1. Leaflet wont let us draw

linestring with varying colours

  • 2. This is why the temporary

segment table is needed

  • 3. Tiny, old server => would

rather preprocess than generate on the fly

slide-19
SLIDE 19

Deployment

  • November 2014
  • Installed and test OK!
  • Wait for snow
slide-20
SLIDE 20

Choices…

  • Call back tracker
  • (possibly?) fix and reinstall
  • Get new part on Ebay
  • $20
  • Install
slide-21
SLIDE 21

TK110

  • Manual makes no sense
  • Setup using SMS commands
  • Is working, but sends wierd

data

  • Server coding again..
slide-22
SLIDE 22
  • Written by Anton Tananaev from New Zealand
  • Supports pretty much every low-cost GPS tracker out there
  • Connects to MySQL, H2 and PostGIS
  • Now also allows you to use your cellphone
  • http://www.traccar.org/
slide-23
SLIDE 23

Server structure

PostGIS + Custom Extension Traccar Apache2 + libpq

New tracker Old tracker “H02” Port 5003 HTTP POST

slide-24
SLIDE 24

Web application

slide-25
SLIDE 25

Tracks

  • Segments simply dumped to map
  • For track objects:
  • Iterate over it’s temporary

segments

  • Append track colour to time bar
  • Add time + name
slide-26
SLIDE 26
slide-27
SLIDE 27

System overview

Track layer + Tracking unit

Server

Traccar PostGIS Apache2 Web application

slide-28
SLIDE 28

To summarize

  • Managed to create fully automated tracking system
  • Also learned: Cheap, optimized hardware from China can be better

than my hobby Arduino projects

slide-29
SLIDE 29

All thanks to really awesome FOSS(4G)

  • Traccar
  • PostGIS
  • Apache2
  • Leaflet
  • Arduino
slide-30
SLIDE 30

Thank you!

Kjartan Bjørset kjabjo@norkart.no @kjartanb