This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private GPSPoint gpsCentre(Collection<GPSPoint> points) { | |
float x = 0; | |
float y = 0; | |
float z = 0; | |
for(GPSPoint pt : points) { | |
final float lat = (float) pt.getLatitude(); | |
final float lon = (float) pt.getLongitude(); | |
x += Math.cos(lat) * Math.cos(lon); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Based on http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html | |
# Requires ffmpeg | |
filename="${1%.*}" | |
palette="/tmp/palette.png" | |
filters="scale=320:-1:flags=lanczos" | |
ffmpeg -v warning -i "$1" -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i "$1" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$filename.gif" |