* closest point on this geometry. The x1 and y1 properties represent the
* coordinates of the closest point on the target geometry.
*/
public Distance distanceTo(Geometry geometry,
JSObject options) {
JSObject distanceJSObject = GeometryImpl.distanceTo(getJSObject(),
geometry.getJSObject(), options);
DistanceImpl distance = new DistanceImpl(distanceJSObject.getPropertyAsDouble(
"distance"));
if (distanceJSObject.hasProperty("x0")) {
distance.setX0(distanceJSObject.getPropertyAsDouble("x0"));
}
if (distanceJSObject.hasProperty("y0")) {
distance.setY0(distanceJSObject.getPropertyAsDouble("y0"));
}
if (distanceJSObject.hasProperty("x1")) {
distance.setX1(distanceJSObject.getPropertyAsDouble("x1"));
}
if (distanceJSObject.hasProperty("y1")) {
distance.setY1(distanceJSObject.getPropertyAsDouble("y1"));
}
return distance;
}