Skip to content

Commit

Permalink
fix incorrect processing of negative latitude and longitude
Browse files Browse the repository at this point in the history
  • Loading branch information
cracoz committed Jun 26, 2018
1 parent e1e8212 commit cbacc4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func readUint16L(bs []byte, offset int) uint16 {
return uint16(bs[offset+1])<<8 + uint16(bs[offset])
}
func readN32L(bs []byte, offset int, coma int) float32 {
return float32(binary.LittleEndian.Uint32(bs[offset:offset+4])) / float32(math.Pow10(coma))
return float32(int32(binary.LittleEndian.Uint32(bs[offset:offset+4]))) / float32(math.Pow10(coma))
}
func readN16L(bs []byte, offset int, coma int) float32 {
return float32(binary.LittleEndian.Uint16(bs[offset:offset+2])) / float32(math.Pow10(coma))
return float32(int16(binary.LittleEndian.Uint16(bs[offset:offset+2]))) / float32(math.Pow10(coma))
}
func readString(bs []byte, offset int) string { // faster than `binary.BigEndian.Uint32`
i := offset
Expand Down

0 comments on commit cbacc4c

Please sign in to comment.