Correct way to incorporate spatial autocorrelation

Thanks very much for you reply.
Sorry that I didn’t explain how the grid was. The grid was in 5 arc-min of resolution of the world. And the centerLong and centerLat columns were the the longitude and latitude of center of the grid. The grids in my dataset were where these species distributed, and I randomly sampled 100 rows out from the whole dataset. Because these species didn’t distribute in the whole world, the grids in the dataset didn’t have even distance. So, it means that some grids were next to each other and clustered in the same location because these species were common in this location.
I can understand your suggestion of creating the spatial distance matrix, but not very sure about the suggestion of Sampling and identifiability of a spatial model with second-order IGMRF prior in the Stan. Does the brm() has parameters with similar functions that I could used? Because building the model in the brm() is much easier to me.