Revision 38770
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/impl/DefaultGeometryManagerTest.java | ||
---|---|---|
401 | 401 |
return null; |
402 | 402 |
} |
403 | 403 |
|
404 |
/* (non-Javadoc) |
|
405 |
* @see org.gvsig.fmap.geom.Geometry#getInteriorPoint() |
|
406 |
*/ |
|
407 |
public Point getInteriorPoint() |
|
408 |
throws GeometryOperationNotSupportedException, |
|
409 |
GeometryOperationException { |
|
410 |
// TODO Auto-generated method stub |
|
411 |
return null; |
|
412 |
} |
|
413 |
|
|
404 | 414 |
} |
405 | 415 |
} |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/AbstractPrimitive.java | ||
---|---|---|
673 | 673 |
GeometryOperationContext geometryOperationContext = new GeometryOperationContext(); |
674 | 674 |
geometryOperationContext.setAttribute("JTSGeometry", point); |
675 | 675 |
return (Point)this.invokeOperation("fromJTS", geometryOperationContext); |
676 |
}
|
|
676 |
} |
|
677 | 677 |
|
678 |
|
|
679 |
public Point getInteriorPoint() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
680 |
|
|
681 |
try { |
|
682 |
com.vividsolutions.jts.geom.Geometry geometry = getJTS(); |
|
683 |
com.vividsolutions.jts.geom.Point point = geometry.getInteriorPoint(); |
|
684 |
GeometryOperationContext geometryOperationContext = new GeometryOperationContext(); |
|
685 |
geometryOperationContext.setAttribute("JTSGeometry", point); |
|
686 |
return (Point)this.invokeOperation("fromJTS", geometryOperationContext); |
|
687 |
} catch (GeometryOperationNotSupportedException ns_ex) { |
|
688 |
throw ns_ex; |
|
689 |
} catch (GeometryOperationException op_ex) { |
|
690 |
throw op_ex; |
|
691 |
} catch (Exception ex) { |
|
692 |
/* |
|
693 |
* This is for unexpected null pointer exceptions or other |
|
694 |
*/ |
|
695 |
throw new GeometryOperationException(ex); |
|
696 |
} |
|
697 |
} |
|
698 |
|
|
699 |
|
|
678 | 700 |
public double area() throws GeometryOperationNotSupportedException, GeometryOperationException |
679 | 701 |
{ |
680 | 702 |
//Using get getJTS method instead of use the "toJTS" operation just for performance |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/Geometry.java | ||
---|---|---|
615 | 615 |
|
616 | 616 |
public Point centroid() throws GeometryOperationNotSupportedException, GeometryOperationException; |
617 | 617 |
|
618 |
/** |
|
619 |
* This method returns a point which is inside the geometry. |
|
620 |
* This is useful for mathematical purposes but it is very unlikely |
|
621 |
* to be a suitable place for a label, for example. |
|
622 |
* |
|
623 |
* |
|
624 |
* @return an interior point |
|
625 |
* @throws GeometryOperationNotSupportedException |
|
626 |
* @throws GeometryOperationException |
|
627 |
*/ |
|
628 |
public Point getInteriorPoint() throws GeometryOperationNotSupportedException, GeometryOperationException; |
|
629 |
|
|
618 | 630 |
public double area() throws GeometryOperationNotSupportedException, GeometryOperationException; |
619 | 631 |
|
620 | 632 |
public double perimeter() throws GeometryOperationNotSupportedException, GeometryOperationException; |
Also available in: Unified diff