Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Coordinate.distance()


        /**
         * Compute the largest diameter (length) that will produce a split segment which is not
         * still encroached upon by the encroaching point (The length is reduced slightly by a
         * safety factor)
         */
        double nonEncroachDiam = projPt.distance(encroachPt) * 2 * 0.8; // .99;
        double maxSplitLen = nonEncroachDiam;
        if (maxSplitLen > midPtLen) {
            maxSplitLen = midPtLen;
        }
        splitSeg.setMinimumLength(maxSplitLen);
View Full Code Here


        final Coordinate arcCenter = getArcCenter();
        if (arcCenter == null) {
            return null;
        }

        final double radius = arcCenter.distance(point1);

        double minx = arcCenter.x - radius;
        double miny = arcCenter.y - radius;
        Rectangle2D rect = new Rectangle2D.Double(minx, miny, 2 * radius, 2 * radius);

 
View Full Code Here

    try {
     intPt = HCoordinate.intersection(offset0.p0,
        offset0.p1, offset1.p0, offset1.p1);
    
     double mitreRatio = distance <= 0.0 ? 1.0
         : intPt.distance(p) / Math.abs(distance);
    
     if (mitreRatio > bufParams.getMitreLimit())
       isMitreWithinLimit = false;
    }
    catch (NotRepresentableException ex) {
View Full Code Here

    try {
     intPt = HCoordinate.intersection(offset0.p0,
        offset0.p1, offset1.p0, offset1.p1);
    
     double mitreRatio = distance <= 0.0 ? 1.0
         : intPt.distance(p) / Math.abs(distance);
    
     if (mitreRatio > bufParams.getMitreLimit())
       isMitreWithinLimit = false;
    }
    catch (NotRepresentableException ex) {
View Full Code Here

        /**
         * Compute the largest diameter (length) that will produce a split segment which is not
         * still encroached upon by the encroaching point (The length is reduced slightly by a
         * safety factor)
         */
        double nonEncroachDiam = projPt.distance(encroachPt) * 2 * 0.8; // .99;
        double maxSplitLen = nonEncroachDiam;
        if (maxSplitLen > midPtLen) {
            maxSplitLen = midPtLen;
        }
        splitSeg.setMinimumLength(maxSplitLen);
View Full Code Here

    try {
     intPt = HCoordinate.intersection(offset0.p0,
        offset0.p1, offset1.p0, offset1.p1);
    
     double mitreRatio = distance <= 0.0 ? 1.0
         : intPt.distance(p) / Math.abs(distance);
    
     if (mitreRatio > bufParams.getMitreLimit())
       isMitreWithinLimit = false;
    }
    catch (NotRepresentableException ex) {
View Full Code Here

        // find nearest result to testPt
        SimpleFeature closest = null;
        for (SimpleFeatureIterator it = result.features(); it.hasNext();) {
            SimpleFeature f = it.next();
            Coordinate outPt = ((Point) f.getDefaultGeometry()).getCoordinate();
            double dist = outPt.distance(testPt);
            if (dist < minDist) {
                closest = f;
                minDist = dist;
            }
        }
View Full Code Here

            Coordinate minDistPoint = null;

            for (LocationIndexedLine line : lines) {
                LinearLocation here = line.project(pt);
                Coordinate point = line.extractPoint(here);
                double dist = point.distance(pt);
                if (dist < minDist) {
                    minDist = dist;
                    minDistPoint = point;
                }
            }
View Full Code Here

      if (distance < closestDistance) {
        closestDistance = distance;
        closestCoordinate = c;
      }
    }
    if (closestCoordinate != null && closestCoordinate.distance(inCoord) < tolerance) {
      return m_coord2node.get(closestCoordinate);
    }
    return null;
  }
}
View Full Code Here

      Geometry geom = record.getGeometry();
      if (geom instanceof LineString) {
        LocationIndexedLine line = new LocationIndexedLine(geom);
        LinearLocation here = line.project(point.getCoordinate());
        Coordinate snap = line.extractPoint(here);
        double distance = snap.distance(point.getCoordinate());
        results.add(new PointResult(layer.getGeometryFactory()
            .createPoint(snap), record, distance));
      } else if (geom instanceof Point) {
                Point here = (Point) geom;
                results.add(new PointResult(here,record,here.distance(point)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.