1

In QGIS what is the best way of moving an existing point (or digitising a new point) when you have:

  • the starting x,y (UTM) coordinate;
  • the angle from compass bearing towards the unknown point, and;
  • a distance to the new point?

Hopefully this could be achieved using the field calculator by adding specific formulas in a new field, the QGIS GUI or a pre existing plugin?

(Would like to do this for singular points as well as for a list of coordinates or point shapefiles)

QGIS 2.16.2 Using UTM coordinates in Australia

EDIT:
Ideally the solution would be able to be incorporated into/accessed by or calculated on a point shapefile in the QGIS graphical modeler to work with other algorithms.

(NB: the usual originating points will be coming from someone's Garmin GPS ... so my initial steps are to smooth that transition in the best way possible to convert to .shp (converting to UTM format) as well as adding the bearing and distance fields from field notes but hopefully I can also automate that in to the data capture stage.)

Here is some sample data that would be worked on
Shapefile:
http://www.filedropper.com/pointstomoveshpfile

Spreadsheet:
http://www.filedropper.com/pointstomove

guestagain
  • 927
  • 9
  • 23
  • 2
    You seem to be asking "does anyone know of (or how to setup) the script in Answer 1. set up for a QGIS script?". By "Answer 1" I am assuming that you mean http://gis.stackexchange.com/a/76175/115 which is currently the most upvoted answer. In any event for coding questions please always include your own code to show what you have tried and where you are stuck. There is an [edit] button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. – PolyGeo Sep 18 '16 at 09:26
  • 1
    Hey mate,

    Sorry if I wasn't clear. Not so lucky to have any code of my own to add in (in fact, my skills in that department are rather limited). My intention was to make reference to that answer as it seemed close to a possible solution to my problem if someone was able to provide a script that could be simply pasted into the QGIS python console or script creator.

    – guestagain Sep 18 '16 at 10:03
  • If you [edit] out the request for a script and coding help, and focus your question instead on how to do it through the QGIS GUI then it should be possible for it to be voted to re-open. – PolyGeo Sep 18 '16 at 10:06
  • ok. Seperate to requesting a script or coded solution, the question also asked for best practice procedural steps to digitise in QGIS a new point when having the starting x,y (UTM) coordinates, the angle from compass bearing towards the point and a distance to the new point. – guestagain Sep 18 '16 at 10:06
  • For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. – PolyGeo Sep 18 '16 at 10:17
  • how're the edits, will the reworded question make the cut to be reopened? – guestagain Sep 18 '16 at 10:18
  • This part still sounds like a request for code: "or by copying and pasting a predefined script/code into either the Python console or into the "create new scripts" functionality in the processing toolbox." – PolyGeo Sep 18 '16 at 10:19
  • Is requesting/recieving some pre-made code would solve the problem is that a bad thing?

    Am fairly new to this site so just learning the ins and outs of how it works.

    ... will try and add in some examples of what i've tried also.

    – guestagain Sep 18 '16 at 10:23
  • ok. Removed the reference to any code or predefined script as requested. – guestagain Sep 18 '16 at 10:51
  • 1
    For coding we are happy to help debug code snippets but "requesting/receiving some pre-made code" risks turning our volunteers into a free code writing/finding service, and burning them out. – PolyGeo Sep 18 '16 at 11:02
  • ok. As computers aren't my strong point, but volunteering the skills I have in other capacities is, I have been so lucky to learn so much and be empowered greatly by the FOSS and QGIS volunteers freely writing and maintaing the code for QGIS and its plugins and in all the extrememely helpful answers I've found on this site from wonderfully talented and generous people. Thanks a lot, so very grateful! – guestagain Sep 18 '16 at 11:16
  • 1
    Did you try Azimuth and Distance Plugin? https://plugins.qgis.org/plugins/qgsAzimuth/ – Zoltan Sep 18 '16 at 16:29
  • Hello @Zoltan, thankyou, yes I have tried the azimuth and distance plugin now. After some confusion setting its configurations correctly it has been very helpful. However, unfortunately it requires manual input of the values for each point, the creation of line layers, the creation of points from the lines, and then to be merged with the original points. This has gotten me through for now but for shifting many points collected in the field I wonder whether there isn't a way to automate this process with the field calculator in the attribute table perhaps? – guestagain Sep 19 '16 at 04:40
  • 1
    There are more options to automate the calculation. SurveyingCalculation plug-in can calculate coordinates, but the supported input formats are specific to total stations. If you send a short sample data probably a short gawk/python/... script can convert azimuth and distance to coordinate list which can be loaded as a csv data source. – Zoltan Sep 19 '16 at 18:18
  • Thanks @Zoltan for the tip. Having a go at the SurveyingCalculation plug-in. I have edited the original question to add a link to some sample data in .shp and .ods format. – guestagain Sep 20 '16 at 02:55

1 Answers1

1

You can make the necessary calculations in libreoffice-calc. Add the following formula to cell F2:

=B2+E2*SIN(D2/180*PI())

and to cell G2:

=C2+E2*COS(D2/180*PI())

Move down the small black box at the lower right corner of cell F2 and G2 to extend the formulas to all rows. Save your spreadsheet as CSV and import it into QGIS. You must import it twice if you would like to have start and end point as QGIS points (as two layers).

You can create a line between start and end points if you add WKT geometry to your spreadsheet, for example to H2 (and extend it to all rows):

=CONCATENATE("LINESTRING(",TEXT(B2, "#.##")," ", TEXT(C2, "#.##"), ", ", TEXT(F2, "#.##"), " ", TEXT(G2, "#.##"), ")")

In the add delimited text dialog select Well Known Text (WKT)...

Zoltan
  • 7,325
  • 17
  • 27
  • You're a champion @Zoltan!

    Had the trig. formulas wrong (I swear I passed maths in high school!) after copying them fr. another answer as x2=x1+dsin(a) & y2=y1+dcos(a).
    This helps a lot, but'll do some testing (inc. to see why some other methods tried like azimuth+distance plugin or another have the results very slightly different (by say ~50cm)). Rounding?
    Have put those formulas into field calc as "y_start"+"Distance_f"COS("Bearing_co" /180PI()) etc & they work a treat! Now to work out how to update geometry with the formulas so can get this working in QGIS/graphical modeler?

    – guestagain Sep 20 '16 at 14:21