code: public static double getDistance(Geometry geometry, Coordinate coordinate) {
  		double minDistance = Double.MAX_VALUE;
  		if (coordinate != null && geometry != null) {
  			if (geometry.getGeometries() != null) {
  				for (Geometry child : geometry.getGeometries()) {
  					double distance = getDistance(child, coordinate);
  					if (distance < minDistance) {
  						minDistance = distance;
  					}
  				}
  			}
  			if (geometry.getCoordinates() != null) {
  				if (geometry.getCoordinates().length == 1) {
  					double distance = MathService.distance(coordinate, geometry.getCoordinates()[0]);
  					if (distance < minDistance) {
  						minDistance = distance;
  					}
  				} else if (geometry.getCoordinates().length > 1) {
  					for (int i = 0; i < geometry.getCoordinates().length - 1; i++) {
  						double distance = MathService.distance(geometry.getCoordinates()[i],
  								geometry.getCoordinates()[i + 1], coordinate);
  						if (distance < minDistance) {
  							minDistance = distance;
  						}
  					}
  				}
  			}
  		}
  		return minDistance;
  	}
docs: Return the minimal distance between a coordinate and any vertex of a geometry.
  
  @param geometry The other geometry to calculate the distance for.
  @param coordinate The coordinate for which to calculate the distance to the geometry.
  @return Return the minimal distance