mirror of
https://github.com/wavded/js-shapefile-to-geojson
synced 2024-11-23 06:24:55 +00:00
fix a problem of precision loss.
the previous code on reading floating point number will cause a precision loss on centimeters, found it when using.
This commit is contained in:
parent
6ee60833bc
commit
24467d76fd
@ -131,17 +131,14 @@ var win = self,
|
||||
t = this,
|
||||
val = 0.0;
|
||||
if(numBytes > 4){
|
||||
var i = Math.ceil(numBytes / 4);
|
||||
while(i--){
|
||||
var buff = [],
|
||||
o = t.offset,
|
||||
j = o + (numBytes >= 4 ? 4 : numBytes % 4);
|
||||
var buff=[]
|
||||
var o = t.offset,
|
||||
j = o + numBytes;
|
||||
while(j > o){
|
||||
buff.push(t.readByteAt(--j));
|
||||
numBytes--;
|
||||
t.offset++;
|
||||
}
|
||||
}
|
||||
var s = new Gordon.Stream(fromCharCode.apply(String, buff)),
|
||||
sign = s.readUB(1),
|
||||
expo = s.readUB(numEBits),
|
||||
|
Loading…
Reference in New Issue
Block a user