mirror of
https://github.com/wavded/js-shapefile-to-geojson
synced 2024-11-23 14:34:54 +00:00
Fix precision loss
PR: https://github.com/wavded/js-shapefile-to-geojson/pull/22
This commit is contained in:
commit
127facc607
17
stream.js
17
stream.js
@ -131,16 +131,13 @@ 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);
|
||||
while(j > o){
|
||||
buff.push(t.readByteAt(--j));
|
||||
numBytes--;
|
||||
t.offset++;
|
||||
}
|
||||
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),
|
||||
|
Loading…
Reference in New Issue
Block a user