This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

osmcoastline

0

Hello,

I download denmark-latest.osm.pbf from geofabrik, then I run osmcoastline: osmcoastline -o coastline.db denmark-latest.osm.pbf

Then convert to shape : ogr2ogr -f "ESRI Shapefile" land_polygons.shp coastline.db land_polygons

Then I view the land_polygons.shp in qgis, but now half of Denmark is gone.

What have I done wrong ??

Best regards Håvard

asked 22 Mar '20, 17:52

HaavardHolm's gravatar image

HaavardHolm
11334
accept rate: 0%


One Answer:

1

Generally you can not run OSMCoastline on extracts. OSMCoastline assembles ways into continuous coastline linestrings and then into land and water polygons. But if the coastline is not closed, it can't do that. This might work if your extract only contains an island, but Denmark isn't an island, so you can't determine its land area from the coastline.

answered 23 Mar '20, 07:54

Jochen%20Topf's gravatar image

Jochen Topf
5.2k55074
accept rate: 31%

Ok, thanks again !

Best regards, Håvard

(23 Mar '20, 10:23) HaavardHolm

Are there other ways to separate the coastline for each country ?

I notice the webpage : https://osmdata.openstreetmap.de/data/land-polygons.html, however I need to split into separate country. Could administrative borders be used ?

Best regards Håvard

(24 Mar '20, 07:33) HaavardHolm

Source code available on GitHub .