当前位置: 首页>>代码示例>>Java>>正文


Java CGAlgorithms.distancePointLine方法代码示例

本文整理汇总了Java中com.vividsolutions.jts.algorithm.CGAlgorithms.distancePointLine方法的典型用法代码示例。如果您正苦于以下问题:Java CGAlgorithms.distancePointLine方法的具体用法?Java CGAlgorithms.distancePointLine怎么用?Java CGAlgorithms.distancePointLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vividsolutions.jts.algorithm.CGAlgorithms的用法示例。


在下文中一共展示了CGAlgorithms.distancePointLine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeMinDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private void computeMinDistance(LineString line, Point pt,
                                GeometryLocation[] locGeom) {
    if (line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())
            > this.minDistance) {
        return;
    }
    Coordinate[] coord0 = line.getCoordinates();
    Coordinate coord = pt.getCoordinate();
    // brute force approach!
    for (int i = 0; i < coord0.length - 1; i++) {
        double dist = CGAlgorithms.distancePointLine(
                coord, coord0[i], coord0[i + 1]);
        if (dist < this.minDistance) {
            this.minDistance = dist;
            LineSegment seg = new LineSegment(coord0[i], coord0[i + 1]);
            Coordinate segClosestPoint = seg.closestPoint(coord);
            locGeom[0] = new GeometryLocation(line, i, segClosestPoint);
            locGeom[1] = new GeometryLocation(pt, 0, coord);
        }
        if (this.minDistance <= this.terminateDistance) {
            return;
        }
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:25,代码来源:DistanceOp.java

示例2: computePointLineDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double computePointLineDistance(Coordinate pt, FacetSequence facetSeq) {
    double minDistance = Double.MAX_VALUE;

    for (int i = facetSeq.start; i < facetSeq.end - 1; i++) {
        facetSeq.pts.getCoordinate(i, this.q0);
        facetSeq.pts.getCoordinate(i + 1, this.q1);
        double dist = CGAlgorithms.distancePointLine(pt, this.q0, this.q1);
        if (dist == 0.0) {
            return 0.0;
        }
        if (dist < minDistance) {
            minDistance = dist;
        }
    }
    return minDistance;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:17,代码来源:FacetSequence.java

示例3: segmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double segmentDistance(FacetSequence fs1, FacetSequence fs2) {
    for (int i1 = 0; i1 < fs1.size(); i1++) {
        for (int i2 = 1; i2 < fs2.size(); i2++) {

            Coordinate p = fs1.getCoordinate(i1);

            Coordinate seg0 = fs2.getCoordinate(i2 - 1);
            Coordinate seg1 = fs2.getCoordinate(i2);

            if (!(p.equals2D(seg0) || p.equals2D(seg1))) {
                double d = CGAlgorithms.distancePointLine(p, seg0, seg1);
                if (d < this.minDist) {
                    this.minDist = d;
                    this.updatePts(p, seg0, seg1);
                    if (d == 0.0) {
                        return d;
                    }
                }
            }
        }
    }
    return this.minDist;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:24,代码来源:MinimumClearance.java

示例4: computeMinDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private void computeMinDistance(LineString line, Point pt,
                                GeometryLocation[] locGeom) {
    if (line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())
            > minDistance)
        return;
    Coordinate[] coord0 = line.getCoordinates();
    Coordinate coord = pt.getCoordinate();
    // brute force approach!
    for (int i = 0; i < coord0.length - 1; i++) {
        double dist = CGAlgorithms.distancePointLine(
                coord, coord0[i], coord0[i + 1]);
        if (dist < minDistance) {
            minDistance = dist;
            LineSegment seg = new LineSegment(coord0[i], coord0[i + 1]);
            Coordinate segClosestPoint = seg.closestPoint(coord);
            locGeom[0] = new GeometryLocation(line, i, segClosestPoint);
            locGeom[1] = new GeometryLocation(pt, 0, coord);
        }
        if (minDistance <= terminateDistance) return;

    }
}
 
开发者ID:Semantive,项目名称:jts,代码行数:23,代码来源:DistanceOp.java

示例5: segmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double segmentDistance(FacetSequence fs1, FacetSequence fs2) {
    for (int i1 = 0; i1 < fs1.size(); i1++) {
        for (int i2 = 1; i2 < fs2.size(); i2++) {

            Coordinate p = fs1.getCoordinate(i1);

            Coordinate seg0 = fs2.getCoordinate(i2 - 1);
            Coordinate seg1 = fs2.getCoordinate(i2);

            if (!(p.equals2D(seg0) || p.equals2D(seg1))) {
                double d = CGAlgorithms.distancePointLine(p, seg0, seg1);
                if (d < minDist) {
                    minDist = d;
                    updatePts(p, seg0, seg1);
                    if (d == 0.0)
                        return d;
                }
            }
        }
    }
    return minDist;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:23,代码来源:MinimumClearance.java

示例6: segmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double segmentDistance(FacetSequence fs1, FacetSequence fs2) {
 for (int i1 = 0; i1 < fs1.size(); i1++) {
   for (int i2 = 1; i2 < fs2.size(); i2++) {
     
     Coordinate p = fs1.getCoordinate(i1);
     
     Coordinate seg0 = fs2.getCoordinate(i2-1);
     Coordinate seg1 = fs2.getCoordinate(i2);
     
     if (! (p.equals2D(seg0) || p.equals2D(seg1))) {
       double d = CGAlgorithms.distancePointLine(p, seg0, seg1);
       if (d < minDist) {
         minDist = d;
         updatePts(p, seg0, seg1);
         if (d == 0.0)
           return d;
       }
     }
   }
 }
 return minDist;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:23,代码来源:MinimumClearance.java

示例7: isShallowConcavity

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private boolean isShallowConcavity(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol) {
    int orientation = CGAlgorithms.computeOrientation(p0, p1, p2);
    boolean isAngleToSimplify = (orientation == this.angleOrientation);
    if (!isAngleToSimplify) {
        return false;
    }

    double dist = CGAlgorithms.distancePointLine(p1, p0, p2);
    return dist < distanceTol;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:11,代码来源:BufferInputLineSimplifier.java

示例8: checkSegmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private void checkSegmentDistance(Coordinate seg0, Coordinate seg1) {
    if (this.queryPt.equals2D(seg0) || this.queryPt.equals2D(seg1)) {
        return;
    }
    double segDist = CGAlgorithms.distancePointLine(this.queryPt, seg1, seg0);
    if (segDist > 0) {
        SimpleMinimumClearance.this.updateClearance(segDist, this.queryPt, seg1, seg0);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:10,代码来源:SimpleMinimumClearance.java

示例9: isShallowConcavity

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private boolean isShallowConcavity(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol) {
    int orientation = CGAlgorithms.computeOrientation(p0, p1, p2);
    boolean isAngleToSimplify = (orientation == angleOrientation);
    if (!isAngleToSimplify)
        return false;

    double dist = CGAlgorithms.distancePointLine(p1, p0, p2);
    return dist < distanceTol;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:10,代码来源:BufferInputLineSimplifier.java

示例10: computePointLineDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double computePointLineDistance(Coordinate pt, FacetSequence facetSeq) {
    double minDistance = Double.MAX_VALUE;

    for (int i = facetSeq.start; i < facetSeq.end - 1; i++) {
        facetSeq.pts.getCoordinate(i, q0);
        facetSeq.pts.getCoordinate(i + 1, q1);
        double dist = CGAlgorithms.distancePointLine(pt, q0, q1);
        if (dist == 0.0) return 0.0;
        if (dist < minDistance) {
            minDistance = dist;
        }
    }
    return minDistance;
}
 
开发者ID:Semantive,项目名称:jts,代码行数:15,代码来源:FacetSequence.java

示例11: checkSegmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private void checkSegmentDistance(Coordinate seg0, Coordinate seg1) {
    if (queryPt.equals2D(seg0) || queryPt.equals2D(seg1))
        return;
    double segDist = CGAlgorithms.distancePointLine(queryPt, seg1, seg0);
    if (segDist > 0)
        updateClearance(segDist, queryPt, seg1, seg0);
}
 
开发者ID:Semantive,项目名称:jts,代码行数:8,代码来源:SimpleMinimumClearance.java

示例12: isShallowConcavity

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private boolean isShallowConcavity(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol)
{
  int orientation = CGAlgorithms.computeOrientation(p0, p1, p2);
  boolean isAngleToSimplify = (orientation == angleOrientation);
  if (! isAngleToSimplify)
    return false;
  
  double dist = CGAlgorithms.distancePointLine(p1, p0, p2);
  return dist < distanceTol;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:11,代码来源:BufferInputLineSimplifier.java

示例13: computePointLineDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private double computePointLineDistance(Coordinate pt, FacetSequence facetSeq) 
{
  double minDistance = Double.MAX_VALUE;

  for (int i = facetSeq.start; i < facetSeq.end - 1; i++) {
    facetSeq.pts.getCoordinate(i, q0);
    facetSeq.pts.getCoordinate(i + 1, q1);
    double dist = CGAlgorithms.distancePointLine(pt, q0, q1);
    if (dist == 0.0) return 0.0;
    if (dist < minDistance) {
      minDistance = dist;
    }
  }
  return minDistance;
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:16,代码来源:FacetSequence.java

示例14: checkSegmentDistance

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private void checkSegmentDistance(Coordinate seg0, Coordinate seg1)
{
    if (queryPt.equals2D(seg0) || queryPt.equals2D(seg1))
      return;
    double segDist = CGAlgorithms.distancePointLine(queryPt, seg1, seg0);
    if (segDist > 0) 
      updateClearance(segDist, queryPt, seg1, seg0);
}
 
开发者ID:GitHubDroid,项目名称:geodroid_master_update,代码行数:9,代码来源:SimpleMinimumClearance.java

示例15: isShallow

import com.vividsolutions.jts.algorithm.CGAlgorithms; //导入方法依赖的package包/类
private boolean isShallow(Coordinate p0, Coordinate p1, Coordinate p2, double distanceTol) {
    double dist = CGAlgorithms.distancePointLine(p1, p0, p2);
    return dist < distanceTol;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:5,代码来源:BufferInputLineSimplifier.java


注:本文中的com.vividsolutions.jts.algorithm.CGAlgorithms.distancePointLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。