code: public static boolean touches(Geometry geometry, Coordinate coordinate) {
  		if (geometry instanceof MultiPolygon) {
  			for (int i = 0; i < geometry.getNumGeometries(); i++) {
  				if (touches(geometry.getGeometryN(i), coordinate)) {
  					return true;
  				}
  			}
  			return false;
  		} else if (geometry instanceof Polygon) {
  			Polygon polygon = (Polygon) geometry;
  			if (touchesLineString(polygon.getExteriorRing(), coordinate)) {
  				return true;
  			}
  			for (int n = 0; n < polygon.getNumInteriorRing(); n++) {
  				if (touchesLineString(polygon.getInteriorRingN(n), coordinate)) {
  					return true;
  				}
  			}
  			return false;
  		} else if (geometry instanceof MultiLineString) {
  			for (int i = 0; i < geometry.getNumGeometries(); i++) {
  				if (touchesLineString((LineString) geometry.getGeometryN(i), coordinate)) {
  					return true;
  				}
  			}
  			return false;
  		} else if (geometry instanceof LineString) {
  			return touchesLineString((LineString) geometry, coordinate);
  		} else if (geometry instanceof Point) {
  			Coordinate c = geometry.getCoordinates()[0];
  			Vector2D v1 = new Vector2D(c.getX(), c.getY());
  			Vector2D v2 = new Vector2D(coordinate.getX(), coordinate.getY());
  			return (v1.distance(v2) < ZERO);
  		}
  		return false;
  	}
docs: Does a certain coordinate touch a given geometry?
  
  @param geometry
  The geometry to check against.
  @param coordinate
  The position to check.
  @return Returns true if the coordinate touches the geometry.