本文整理汇总了Java中com.vividsolutions.jts.io.WKTWriter.toLineString方法的典型用法代码示例。如果您正苦于以下问题:Java WKTWriter.toLineString方法的具体用法?Java WKTWriter.toLineString怎么用?Java WKTWriter.toLineString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.io.WKTWriter
的用法示例。
在下文中一共展示了WKTWriter.toLineString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkMaximumDistance
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Checks that the furthest distance from the buffer curve to the input
* is less than the given maximum distance.
* This uses the Oriented Hausdorff distance metric.
* It corresponds to finding
* the point on the buffer curve which is furthest from <i>some</i> point on the input.
*
* @param input a geometry
* @param bufCurve a geometry
* @param maxDist the maximum distance that a buffer result can be from the input
*/
private void checkMaximumDistance(Geometry input, Geometry bufCurve, double maxDist) {
// BufferCurveMaximumDistanceFinder maxDistFinder = new BufferCurveMaximumDistanceFinder(input);
// maxDistanceFound = maxDistFinder.findDistance(bufCurve);
DiscreteHausdorffDistance haus = new DiscreteHausdorffDistance(bufCurve, input);
haus.setDensifyFraction(0.25);
this.maxDistanceFound = haus.orientedDistance();
if (this.maxDistanceFound > maxDist) {
this.isValid = false;
Coordinate[] pts = haus.getCoordinates();
this.errorLocation = pts[1];
this.errorIndicator = input.getFactory().createLineString(pts);
this.errMsg = "Distance between buffer curve and input is too large "
+ "(" + this.maxDistanceFound
+ " at " + WKTWriter.toLineString(pts[0], pts[1]) + ")";
}
}
示例2: checkMinimumDistance
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Checks that two geometries are at least a minumum distance apart.
*
* @param g1 a geometry
* @param g2 a geometry
* @param minDist the minimum distance the geometries should be separated by
*/
private void checkMinimumDistance(Geometry g1, Geometry g2, double minDist) {
DistanceOp distOp = new DistanceOp(g1, g2, minDist);
minDistanceFound = distOp.distance();
if (minDistanceFound < minDist) {
isValid = false;
Coordinate[] pts = distOp.nearestPoints();
errorLocation = distOp.nearestPoints()[1];
errorIndicator = g1.getFactory().createLineString(pts);
errMsg = "Distance between buffer curve and input is too small "
+ "(" + minDistanceFound
+ " at " + WKTWriter.toLineString(pts[0], pts[1]) + " )";
}
}
示例3: checkMaximumDistance
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Checks that the furthest distance from the buffer curve to the input
* is less than the given maximum distance.
* This uses the Oriented Hausdorff distance metric.
* It corresponds to finding
* the point on the buffer curve which is furthest from <i>some</i> point on the input.
*
* @param input a geometry
* @param bufCurve a geometry
* @param maxDist the maximum distance that a buffer result can be from the input
*/
private void checkMaximumDistance(Geometry input, Geometry bufCurve, double maxDist) {
// BufferCurveMaximumDistanceFinder maxDistFinder = new BufferCurveMaximumDistanceFinder(input);
// maxDistanceFound = maxDistFinder.findDistance(bufCurve);
DiscreteHausdorffDistance haus = new DiscreteHausdorffDistance(bufCurve, input);
haus.setDensifyFraction(0.25);
maxDistanceFound = haus.orientedDistance();
if (maxDistanceFound > maxDist) {
isValid = false;
Coordinate[] pts = haus.getCoordinates();
errorLocation = pts[1];
errorIndicator = input.getFactory().createLineString(pts);
errMsg = "Distance between buffer curve and input is too large "
+ "(" + maxDistanceFound
+ " at " + WKTWriter.toLineString(pts[0], pts[1]) + ")";
}
}
示例4: checkMinimumDistance
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Checks that two geometries are at least a minumum distance apart.
*
* @param g1 a geometry
* @param g2 a geometry
* @param minDist the minimum distance the geometries should be separated by
*/
private void checkMinimumDistance(Geometry g1, Geometry g2, double minDist) {
DistanceOp distOp = new DistanceOp(g1, g2, minDist);
this.minDistanceFound = distOp.distance();
if (this.minDistanceFound < minDist) {
this.isValid = false;
Coordinate[] pts = distOp.nearestPoints();
this.errorLocation = distOp.nearestPoints()[1];
this.errorIndicator = g1.getFactory().createLineString(pts);
this.errMsg = "Distance between buffer curve and input is too small "
+ "(" + this.minDistanceFound
+ " at " + WKTWriter.toLineString(pts[0], pts[1]) + " )";
}
}
示例5: checkTriangleSize
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
private void checkTriangleSize(Coordinate[] pts) {
String loc = "";
if (pts.length >= 2) {
loc = WKTWriter.toLineString(pts[0], pts[1]);
} else {
if (pts.length >= 1) {
loc = WKTWriter.toPoint(pts[0]);
}
}
// Assert.isTrue(pts.length == 4, "Too few points for visited triangle at " + loc);
//com.vividsolutions.jts.util.Debug.println("too few points for triangle at " + loc);
}
示例6: getErrorMessage
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Returns an error message indicating the segments containing
* the intersection.
*
* @return an error message documenting the intersection location
*/
public String getErrorMessage() {
if (this.isValid) {
return "no intersections found";
}
Coordinate[] intSegs = this.segInt.getIntersectionSegments();
return "found non-noded intersection between "
+ WKTWriter.toLineString(intSegs[0], intSegs[1])
+ " and "
+ WKTWriter.toLineString(intSegs[2], intSegs[3]);
}
示例7: checkTriangleSize
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
private void checkTriangleSize(Coordinate[] pts) {
String loc = "";
if (pts.length >= 2)
loc = WKTWriter.toLineString(pts[0], pts[1]);
else {
if (pts.length >= 1)
loc = WKTWriter.toPoint(pts[0]);
}
// Assert.isTrue(pts.length == 4, "Too few points for visited triangle at " + loc);
//com.vividsolutions.jts.util.Debug.println("too few points for triangle at " + loc);
}
示例8: getErrorMessage
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
/**
* Returns an error message indicating the segments containing
* the intersection.
*
* @return an error message documenting the intersection location
*/
public String getErrorMessage() {
if (isValid) return "no intersections found";
Coordinate[] intSegs = segInt.getIntersectionSegments();
return "found non-noded intersection between "
+ WKTWriter.toLineString(intSegs[0], intSegs[1])
+ " and "
+ WKTWriter.toLineString(intSegs[2], intSegs[3]);
}
示例9: checkTriangleSize
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
private void checkTriangleSize(Coordinate[] pts)
{
String loc = "";
if (pts.length >= 2)
loc = WKTWriter.toLineString(pts[0], pts[1]);
else {
if (pts.length >= 1)
loc = WKTWriter.toPoint(pts[0]);
}
// Assert.isTrue(pts.length == 4, "Too few points for visited triangle at " + loc);
//com.vividsolutions.jts.util.Debug.println("too few points for triangle at " + loc);
}
示例10: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(this.inputLines[0][0], this.inputLines[0][1]) + " - "
+ WKTWriter.toLineString(this.inputLines[1][0], this.inputLines[1][1])
+ this.getTopologySummary();
}
示例11: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(this.pt[0], this.pt[1]);
}
示例12: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(new CoordinateArraySequence(this.pts));
}
示例13: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(new Coordinate(this.min, 0), new Coordinate(this.max, 0));
}
示例14: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(inputLines[0][0], inputLines[0][1]) + " - "
+ WKTWriter.toLineString(inputLines[1][0], inputLines[1][1])
+ getTopologySummary();
}
示例15: toString
import com.vividsolutions.jts.io.WKTWriter; //导入方法依赖的package包/类
public String toString() {
return WKTWriter.toLineString(pt[0], pt[1]);
}