0

I'm a bit of a newbie in coding and geographical systems. At the moment writing my master thesis, so I need some information in terms of distances/neighbouring.

I'm currently working with Swedish data, so I'm using maps using the system: SWEREF 99 TM. I have a vector layer (points) which determine "locations of interest", and another vector (polygon) which divides the same map into districts. I want to select specific districts that are within a radius of the "location interest", say 1km, 2km, so on.

My problem is:

  • How do I know I'm using the correct distances?
  • Which tool should I use? I know I can select features by radius, but I can't find any option based on a specific radius.
  • Is there also a way to select on the radius, but based on the centroids of the polygons?

Bellow a picture:

enter image description here

1 Answer 1

0

Use the Select by expression tool with the polygon layer as input and with this expression.

aggregate(
    'Point layer name', -- name / id of points layer
    'count',
    $id,
    distance(geometry(@parent), $geometry)  < 1000 -- set here de distance you want
)
6
  • Thank you so much! From what I understand from the CRS information the measurement unit is in meters. I have tried your expression and it works! I'm just a bit puzzled about something, when I try to use the tool "distance to hub", on the same vectors, for some reason I always get an "nan" in the distance field. Any idea why? Aug 25, 2022 at 12:39
  • Are the two layer in the same CRS?
    – Mayo
    Aug 25, 2022 at 13:08
  • Yes, I'm using EPGS:3006 SWEREF 99 TM for all layers Aug 25, 2022 at 13:09
  • Make another post exposing this issue, maybe sharing some pictures and data.
    – Mayo
    Aug 25, 2022 at 13:12
  • 1
    Hey it did! In the end I was able to find a solution for the Hub has well. I just Applied my projection to my project (again) and it somehow worked! Aug 25, 2022 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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