@@ -291,10 +291,10 @@ export class ServerGeometry {
291
291
CCWIdent . push ( 1 ) ;
292
292
areaArray . push ( polygon . getArea ( ) ) ;
293
293
}
294
- //根据面积排序
295
- ServerGeometry . bubbleSort ( areaArray , polygonArrayTemp , geoTopo , polygonBounds ) ;
296
294
//iServer 9D新增字段
297
295
if ( geoTopo . length === 0 ) {
296
+ //根据面积排序
297
+ ServerGeometry . bubbleSort ( areaArray , polygonArrayTemp , geoTopo , polygonBounds ) ;
298
298
//岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
299
299
// 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
300
300
// 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
@@ -324,27 +324,23 @@ export class ServerGeometry {
324
324
}
325
325
}
326
326
} else {
327
- //根据面积排序
328
- //ServerGeometry.bubbleSort(areaArray, polygonArrayTemp,geoTopo);
329
327
polygonArray = new Array ( ) ;
330
328
for ( let i = 0 ; i < polygonArrayTemp . length ; i ++ ) {
331
329
if ( geoTopo [ i ] && geoTopo [ i ] == - 1 ) {
332
330
CCWArray = CCWArray . concat ( polygonArrayTemp [ i ] . components ) ;
333
331
} else {
334
332
if ( CCWArray . length > 0 && polygonArray . length > 0 ) {
335
- polygonArray [ polygonArray . length - 1 ] . components = polygonArray [
336
- polygonArray . length - 1
337
- ] . components . concat ( CCWArray ) ;
333
+ polygonArray [ polygonArray . length - 1 ] . components =
334
+ polygonArray [ polygonArray . length - 1 ] . components . concat ( CCWArray ) ;
338
335
CCWArray = [ ] ;
339
336
}
340
337
polygonArray . push ( polygonArrayTemp [ i ] ) ;
341
338
}
342
339
if ( i == len - 1 ) {
343
340
var polyLength = polygonArray . length ;
344
341
if ( polyLength ) {
345
- polygonArray [ polyLength - 1 ] . components = polygonArray [ polyLength - 1 ] . components . concat (
346
- CCWArray
347
- ) ;
342
+ polygonArray [ polyLength - 1 ] . components =
343
+ polygonArray [ polyLength - 1 ] . components . concat ( CCWArray ) ;
348
344
} else {
349
345
for ( let k = 0 , length = CCWArray . length ; k < length ; k ++ ) {
350
346
polygonArray . push ( new Polygon ( CCWArray ) ) ;
@@ -406,10 +402,10 @@ export class ServerGeometry {
406
402
CCWIdent . push ( 1 ) ;
407
403
areaArray . push ( polygon . getArea ( ) ) ;
408
404
}
409
- //根据面积排序
410
- ServerGeometry . bubbleSort ( areaArray , polygonArrayTemp , geoTopo , polygonBounds ) ;
411
405
//iServer 9D新增字段
412
406
if ( geoTopo . length === 0 ) {
407
+ //根据面积排序
408
+ ServerGeometry . bubbleSort ( areaArray , polygonArrayTemp , geoTopo , polygonBounds ) ;
413
409
//岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
414
410
// 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
415
411
// 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
@@ -439,26 +435,23 @@ export class ServerGeometry {
439
435
}
440
436
}
441
437
} else {
442
- //根据面积排序
443
438
polygonArray = new Array ( ) ;
444
439
for ( let i = 0 ; i < polygonArrayTemp . length ; i ++ ) {
445
440
if ( geoTopo [ i ] && geoTopo [ i ] == - 1 ) {
446
441
CCWArray = CCWArray . concat ( polygonArrayTemp [ i ] . components ) ;
447
442
} else {
448
443
if ( CCWArray . length > 0 && polygonArray . length > 0 ) {
449
- polygonArray [ polygonArray . length - 1 ] . components = polygonArray [
450
- polygonArray . length - 1
451
- ] . components . concat ( CCWArray ) ;
444
+ polygonArray [ polygonArray . length - 1 ] . components =
445
+ polygonArray [ polygonArray . length - 1 ] . components . concat ( CCWArray ) ;
452
446
CCWArray = [ ] ;
453
447
}
454
448
polygonArray . push ( polygonArrayTemp [ i ] ) ;
455
449
}
456
450
if ( i == len - 1 ) {
457
451
var polyLength = polygonArray . length ;
458
452
if ( polyLength ) {
459
- polygonArray [ polyLength - 1 ] . components = polygonArray [ polyLength - 1 ] . components . concat (
460
- CCWArray
461
- ) ;
453
+ polygonArray [ polyLength - 1 ] . components =
454
+ polygonArray [ polyLength - 1 ] . components . concat ( CCWArray ) ;
462
455
} else {
463
456
for ( let k = 0 , length = CCWArray . length ; k < length ; k ++ ) {
464
457
polygonArray . push ( new Polygon ( CCWArray ) ) ;
0 commit comments