當前位置: 首頁>>代碼示例>>Java>>正文


Java PrecisionModel.getScale方法代碼示例

本文整理匯總了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;
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:28,代碼來源:GeometrySnapper.java

示例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);
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:11,代碼來源:BufferOp.java

示例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();
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:7,代碼來源:MCIndexSnapRounder.java

示例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();
}
 
開發者ID:gegy1000,項目名稱:Earth,代碼行數:7,代碼來源:SimpleSnapRounder.java

示例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();
}
 
開發者ID:Semantive,項目名稱:jts,代碼行數:7,代碼來源:MCIndexSnapRounder.java

示例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();
}
 
開發者ID:Semantive,項目名稱:jts,代碼行數:7,代碼來源:SimpleSnapRounder.java


注:本文中的com.vividsolutions.jts.geom.PrecisionModel.getScale方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。