after nearly two weeks they came to a big harbour with more shoals that had to be negotiated by lead line and anchored off a city with houses on stilts around the shore , a stone castle and a tall tower , which was a moorish church , or mosque , which they call masjid .