I wonder if there is any API I could query OSM data through, for example; Are (lon_1, lat_1) at land or at sea? Or could it be possible to get an island as a well-defined polygon? The only usage I've seen so far has just been tools for rendering OSM data (generating tiles).
Update:
I've found a great API for reading Openstreetmap data; Mapscript. This is an interface to MapServer, which is able to read *.map and *.shp files, and is very, very fast.