-2

enter image description here

Data: ships AIS trajectory Data with longitude and latitude. (that data is a CSV file with several columns:id,time,lon,lat,etc.)//

I transform the point to line, every line is a ship trajectory. Now I want to make a trajectory heatmap to express the traffic flow of the different sea areas.

I think the map above is very well. I used the processing method: Polyline to raster, and adjust the relevant parameters. But the outcome has problem: if the cell is small, the raster lines will have a serrated edge. Ever I used the line density to calculate a raster and overlayer this raster onto the original trajectory. Then I adjust the color of them, but the maps are unsatisfactory because their shape did not match well.

I saw that kind of map above in some theses, different colors represent different trajectory densities which puzzles me for a long time. Are there some GISer could share your similar experience?

4
  • 1
    You need to edit your question and provide much more detail on your input data for anyone to offer a sensible solution.
    – Hornbydd
    Commented Jul 1, 2022 at 12:59
  • gis.stackexchange.com/a/366604/2856
    – user2856
    Commented Jul 3, 2022 at 5:37
  • 2
    Welcome to GIS SE. As a new user, please take the Tour. Unfortunately, our Focused question/ Best answer model does not lend itself well to "tell me how" Questions. Each of your comments in the Answer would be suitable Questions, if you explained how you attempted to solve the task and showed your current result, instead of just showing the goal and not demonstrating any effort. If you keep our problem-solving focus in mind (making that map is a task, not a problem), you can write a sufficiently focused Question.
    – Vince
    Commented Jul 3, 2022 at 11:53

1 Answer 1

2

There are probably several different ways of doing this calculation.

The easiest would probably be to rasterize each trajectory and adding it to a common "sum" raster. The raster's cell value would then describe how many trajectories pass through a certain cell. The raster can then be normalized against the total a amount trajectories to get the relative "density".

Depending on your application it might be lead to better performance to flip it around and iterate over the relevant cells. Then you would instead look at how many trajectories pass through the cell, then normalize the cell value and select pick the colour corresponding to that density.

2
  • I used the processing method: Polyline to raster, and adjust the relevant parameters. But the outcome has problem: if the cell is small, the raster lines will have aserrated edge. Commented Jul 2, 2022 at 7:08
  • Ever I used the line density to calculate a raster and overlayer this raster onto the original trajectory. Then I adjust the color of them, but the maps are unsatisfactory because their shape not match well. Commented Jul 2, 2022 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.