17

I want to identify all beaches on this planet (or a given subset of it) that are facing westwards (+/- 20-30 degrees).

My idea is to use OSM as the data source. Extracting all polygons that have the tag "natural=beach" gives me a dataset / shapefile of all areas that are flagged as beaches. So far so good.

I also know that I can use coastline data (either from OSM or Natural Earth for example) to identify the facing of the beaches.

Buffering the beach shapes to correct for minor mismatches and intersecting these with the coastline should provide me with data on which side of the shape is facing towards the water. Using the max/min values of all intersecting points should give me an idea of the bearing. (90 degrees +/- 20-30 degrees would be fine...)

And that's where I am lost...

My preferred tool would be QGIS, but PostGIS would be OK as well.

Is there anyone around with a clever idea how to solve this puzzle?

nmtoken
  • 13,355
  • 5
  • 38
  • 87
jdoe
  • 179
  • 2
  • 4
    Instead of using buffers.. Wouldn't it be easier to figure out how to displace all items in your shapefile a bit towards the east, then run an Intersect between the coastline shapefile and the beaches shapefile? They will only overlap where the beaches face west. – Tim Couwelier Apr 29 '14 at 08:16
  • Tim - nice idea. Not sure that it will really work for "strange" geometries. I received another idea: take the coastline as lines and the centroid of beach polygons using v.net in grass snap the centroid to the nearest line (or in postgis). now you have a line that represents direction. calculate the bearing from the start point of the centroid to the end point the line using trig. Although nice it is not fully "within" QGIS. Any more clever ideas? – jdoe Apr 30 '14 at 13:39
  • If you can find a way to turn the coastline into a series of point data and the beach centroids aswell, you can try Nearest Neighbour Analysis as described here: link Instead of joining the attributes as shown in the example, make sure to have x,y values for the two datasets matched. using field calculator you can find the relative differnces between x and y values for the centroid and closest point. Based on the sign of the x-difference you know if it's west or east, and based on the ratio of diff(y)/diff(x) how western. – Tim Couwelier Apr 30 '14 at 14:16
  • Given I ran out of charachters, here goes: if the centroids x-value > coastline point x-value, the beach faces west.

    the x and y coordinates of the two would let you calc the angle towards the y-axis: (y2-y1)/(x2-x1) gives you the inclination of the line, which you can convert back to degrees

    – Tim Couwelier Apr 30 '14 at 14:21
  • run coastal query by countries and sub regions that have a west coast, only a problem if they have both coasts. Then look for angle closer to vertical intersection with equator and eliminate angles that displease you. – lewis Apr 30 '14 at 18:07
  • I feel like "Facing west" is not sufficiently tight as a criterion. What about a crescent shaped beach (common shape). Does it "face west" as long as I can stand on one point of it and have a sightline west uninterupted by the coast or other islands? Do islands in the way lower the "westness" of a beach? – Paul Ramsey May 25 '14 at 18:02
  • @PaulRamsey - I completely agree. There are many ways to define "wetness" - however my personal one is that I can see the sun set over the water. Yes - that place changes depending on time of the year. So a beach is "westy" if there is at least one place where you can see the sun set during the year. – jdoe Jun 02 '14 at 11:37
  • Have you looked at your coast line data yet? Have you view that coast line against the beach polygons? Coast lines are not simple, and can be high water, low water or an average. There is no point working out a solution if you're data is not as you expect. – MichaelStoner Jun 02 '14 at 19:20
  • 5
    You could rasterize your data, set open water values to zero, and beaches to 1, then run the Terrain Analysis->Aspect tool. You would get a raster of the direction of downward slope and be able to choose cells that are "westy" enough. – WxMacMan Jun 16 '14 at 17:52
  • @WxMacMan yes you can have the orientation with this method, maybe you can give a beach id in the first band of the raster and 0/1 in the second band so you can easily retrieve the right beach with the id after filtering on the orientation – Below the Radar Aug 20 '14 at 12:26

1 Answers1

1

The elevation service on ArcGIS Online includes ready to use worldwide data, and also a built in raster function to generate aspect. It's also pretty simple to filter simultaneously for a range of aspect values (290-250 degrees) as well as elevation (e.g. 0 to 10 meters, depending on how you define a beach - or perhaps you already have the beaches delineated?). I don't know if you're open to using ArcGIS technology - if yes, I can send you some sample REST requests.

The attached png isn't properly filtered for elevation, but shows the concept...enter image description here

Cody B.

Benkelman
  • 11
  • 2