Revision 40424 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/AbstractPrimitive.java

View differences:

AbstractPrimitive.java
537 537
		return (byte[]) this.invokeOperation(OPERATIONS.CONVERTTOWKB, null);
538 538
	}
539 539

  
540
	public byte[] convertToWKB(int srs) throws GeometryOperationNotSupportedException,
541
			GeometryOperationException {
540
	public byte[] convertToWKB(int srs) 
541
		throws GeometryOperationNotSupportedException, GeometryOperationException {
542 542
		int subType = getGeometryType().getSubType();
543 543
		boolean is3D = subType == 1 || subType == 3;
544 544
		
......
547 547
			write = new WKBWriter(3);
548 548
		else
549 549
			write = new WKBWriter(2);
550
		return write.write(Converter.geometryToJtsWithSRID(this,srs));
550
		return write.write(Converter.geometryToJtsWithSRID(this, srs));
551 551
	}
552
	
553
	public byte[] convertToWKBForcingType(int srs, int type) 
554
		throws GeometryOperationNotSupportedException, GeometryOperationException {
555
		int subType = getGeometryType().getSubType();
556
		boolean is3D = subType == 1 || subType == 3;
552 557

  
558
		WKBWriter write = null;
559
		if(is3D)
560
			write = new WKBWriter(3);
561
		else
562
			write = new WKBWriter(2);
563
		return write.write(Converter.geometryToJtsWithSRIDForcingType(this, srs, type));
564
	}
565

  
553 566
	public String convertToWKT() throws GeometryOperationNotSupportedException,
554 567
			GeometryOperationException {
555 568
		return (String) this.invokeOperation(OPERATIONS.CONVERTTOWKT, null);

Also available in: Unified diff