0

I have a large gridded vector dataset (see extract below) and would like to derive a grid of points centered in each cell of the grid. Is there a way to do this in R?

extract

  • 1
    In R look at sp::spsample with the regular option. – Jeffrey Evans Apr 25 '18 at 16:45
  • That’s what I was looking for — thank you Jeffrey! – Gion Mors Apr 25 '18 at 16:57
  • There are some functions for independent sampling of the polygons in the spatialEco package as well. – Jeffrey Evans Apr 25 '18 at 20:27
0

Your dataset seems to be based on a given square/grid. I assume you can prepare a point layer (on the full extent of your dataset) based on the same logic + a given x/y offset to center these points in your squares. Then an intersection query will generate the awaited points.

0

Based on JeffreyEvans's reply, I would suggest using: sp::spsample

Documentation: https://www.rdocumentation.org/packages/sp/versions/1.2-7/topics/spsample

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.