Home > other >  ggplot2, spatial map, add a line segment on to the border
ggplot2, spatial map, add a line segment on to the border

Time:06-11

Using enter image description here

CodePudding user response:

The segment simply has the co-ordinates you gave it. A vertical line would be something like this:

kncoast <- data.frame(orig_lat=12.7571, 
                      orig_lon=74.87461,
                      dest_lat=15,
                      dest_lon=74.87461) 

enter image description here

If you want the line to stretch across the coast of Karnataka, then something like this would be better:

kncoast <- data.frame(orig_lat=12.7571, 
                      orig_lon=74.87461,
                      dest_lat=14.75,
                      dest_lon=74.15) 

enter image description here

  • Related