Count the number of points within a specific distance of each raster cell with a timestamp condition











up vote
1
down vote

favorite
1












I have thousands of coordinates for point data (sample in code below) that are derived from a tractor guidance system with a timestamp for each coordinate. I created a 1 m resolution empty raster. How can I count the number of points within a specified distance (let's say 14 meters) for each raster cell but only for points not within 6 (+/- 3) timestamp units of the point?



libs <- c("raster","dplyr", "rgdal", "sp", "sf")
have <- libs %in% rownames(installed.packages())
if(any(!have)) install.packages(libs[!have])
sapply(libs, function(i) require(i, character.only=TRUE))

pts70 <- structure(list(Latitude = c(35.09263063, 35.09263784, 35.09264402,
35.09265182, 35.09265815, 35.09266566, 35.09267184, 35.09267979,
35.09269097, 35.09269627, 35.09270054, 35.09270422, 35.09271511,
35.09272232, 35.09272997, 35.09273821, 35.09273468, 35.09274645,
35.09277486, 35.09280812, 35.09284226, 35.09287464, 35.09290098,
35.0929129, 35.09291143, 35.09289568, 35.09287273, 35.09285683,
35.09285477, 35.09287331, 35.09290672, 35.09294866, 35.09298825,
35.09301548, 35.09301769, 35.09301077, 35.09299223, 35.09296839,
35.09294557, 35.09292924, 35.09291894, 35.09290893, 35.09289936,
35.09289112, 35.09288273, 35.0928742, 35.09286654, 35.09285771,
35.09285168, 35.09284314, 35.09283593, 35.0928271, 35.09282092,
35.09281209, 35.09280444, 35.09279826, 35.09278899, 35.09278148,
35.0927728, 35.09276544, 35.09275764, 35.09275146, 35.09274219,
35.0927363, 35.09272747, 35.09271967, 35.09271069, 35.09270378,
35.0926948, 35.09268847, 35.09268038), Longitude = c(-93.98941262,
-93.98937898, -93.98934607, -93.98931225, -93.9892779, -93.98924354,
-93.98921387, -93.98918347, -93.9891466, -93.98910901, -93.98907951,
-93.98904479, -93.98900594, -93.98897033, -93.98893741, -93.9889027,
-93.98885612, -93.98880917, -93.98880414, -93.98880971, -93.98880432,
-93.98878651, -93.98875773, -93.9887214, -93.98868668, -93.98865611,
-93.98862265, -93.98858002, -93.98853092, -93.98848326, -93.98845088,
-93.98844207, -93.98845808, -93.98849369, -93.9885329, -93.98856977,
-93.98859603, -93.98861744, -93.98864136, -93.9886714, -93.98870395,
-93.98873669, -93.98876906, -93.98880216, -93.98883651, -93.98887015,
-93.98890414, -93.98893849, -93.98897069, -93.98900486, -93.98903922,
-93.98907357, -93.98910811, -93.98913958, -93.98917268, -93.98920577,
-93.98923941, -93.98927196, -93.98930524, -93.98933833, -93.98937215,
-93.98940344, -93.98943744, -93.98947125, -93.98950453, -93.98953834,
-93.9895718, -93.98960579, -93.98963889, -93.98967288, -93.98970669
), Timestamp = c(1540321036L,
1540321037L, 1540321038L, 1540321039L, 1540321040L, 1540321041L,
1540321042L, 1540321043L, 1540321044L, 1540321045L, 1540321046L,
1540321047L, 1540321049L, 1540321050L, 1540321051L, 1540321052L,
1540321053L, 1540321054L, 1540321055L, 1540321056L, 1540321057L,
1540321058L, 1540321059L, 1540321060L, 1540321061L, 1540321062L,
1540321063L, 1540321064L, 1540321065L, 1540321066L, 1540321067L,
1540321068L, 1540321069L, 1540321070L, 1540321071L, 1540321072L,
1540321073L, 1540321074L, 1540321075L, 1540321076L, 1540321077L,
1540321078L, 1540321079L, 1540321080L, 1540321081L, 1540321082L,
1540321083L, 1540321084L, 1540321085L, 1540321086L, 1540321087L,
1540321088L, 1540321089L, 1540321090L, 1540321091L, 1540321092L,
1540321093L, 1540321094L, 1540321095L, 1540321096L, 1540321097L,
1540321098L, 1540321099L, 1540321100L, 1540321101L, 1540321102L,
1540321103L, 1540321104L, 1540321105L, 1540321106L, 1540321107L
)), row.names = 3371:3441, class = "data.frame")

sf_pts <- pts70 %>%
sf::st_as_sf(coords = c("Longitude", "Latitude"), agr="constant") %>%
sf::st_set_crs(4326) %>%
sf::st_transform(crs = 32615)

r <- raster()
bb <- extent(sf_pts)
r <- setExtent(r, bb)
res(r) <- 1
crs(r) <- '+init=EPSG:32615'









share|improve this question
























  • @42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
    – AMS Nomad
    Nov 10 at 0:54










  • Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
    – AMS Nomad
    Nov 10 at 1:19










  • Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
    – 42-
    Nov 10 at 1:35












  • @42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
    – AMS Nomad
    Nov 10 at 16:32










  • When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
    – 42-
    Nov 10 at 17:46

















up vote
1
down vote

favorite
1












I have thousands of coordinates for point data (sample in code below) that are derived from a tractor guidance system with a timestamp for each coordinate. I created a 1 m resolution empty raster. How can I count the number of points within a specified distance (let's say 14 meters) for each raster cell but only for points not within 6 (+/- 3) timestamp units of the point?



libs <- c("raster","dplyr", "rgdal", "sp", "sf")
have <- libs %in% rownames(installed.packages())
if(any(!have)) install.packages(libs[!have])
sapply(libs, function(i) require(i, character.only=TRUE))

pts70 <- structure(list(Latitude = c(35.09263063, 35.09263784, 35.09264402,
35.09265182, 35.09265815, 35.09266566, 35.09267184, 35.09267979,
35.09269097, 35.09269627, 35.09270054, 35.09270422, 35.09271511,
35.09272232, 35.09272997, 35.09273821, 35.09273468, 35.09274645,
35.09277486, 35.09280812, 35.09284226, 35.09287464, 35.09290098,
35.0929129, 35.09291143, 35.09289568, 35.09287273, 35.09285683,
35.09285477, 35.09287331, 35.09290672, 35.09294866, 35.09298825,
35.09301548, 35.09301769, 35.09301077, 35.09299223, 35.09296839,
35.09294557, 35.09292924, 35.09291894, 35.09290893, 35.09289936,
35.09289112, 35.09288273, 35.0928742, 35.09286654, 35.09285771,
35.09285168, 35.09284314, 35.09283593, 35.0928271, 35.09282092,
35.09281209, 35.09280444, 35.09279826, 35.09278899, 35.09278148,
35.0927728, 35.09276544, 35.09275764, 35.09275146, 35.09274219,
35.0927363, 35.09272747, 35.09271967, 35.09271069, 35.09270378,
35.0926948, 35.09268847, 35.09268038), Longitude = c(-93.98941262,
-93.98937898, -93.98934607, -93.98931225, -93.9892779, -93.98924354,
-93.98921387, -93.98918347, -93.9891466, -93.98910901, -93.98907951,
-93.98904479, -93.98900594, -93.98897033, -93.98893741, -93.9889027,
-93.98885612, -93.98880917, -93.98880414, -93.98880971, -93.98880432,
-93.98878651, -93.98875773, -93.9887214, -93.98868668, -93.98865611,
-93.98862265, -93.98858002, -93.98853092, -93.98848326, -93.98845088,
-93.98844207, -93.98845808, -93.98849369, -93.9885329, -93.98856977,
-93.98859603, -93.98861744, -93.98864136, -93.9886714, -93.98870395,
-93.98873669, -93.98876906, -93.98880216, -93.98883651, -93.98887015,
-93.98890414, -93.98893849, -93.98897069, -93.98900486, -93.98903922,
-93.98907357, -93.98910811, -93.98913958, -93.98917268, -93.98920577,
-93.98923941, -93.98927196, -93.98930524, -93.98933833, -93.98937215,
-93.98940344, -93.98943744, -93.98947125, -93.98950453, -93.98953834,
-93.9895718, -93.98960579, -93.98963889, -93.98967288, -93.98970669
), Timestamp = c(1540321036L,
1540321037L, 1540321038L, 1540321039L, 1540321040L, 1540321041L,
1540321042L, 1540321043L, 1540321044L, 1540321045L, 1540321046L,
1540321047L, 1540321049L, 1540321050L, 1540321051L, 1540321052L,
1540321053L, 1540321054L, 1540321055L, 1540321056L, 1540321057L,
1540321058L, 1540321059L, 1540321060L, 1540321061L, 1540321062L,
1540321063L, 1540321064L, 1540321065L, 1540321066L, 1540321067L,
1540321068L, 1540321069L, 1540321070L, 1540321071L, 1540321072L,
1540321073L, 1540321074L, 1540321075L, 1540321076L, 1540321077L,
1540321078L, 1540321079L, 1540321080L, 1540321081L, 1540321082L,
1540321083L, 1540321084L, 1540321085L, 1540321086L, 1540321087L,
1540321088L, 1540321089L, 1540321090L, 1540321091L, 1540321092L,
1540321093L, 1540321094L, 1540321095L, 1540321096L, 1540321097L,
1540321098L, 1540321099L, 1540321100L, 1540321101L, 1540321102L,
1540321103L, 1540321104L, 1540321105L, 1540321106L, 1540321107L
)), row.names = 3371:3441, class = "data.frame")

sf_pts <- pts70 %>%
sf::st_as_sf(coords = c("Longitude", "Latitude"), agr="constant") %>%
sf::st_set_crs(4326) %>%
sf::st_transform(crs = 32615)

r <- raster()
bb <- extent(sf_pts)
r <- setExtent(r, bb)
res(r) <- 1
crs(r) <- '+init=EPSG:32615'









share|improve this question
























  • @42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
    – AMS Nomad
    Nov 10 at 0:54










  • Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
    – AMS Nomad
    Nov 10 at 1:19










  • Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
    – 42-
    Nov 10 at 1:35












  • @42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
    – AMS Nomad
    Nov 10 at 16:32










  • When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
    – 42-
    Nov 10 at 17:46















up vote
1
down vote

favorite
1









up vote
1
down vote

favorite
1






1





I have thousands of coordinates for point data (sample in code below) that are derived from a tractor guidance system with a timestamp for each coordinate. I created a 1 m resolution empty raster. How can I count the number of points within a specified distance (let's say 14 meters) for each raster cell but only for points not within 6 (+/- 3) timestamp units of the point?



libs <- c("raster","dplyr", "rgdal", "sp", "sf")
have <- libs %in% rownames(installed.packages())
if(any(!have)) install.packages(libs[!have])
sapply(libs, function(i) require(i, character.only=TRUE))

pts70 <- structure(list(Latitude = c(35.09263063, 35.09263784, 35.09264402,
35.09265182, 35.09265815, 35.09266566, 35.09267184, 35.09267979,
35.09269097, 35.09269627, 35.09270054, 35.09270422, 35.09271511,
35.09272232, 35.09272997, 35.09273821, 35.09273468, 35.09274645,
35.09277486, 35.09280812, 35.09284226, 35.09287464, 35.09290098,
35.0929129, 35.09291143, 35.09289568, 35.09287273, 35.09285683,
35.09285477, 35.09287331, 35.09290672, 35.09294866, 35.09298825,
35.09301548, 35.09301769, 35.09301077, 35.09299223, 35.09296839,
35.09294557, 35.09292924, 35.09291894, 35.09290893, 35.09289936,
35.09289112, 35.09288273, 35.0928742, 35.09286654, 35.09285771,
35.09285168, 35.09284314, 35.09283593, 35.0928271, 35.09282092,
35.09281209, 35.09280444, 35.09279826, 35.09278899, 35.09278148,
35.0927728, 35.09276544, 35.09275764, 35.09275146, 35.09274219,
35.0927363, 35.09272747, 35.09271967, 35.09271069, 35.09270378,
35.0926948, 35.09268847, 35.09268038), Longitude = c(-93.98941262,
-93.98937898, -93.98934607, -93.98931225, -93.9892779, -93.98924354,
-93.98921387, -93.98918347, -93.9891466, -93.98910901, -93.98907951,
-93.98904479, -93.98900594, -93.98897033, -93.98893741, -93.9889027,
-93.98885612, -93.98880917, -93.98880414, -93.98880971, -93.98880432,
-93.98878651, -93.98875773, -93.9887214, -93.98868668, -93.98865611,
-93.98862265, -93.98858002, -93.98853092, -93.98848326, -93.98845088,
-93.98844207, -93.98845808, -93.98849369, -93.9885329, -93.98856977,
-93.98859603, -93.98861744, -93.98864136, -93.9886714, -93.98870395,
-93.98873669, -93.98876906, -93.98880216, -93.98883651, -93.98887015,
-93.98890414, -93.98893849, -93.98897069, -93.98900486, -93.98903922,
-93.98907357, -93.98910811, -93.98913958, -93.98917268, -93.98920577,
-93.98923941, -93.98927196, -93.98930524, -93.98933833, -93.98937215,
-93.98940344, -93.98943744, -93.98947125, -93.98950453, -93.98953834,
-93.9895718, -93.98960579, -93.98963889, -93.98967288, -93.98970669
), Timestamp = c(1540321036L,
1540321037L, 1540321038L, 1540321039L, 1540321040L, 1540321041L,
1540321042L, 1540321043L, 1540321044L, 1540321045L, 1540321046L,
1540321047L, 1540321049L, 1540321050L, 1540321051L, 1540321052L,
1540321053L, 1540321054L, 1540321055L, 1540321056L, 1540321057L,
1540321058L, 1540321059L, 1540321060L, 1540321061L, 1540321062L,
1540321063L, 1540321064L, 1540321065L, 1540321066L, 1540321067L,
1540321068L, 1540321069L, 1540321070L, 1540321071L, 1540321072L,
1540321073L, 1540321074L, 1540321075L, 1540321076L, 1540321077L,
1540321078L, 1540321079L, 1540321080L, 1540321081L, 1540321082L,
1540321083L, 1540321084L, 1540321085L, 1540321086L, 1540321087L,
1540321088L, 1540321089L, 1540321090L, 1540321091L, 1540321092L,
1540321093L, 1540321094L, 1540321095L, 1540321096L, 1540321097L,
1540321098L, 1540321099L, 1540321100L, 1540321101L, 1540321102L,
1540321103L, 1540321104L, 1540321105L, 1540321106L, 1540321107L
)), row.names = 3371:3441, class = "data.frame")

sf_pts <- pts70 %>%
sf::st_as_sf(coords = c("Longitude", "Latitude"), agr="constant") %>%
sf::st_set_crs(4326) %>%
sf::st_transform(crs = 32615)

r <- raster()
bb <- extent(sf_pts)
r <- setExtent(r, bb)
res(r) <- 1
crs(r) <- '+init=EPSG:32615'









share|improve this question















I have thousands of coordinates for point data (sample in code below) that are derived from a tractor guidance system with a timestamp for each coordinate. I created a 1 m resolution empty raster. How can I count the number of points within a specified distance (let's say 14 meters) for each raster cell but only for points not within 6 (+/- 3) timestamp units of the point?



libs <- c("raster","dplyr", "rgdal", "sp", "sf")
have <- libs %in% rownames(installed.packages())
if(any(!have)) install.packages(libs[!have])
sapply(libs, function(i) require(i, character.only=TRUE))

pts70 <- structure(list(Latitude = c(35.09263063, 35.09263784, 35.09264402,
35.09265182, 35.09265815, 35.09266566, 35.09267184, 35.09267979,
35.09269097, 35.09269627, 35.09270054, 35.09270422, 35.09271511,
35.09272232, 35.09272997, 35.09273821, 35.09273468, 35.09274645,
35.09277486, 35.09280812, 35.09284226, 35.09287464, 35.09290098,
35.0929129, 35.09291143, 35.09289568, 35.09287273, 35.09285683,
35.09285477, 35.09287331, 35.09290672, 35.09294866, 35.09298825,
35.09301548, 35.09301769, 35.09301077, 35.09299223, 35.09296839,
35.09294557, 35.09292924, 35.09291894, 35.09290893, 35.09289936,
35.09289112, 35.09288273, 35.0928742, 35.09286654, 35.09285771,
35.09285168, 35.09284314, 35.09283593, 35.0928271, 35.09282092,
35.09281209, 35.09280444, 35.09279826, 35.09278899, 35.09278148,
35.0927728, 35.09276544, 35.09275764, 35.09275146, 35.09274219,
35.0927363, 35.09272747, 35.09271967, 35.09271069, 35.09270378,
35.0926948, 35.09268847, 35.09268038), Longitude = c(-93.98941262,
-93.98937898, -93.98934607, -93.98931225, -93.9892779, -93.98924354,
-93.98921387, -93.98918347, -93.9891466, -93.98910901, -93.98907951,
-93.98904479, -93.98900594, -93.98897033, -93.98893741, -93.9889027,
-93.98885612, -93.98880917, -93.98880414, -93.98880971, -93.98880432,
-93.98878651, -93.98875773, -93.9887214, -93.98868668, -93.98865611,
-93.98862265, -93.98858002, -93.98853092, -93.98848326, -93.98845088,
-93.98844207, -93.98845808, -93.98849369, -93.9885329, -93.98856977,
-93.98859603, -93.98861744, -93.98864136, -93.9886714, -93.98870395,
-93.98873669, -93.98876906, -93.98880216, -93.98883651, -93.98887015,
-93.98890414, -93.98893849, -93.98897069, -93.98900486, -93.98903922,
-93.98907357, -93.98910811, -93.98913958, -93.98917268, -93.98920577,
-93.98923941, -93.98927196, -93.98930524, -93.98933833, -93.98937215,
-93.98940344, -93.98943744, -93.98947125, -93.98950453, -93.98953834,
-93.9895718, -93.98960579, -93.98963889, -93.98967288, -93.98970669
), Timestamp = c(1540321036L,
1540321037L, 1540321038L, 1540321039L, 1540321040L, 1540321041L,
1540321042L, 1540321043L, 1540321044L, 1540321045L, 1540321046L,
1540321047L, 1540321049L, 1540321050L, 1540321051L, 1540321052L,
1540321053L, 1540321054L, 1540321055L, 1540321056L, 1540321057L,
1540321058L, 1540321059L, 1540321060L, 1540321061L, 1540321062L,
1540321063L, 1540321064L, 1540321065L, 1540321066L, 1540321067L,
1540321068L, 1540321069L, 1540321070L, 1540321071L, 1540321072L,
1540321073L, 1540321074L, 1540321075L, 1540321076L, 1540321077L,
1540321078L, 1540321079L, 1540321080L, 1540321081L, 1540321082L,
1540321083L, 1540321084L, 1540321085L, 1540321086L, 1540321087L,
1540321088L, 1540321089L, 1540321090L, 1540321091L, 1540321092L,
1540321093L, 1540321094L, 1540321095L, 1540321096L, 1540321097L,
1540321098L, 1540321099L, 1540321100L, 1540321101L, 1540321102L,
1540321103L, 1540321104L, 1540321105L, 1540321106L, 1540321107L
)), row.names = 3371:3441, class = "data.frame")

sf_pts <- pts70 %>%
sf::st_as_sf(coords = c("Longitude", "Latitude"), agr="constant") %>%
sf::st_set_crs(4326) %>%
sf::st_transform(crs = 32615)

r <- raster()
bb <- extent(sf_pts)
r <- setExtent(r, bb)
res(r) <- 1
crs(r) <- '+init=EPSG:32615'






r r-raster sp sf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 16:20

























asked Nov 10 at 0:09









AMS Nomad

388




388












  • @42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
    – AMS Nomad
    Nov 10 at 0:54










  • Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
    – AMS Nomad
    Nov 10 at 1:19










  • Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
    – 42-
    Nov 10 at 1:35












  • @42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
    – AMS Nomad
    Nov 10 at 16:32










  • When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
    – 42-
    Nov 10 at 17:46




















  • @42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
    – AMS Nomad
    Nov 10 at 0:54










  • Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
    – AMS Nomad
    Nov 10 at 1:19










  • Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
    – 42-
    Nov 10 at 1:35












  • @42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
    – AMS Nomad
    Nov 10 at 16:32










  • When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
    – 42-
    Nov 10 at 17:46


















@42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
– AMS Nomad
Nov 10 at 0:54




@42-I added the point and line buffers, as well as library code. I could not figure out how to count the number of points/lines within 7 meters for the raster object, so excluded here.
– AMS Nomad
Nov 10 at 0:54












Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
– AMS Nomad
Nov 10 at 1:19




Strange, I just ran this in a vanilla environment and no error. Running R 3.5.1 in Windows 7 pro. Sorry my variable name was confusing for you, but should run fine with copy/paste into an R script.
– AMS Nomad
Nov 10 at 1:19












Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
– 42-
Nov 10 at 1:35






Package access was fine. My R version (running in Linux) is also 3.5.1 and all of my packages were installed in the last week. raster ; dplyr ; rgdal ; sp ; sf : respectively: "2.8-4" "0.7.7" "1.3-6" "1.3-1" "0.7-1". I've looked at the output but I'm having trouble figuring out the actual problem. Perhaps if you plotted what you are seeing and made reference to to specific locations?
– 42-
Nov 10 at 1:35














@42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
– AMS Nomad
Nov 10 at 16:32




@42-I tried to clarify the question; the answer to which will solve at least the first step in my overall problem.
– AMS Nomad
Nov 10 at 16:32












When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
– 42-
Nov 10 at 17:46






When I change "EPSG" to "epsg" the warning goes away, and there is then valid entry in r@crs@progargs, but the added titles to the plots do not help me understand your problem. It's perfectly possible that my lack of experience with the specialized spatial data structures and terminology is the reason I still don't understand. If I were you, I would try posting the question in the spatial SIG mailing list. I would suggest further expanding your description of what you are trying to do. It still seems cryptic to me.
– 42-
Nov 10 at 17:46



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234857%2fcount-the-number-of-points-within-a-specific-distance-of-each-raster-cell-with-a%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53234857%2fcount-the-number-of-points-within-a-specific-distance-of-each-raster-cell-with-a%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff