O'Reilly logo

Building Mapping Applications with QGIS by Erik Westra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Set Start Point and Set End Point actions

The Set Start Point and Set End Point toolbar actions allow the user to set the start and end points in order to calculate the shortest path between these two points. To implement these actions, we're going to need a new map tool that lets the user click on a track vertex to select the starting or ending points.

Note

By positioning the start point and the end point on vertices, we guarantee that the points lie on a track's LineString. We could theoretically be more sophisticated and snap the starting and ending points to anywhere along a track segment, but that's more work, and we're trying to keep the implementation simple.

Go back to the mapTools.py module and add the following class definition to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required