Hi Everyone,
I am currently trying to figure out how to count the number of times an object passes through each grid point defined by a set of coordinates. My grid is defined by x-coordinates and y-coordinates as:
longs = long[1]:Δ:long[2]
lats = lat[2]:-Δ:lat[1]
xx = longs' .* ones(length(lats))
yy = ones(length(longs))' .* (lats)
Where:
long = [-95.0, -75.0]
lat = [50.0, 62.5]
Δ = 0.005
What want to do is create a grid of x and y coordinates along those latitude and longitudes with a spacing of 0.005deg (which I believe I have successfully created). I now have traffic that transits along a path with a certain lat/long and I want to count the number of times each of the traffics positions fall within each grid cell but I am not sure how to do this. Would anyone be able to provide some guidance on how I can go about doing this or if there is a package that can do this? I will be counting the number of times traffic passes through each cell for ~500k different transits.
An example of a small transit path would be:
transit = Dict("longs"=>[-87.84, -85.03, -82.69, -81.54, -81.35], "lats"=>[61.57, 59.83, 56.51, 54.90, 54.29])