2

I have a polygon showing the extent of a beach. I would like to create a series of sampling points along that beach, that are equally spaced north to south (say at increments of 100m to the northing value), and lie in the approximate center of the beach polygon at that northing value.

Sampling points along a beach

How might I go about this in QGIS or python? I can find a solution that would achieve this specifically. Thanks for any advice.

  • What have you tried so far? – Stefan May 27 '20 at 12:36
  • I played with cutting the polygon up based on regular spaced horizontal lines, and then generating centroids of each resulting polygon. Wondering if there is an easier way to do it! – staf May 27 '20 at 13:08
  • Aha, so you did something similar to what I did in my answer. You can certainly automate this using Graphical Modeler or a Python script – Stefan May 27 '20 at 13:11
  • Great, thanks for your input Stefan, its an elegant solution – staf May 27 '20 at 13:22
  • Thank you! If it solves your issue, please mark it as the solution. :) – Stefan May 27 '20 at 13:31
2

We will create an equally spaced grid, intersect it's horizontal lines with the beach and calculate centroids of each intersection.

Steps

  1. Use a projected coordinates system (such as UTM).
  2. Vector > Research Tools > Create Grid
    • Grid type: Line
    • Grid extent: [...] "Use Canvas Extent" or "Use Layer Extent..."
    • Vertical spacing: 100 screenshot of QGIS Create Grid dialogue
  3. Select by Expression y_min($geometry) = y_max($geometry) to select horizontal lines screenshot of QGIS Select by Expression, selecting all horizontal lines
  4. Vector > Geoprocessing Tools > Intersection
    • Input Layer: Grid ([x] "Selected features only")
    • Overlay layer: beach screenshot of QGIS Intersection dialogue
  5. Vector > Geometry Tools > Centroids screenshot of QGIS Centroids dialogue

Result

a narrow polygon with equally spaced points

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.