本文整理匯總了Java中com.vividsolutions.jts.geom.PrecisionModel.getType方法的典型用法代碼示例。如果您正苦於以下問題:Java PrecisionModel.getType方法的具體用法?Java PrecisionModel.getType怎麽用?Java PrecisionModel.getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vividsolutions.jts.geom.PrecisionModel
的用法示例。
在下文中一共展示了PrecisionModel.getType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: computeOverlaySnapTolerance
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
/**
* Estimates the snap tolerance for a Geometry, taking into account its precision model.
*
* @param g a Geometry
* @return the estimated snap tolerance
*/
public static double computeOverlaySnapTolerance(Geometry g) {
double snapTolerance = computeSizeBasedSnapTolerance(g);
/**
* Overlay is carried out in the precision model
* of the two inputs.
* If this precision model is of type FIXED, then the snap tolerance
* must reflect the precision grid size.
* Specifically, the snap tolerance should be at least
* the distance from a corner of a precision grid cell
* to the centre point of the cell.
*/
PrecisionModel pm = g.getPrecisionModel();
if (pm.getType() == PrecisionModel.FIXED) {
double fixedSnapTol = (1 / pm.getScale()) * 2 / 1.415;
if (fixedSnapTol > snapTolerance) {
snapTolerance = fixedSnapTol;
}
}
return snapTolerance;
}
示例2: computeGeometry
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
private void computeGeometry() {
this.bufferOriginalPrecision();
if (this.resultGeometry != null) {
return;
}
PrecisionModel argPM = this.argGeom.getFactory().getPrecisionModel();
if (argPM.getType() == PrecisionModel.FIXED) {
this.bufferFixedPrecision(argPM);
} else {
this.bufferReducedPrecision();
}
}