@@ -313,31 +313,31 @@ Parser.prototype.parseGeometryValue = function() {
313
313
function parseGeometry ( ) {
314
314
var result = null ;
315
315
var byteOrder = buffer . readUInt8 ( offset ) ; offset += 1 ;
316
- var wkbType = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
316
+ var wkbType = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
317
317
switch ( wkbType ) {
318
318
case 1 : // WKBPoint
319
- var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
320
- var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
319
+ var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
320
+ var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
321
321
result = { x : x , y : y } ;
322
322
break ;
323
323
case 2 : // WKBLineString
324
- var numPoints = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
324
+ var numPoints = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
325
325
result = [ ] ;
326
- for ( var i = numPoints ; i > 0 ; i -- ) {
327
- var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
328
- var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
326
+ for ( var i = numPoints ; i > 0 ; i -- ) {
327
+ var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
328
+ var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
329
329
result . push ( { x : x , y : y } ) ;
330
330
}
331
331
break ;
332
332
case 3 : // WKBPolygon
333
- var numRings = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
333
+ var numRings = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
334
334
result = [ ] ;
335
- for ( var i = numRings ; i > 0 ; i -- ) {
336
- var numPoints = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
335
+ for ( var i = numRings ; i > 0 ; i -- ) {
336
+ var numPoints = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
337
337
var line = [ ] ;
338
- for ( var j = numPoints ; j > 0 ; j -- ) {
339
- var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
340
- var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
338
+ for ( var j = numPoints ; j > 0 ; j -- ) {
339
+ var x = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
340
+ var y = byteOrder ? buffer . readDoubleLE ( offset ) : buffer . readDoubleBE ( offset ) ; offset += 8 ;
341
341
line . push ( { x : x , y : y } ) ;
342
342
}
343
343
result . push ( line ) ;
@@ -347,9 +347,9 @@ Parser.prototype.parseGeometryValue = function() {
347
347
case 5 : // WKBMultiLineString
348
348
case 6 : // WKBMultiPolygon
349
349
case 7 : // WKBGeometryCollection
350
- var num = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
350
+ var num = byteOrder ? buffer . readUInt32LE ( offset ) : buffer . readUInt32BE ( offset ) ; offset += 4 ;
351
351
var result = [ ] ;
352
- for ( var i = num ; i > 0 ; i -- ) {
352
+ for ( var i = num ; i > 0 ; i -- ) {
353
353
result . push ( parseGeometry ( ) ) ;
354
354
}
355
355
break ;
0 commit comments