Revision 2126 branches/FMap_SLD/libraries/libFMap/src/com/iver/cit/gvsig/fmap/drivers/shp/DemoSHPDriver.java

View differences:

DemoSHPDriver.java
449 449
				}
450 450

  
451 451
				return ShapeFactory.createPolyline3D(elShape, pZ);
452
			case (SHP.POLYGON3D):
453
			bb.position(bb.position() + 32);
454
			numParts = bb.getInt();
455
			numPoints = bb.getInt();
456
			elShape = new GeneralPathX(GeneralPathX.WIND_EVEN_ODD, numPoints);
457
			tempParts = new int[numParts];
452 458

  
459
			for (i = 0; i < numParts; i++) {
460
				tempParts[i] = bb.getInt();
461
			}
462

  
463
			j = 0;
464

  
465
			for (i = 0; i < numPoints; i++) {
466
				p = readPoint(bb);
467

  
468
				if (i == tempParts[j]) {
469
					elShape.moveTo(p.x, p.y);
470

  
471
					if (j < (numParts - 1)) {
472
						j++;
473
					}
474
				} else {
475
					elShape.lineTo(p.x, p.y);
476
				}
477
			}
478

  
479
			double[] boxpoZ = new double[2];
480
			boxpoZ[0] = bb.getDouble();
481
			boxpoZ[1] = bb.getDouble();
482

  
483
			double[] poZ = new double[numPoints];
484

  
485
			for (i = 0; i < numPoints; i++) {
486
				poZ[i] = bb.getDouble();
487
			}
488

  
489
			return ShapeFactory.createPolygon3D(elShape, poZ);
490
			
453 491
			case (SHP.MULTIPOINT2D):
454 492
				bb.position(bb.position() + 32);
455 493
				numPoints = bb.getInt();
......
499 537

  
500 538
		switch (type) {
501 539
			case (SHP.POINT2D):
540
			case (SHP.POINT3D):
502 541
				auxType = auxType | FShape.POINT;
503 542

  
504 543
				break;
505 544

  
506 545
			case (SHP.POLYLINE2D):
546
			case (SHP.POLYLINE3D):
507 547
				auxType = auxType | FShape.LINE;
508 548

  
509 549
				break;
510 550

  
511 551
			case (SHP.POLYGON2D):
552
			case (SHP.POLYGON3D):
512 553
				auxType = auxType | FShape.POLYGON;
513 554

  
514 555
				break;
515

  
516
			case (SHP.POINT3D):
517
				auxType = auxType | FShape.POINT;
518

  
519
				break;
520

  
521
			case (SHP.POLYLINE3D):
522
				auxType = auxType | FShape.LINE;
523

  
524
				break;
525

  
526 556
			case (SHP.MULTIPOINT2D):
527
				auxType = auxType | FShape.MULTI;
528

  
529
				break;
530

  
531 557
			case (SHP.MULTIPOINT3D):
532 558
				auxType = auxType | FShape.MULTI;
533 559

  
......
537 563
		return auxType;
538 564
	}
539 565

  
566

  
540 567
	/**
541 568
	 * @see com.iver.cit.gvsig.fmap.drivers.VectorialFileDriver#initialize()
542 569
	 */

Also available in: Unified diff