I am trying to move 1700 points (of an existing shapefile) to a new pixel of a raster layer. If the dot is already in the highest pixel of the NDVI raster layer then no need to change.
The criteria can be summarized like so:
New points need to be on the pixel with the highest NDVI raster value (within 5m buffer)
New points should have the same information in the attribute table than the old ones
If two points share same pixel because the highest pixel is within their buffer then one of the points should be given the the pixel with the second highest value. Never should two points share the same pixel.
Each point should be represented (regardless of being shifted or not) in the new vector layer
I tried a given Code, but not every point was represented in the new layer. It also didn't meet the criteria of being within the 5m buffer (last picture with the orange points).