Beispiel #1
0
func parse3Rat2(tag *tiff.Tag) ([3]float64, error) {
	v := [3]float64{}
	for i := range v {
		num, den, err := tag.Rat2(i)
		if err != nil {
			return v, err
		}
		v[i] = ratFloat(num, den)
		if tag.Count < uint32(i+2) {
			break
		}
	}
	return v, nil
}
Beispiel #2
0
// Get values written as big.Rat returns the result in a more sensible formatting.
func FormatGPS(t *tiff.Tag) float32 {

	Dec := make([]float32, 3)
	for count := 0; count < 3; count++ {

		Numer, Denom, _ := t.Rat2(count)
		// Add error checking somewhere?

		Dec[count] = float32(Numer) / float32(Denom)
	}

	DecGPS := float32(Dec[0]) + float32(Dec[1]/60) + float32(Dec[2]/3600)
	return DecGPS
	//DecGPS := Hours + Minutes/float32(60) + Seconds/float32(3600)
}