4

Is there any solution to add every point of a point feature 4 additional points in all geographic directions in a specified distance?

5
  • Welcome, Jens! This is not too hard to do in python. Just two questions, do you want the distance to be defined in the same unit as for the dataset with your initial points, e.g. meters for a UTM CRS and do you want the additional points to be in the same dataset as the initial points? Commented Oct 14, 2022 at 7:49
  • 1
    Do you want to add 4 points to data for a point, or is it just for visualization? What type of crs does point layer have, geographic or projected? Commented Oct 14, 2022 at 7:51
  • Hello @MortenSickel thanks for your answer! yes i want it in the same unit - 20 meters beside the existing points. And the additional points should be in a new dataset.
    – Jens77
    Commented Oct 14, 2022 at 7:59
  • 1
    Hello @KadirŞahbaz , thanks for your message! The CRS is EPSG:4326 - WGS 84. Its not just for visualization, I want to research for ecological gradients in specified distances to my starting point.
    – Jens77
    Commented Oct 14, 2022 at 8:05
  • 1
    Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Commented Dec 13, 2022 at 6:17

3 Answers 3

9

You can use the following Processing Toolbox (Ctrl+Shift+T) steps:

  1. Reproject your layer to a coordinate system with units in meters
  2. Rectangle ovals diamonds, create rectangles with desired width and height rotated 45 degrees
  3. Extract the corner points with extract vertices
  4. Reproject the extracted points back to WGS84
  5. Merge with your start layer, or don't if you want a separate layer

enter image description here

0
6

Essentially the same method as @MrXsquared, but using a loop and with the option to include the original point geometry in the output.

collect_geometries(
--  array_append(                      -- uncomment to include the original geometry
        array_foreach(                 -- loop through array of angles (in degrees)
            array(0, 90, 180, 270), 
            project(                   -- the project function is called for every loop iteration
                $geometry,             -- the origin point of the projection is the original point geometry
                100,                   -- the desired distance
                radians(@element)      -- convert array element to radians
            )
        )
--  , $geometry)                       -- uncomment to include the original geometry
)
5

You can use an expression:

collect_geometries(
    project($geometry, 500, radians(90)),
    project($geometry, 500, radians(180)),
    project($geometry, 500, radians(270)),
    project($geometry, 500, radians(360))
)

This way you can control the distance and angle for each point individually and add as many points as you want. You can either use it as symbology or via "Geometry by expression" from processing toolbox. If you use the latter, it will return MultiPoints, you can convert to SinglePoints by running "Multiparts to singleparts".

enter image description here

2
  • Not mentioned in the question but in the comments, the crs is 4326 so 500 will be distance in degrees?
    – Bera
    Commented Oct 14, 2022 at 18:10
  • Yes. Well, then 1) mention in the question and 2) reproject to a metric crs ;) Or use a (lower) distance in degree.
    – MrXsquared
    Commented Oct 14, 2022 at 18:46

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.