0

A quick background for context is maybe helpful for this. Essentially we have "vacation rentals" and I would like to add additional data to them automatically. We create booking websites for customers who have very niche sites, for example,

  • "Pet Friendly" rentals.
  • "Olympic Cottages"
  • "Surfing Adventure Lettings".

Quite often each of our customers always ask the same questions,

"It would be awesome if we could plot the distance and sort properties based on their relative distance from XYZ".

Usually XYZ is something like a list of dog friendly beaches, or cycle tracks, or wine vinyards. So esesntially points of interests which are easily definable. In those cases, we've always just asked the customer to provide a list of the lat/lngs of every possible "point of interest" that they would like us to calculate distance from".

More recently we've been asked to include "Close to Coastline".

What I want is to come up with a standard way of automating this. My ideas so far are to create a shapefile. For example, let's say we wanted to do "Close to Coastline", we could use something like

http://www.naturalearthdata.com/downloads/10m-physical-vectors/

At this point, I'm somewhat stuck in knowing how would be most efficient to calculate the distance from the edge of the coastline.

I'm thinking about being able to just create/add a shapefile per "concept" that the customer wants us to use for their product. But then do not know the process/tools available to me to know distance from each edge, or vector point.

0

1 Answer 1

4

In your case I think the easiest sollution is to use the algorithm 'Distance to nearest hub'. This can be found under processing > processing toolbox.

This algorithm works best from point to point. So you have to convert all your line and polygonlayers to points first. This can be done with the algorithm 'convert line to points'. You have to set a minimum distance (for example: 10 meters). This well create points every 10 meters along your coastline.

enter image description here

Now you can do the 'Distance to nearest hub' and calculate the shortest path for your input-points. Set the hub layer name attribute

enter image description here

Now you can calculate the length of each hub-segment en select the shortest.

If you put this all together in a model, it will just take one step to calculate the same for different layers.

1
  • That's exactly what I wanted. The "convert line to points" with intervals, is perfect.
    – Layke
    Commented Apr 26, 2018 at 23:12

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