How to download all coastline data

Hello. I want to download all coastline data to my machine. I think this is going to be about 20Gb of data. An overpass query is presumably not the right approach.
Please could someone give me some guidance on a suitable approach?
Kind regards, Chris


Check Coastline - OpenStreetMap Wiki which leads to Coastlines.

Is that what you are looking for?

Hi, no. I’m after the basic OSM coastline data in XML format. So I’ve downloaded all UK area coastline data before using a query something like:







I’ve then done my own postprocessing to get this into a SQLite database in the format I want. I now want to extend this to the entire world. What would be the right way to download such a large data set?

I’m blind and typically most GUI tools aren’t accessible with a screen reader so I’m unable to import Shapefiles. And currently I also want to do my own processing to get the data into my SQLite database.

Best, Chris

I’ve never done anything this low level, but would a software library like GDAL be able to get the “normal” coastline ShapeFiles into a suitable SQLite database without a GUI? I think at its most basic it exists mostly as a set of command line tools.

Do you need additional information that the ShapeFiles just don’t have?

I don’t have a firm grasp on how big a set of all the coastlines is in one of the native OSM formats. The limit on the “main” Overpass instance is 1GB/day. I’m not sure if it could even handle that in one go. The recommendation for large amounts of data is usually to download a copy of the planet file (or a regional extract) and run your extract locally using something like osmosis. My gut feeling is that if you can find some way of using the existing coastline extracts that’s probably going to be easiest.

Thanks for your reply. I just need all the segments that make up coastlines as my application uses this to determine if my user’s position is in the sea or on land.
I hadnn’t come across GDAL before so thanks for pointing it out. Your suggested approach sounds sensible. I just have to work out how to use it.
Might still be fun though to try downloading planet data but then I’ll also need to work out how to use Osmosis.
Thanks, Chris