Sunday, 28 August 2016

qgis - Draw great circle rays from a single point along specific directions


How can I draw great circle rays starting from a single given point P (for example, from coordinate [34 N, 116 W] in this map) and along directions D1, D2, ... (for example, 30, 45 and 135 degrees) in QGIS? I do not have any shape files or other vectors for the lines. All I have is a point which can either be imported or selected interactively.


Note that I'd like to plot rays, not paths, since I don't have a destination point (only the direction). However, the map will finally be clipped to its extents, so if it makes things simpler, I can also generate points outside the map with the desired direction and import them.



Answer



It works for me this way:



  1. Create a text file with the following content:




Nr;WKT
1;Linestring (0 0, 0 19113000)


  1. Create a custom CRS around the point of your interest:



+proj=aeqd +lat_0=51 +lon_0=7 +x_0=0 +y_0=0 +a=6371000 +b=6371000 +units=m +no_defs




Note that I took the projection on a sphere, and my Linestring takes 3 times the radius. Set project CRS to that CRS.




  1. Install the the CAD Tools Plugin




  2. Import the text file as Delimited Textwith Semicolon as separator and your custom CRS.




  3. In the 7th part of the CAD Tools Toolbar, click on Select Vertex and Object, then click on the line, and the center point (0;0)





  4. click on the neighbouring icon Rotate Object. Enter an angle (from true North). You will get an error message, but see the line created.




  5. Carry on with all angles you want




  6. Set the Cad LayerLines Layer to edit mode





  7. Use Vector -> Geometry Tools -> Densify to add 100 intermediate points on all lines.




  8. Save the layer, and toggle edit mode off




  9. Change Project CRS to EPSG:3857, and add a Layer from Openlayers plugin.





You get this picture:


enter image description here


If you want great circles for another point, all you have to do is create another custom CRS, and set the CADLinesLayer to that CRS.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...