I want to only select coastal cities among Cities Over 300K(UN data).
So I downloaded open-source coastline shapefiles online(GSHHS_c_L1 and GSHHS_c_L2), made them into lines, merged 2 lines, reprojected them to CRS EPSG:6871 and CRS EPSG:3857).
With these reprojected coastlines, I made a buffer of 30km and 50km from the coastline.
And then intercepted Cities Over 300K and buffer.
The result shows that with 30km from the coastline, coastal cities are 706, and 50km from the coastline, coastal cities are 939.
However, I see the strange lines north and south of the world map if I zoom out, and when I zoom in it disappears.
How can I deal with this kind of error?
I keep searching for the solution, but it's hard for me to find this kind of error.
I am trying to "Select by Expression". Is this the right way to do it?

