本文整理匯總了Java中com.vividsolutions.jts.geom.PrecisionModel.getScale方法的典型用法代碼示例。如果您正苦於以下問題:Java PrecisionModel.getScale方法的具體用法?Java PrecisionModel.getScale怎麽用?Java PrecisionModel.getScale使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vividsolutions.jts.geom.PrecisionModel
的用法示例。
在下文中一共展示了PrecisionModel.getScale方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: bufferFixedPrecision
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
private void bufferFixedPrecision(PrecisionModel fixedPM) {
Noder noder = new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),
fixedPM.getScale());
BufferBuilder bufBuilder = new BufferBuilder(this.bufParams);
bufBuilder.setWorkingPrecisionModel(fixedPM);
bufBuilder.setNoder(noder);
// this may throw an exception, if robustness errors are encountered
this.resultGeometry = bufBuilder.buffer(this.argGeom, this.distance);
}
示例3: MCIndexSnapRounder
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
public MCIndexSnapRounder(PrecisionModel pm) {
this.pm = pm;
this.li = new RobustLineIntersector();
this.li.setPrecisionModel(pm);
this.scaleFactor = pm.getScale();
}
示例4: SimpleSnapRounder
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
public SimpleSnapRounder(PrecisionModel pm) {
this.pm = pm;
this.li = new RobustLineIntersector();
this.li.setPrecisionModel(pm);
this.scaleFactor = pm.getScale();
}
示例5: MCIndexSnapRounder
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
public MCIndexSnapRounder(PrecisionModel pm) {
this.pm = pm;
li = new RobustLineIntersector();
li.setPrecisionModel(pm);
scaleFactor = pm.getScale();
}
示例6: SimpleSnapRounder
import com.vividsolutions.jts.geom.PrecisionModel; //導入方法依賴的package包/類
public SimpleSnapRounder(PrecisionModel pm) {
this.pm = pm;
li = new RobustLineIntersector();
li.setPrecisionModel(pm);
scaleFactor = pm.getScale();
}