osmcode / osmcoastline

Extracts coastline data from OpenStreetMap planet file.
https://osmcode.org/osmcoastline/
GNU General Public License v3.0
109 stars 14 forks source link

Is the coastline vector always oriented in the same way with respect to land? #42

Closed FlorisCalkoen closed 1 year ago

FlorisCalkoen commented 2 years ago

For some analysis I need to be sure that the coastlines are orientated in the same way with respect to land, i.e., that while considering the order of the vertices, land is always on the same side (right or left).

Doing a small statistical analysis I just found that this doesn't seem to be the case. For roughly 60% of the coastlines the landward positions seems to be on the right. However, this computation relied on a relatively coarse DEM, so I'm not entirely sure whether my results are correct. Could you confirm whether the landward position can be both on the right or left of the coastline vector?

Could you also suggest a method to determine whether the landward position is on the right or left of the coastline vector?

Many thanks in advance!

joto commented 2 years ago

Osmcoastline doesn't guarantee any line orientation. Use the land or water polygons generated by osmcoastline instead, then you know which side is which.