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

  • 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 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 9: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
  • 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
  • 1
    Did you try Azimuth and Distance Plugin? plugins.qgis.org/plugins/qgsAzimuth – Zoltan Sep 18 '16 at 16:29
  • 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
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)...

  • 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" /180*PI()) 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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