本文整理汇总了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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}