I have been given a non-spatial database which contains the names of lines which I have a shapefile for. The database also has names of points and the distance of each point from the origin along the route of these lines. How would I create a point shapefile which locates each of the points?

Of course I would like to use QGIS, or GRASS and as a last resort I can get access to ArcGIS. I expect I will have to carry out a step to specify which end of the line is the origin.

  • 2
  • 1
    Do the points stay on the line? or are they at difference offsets to the line. – Nathan W Jul 9 '11 at 5:15
  • Points will be on the line. Lines will really be a route, i.e. 5 or so lines make up the path from the origin. So not simply the distance from the origin. – BWill Jul 9 '11 at 13:07
  • Thanks Mike, yes the concept of Linear Referencing as disussed for GRASS is appropriate. I will work on that. ciao – BWill Jul 9 '11 at 13:09
  • 1
    On the other hand, I think I'll give this a try in QGIS wiki.faunalia.it/dokuwiki/doku.php/qgis/lrs has anyone else used this? I found it now because Mike has pointed out what the concept is and I had better luck with the search. Whilst I am prepared to learn to be firends with GRASS, I would rather put the time in to learn PostGIS. – BWill Jul 9 '11 at 13:23

An alternate method is to use the haversine formula, since you have the lines in a shapefile, you can use QGIS to extract the begin and end points to calculate the bearing. Once you have the bearing and the distance from the origin, you can calculate the end point. This all doable in excel as documented here: http://www.movable-type.co.uk/scripts/latlong.html.

Once you have calculated the coordinates of the endpoints, save them to a CSV file and use ogr2ogr to turn them into a shape file using a VRT as shown here: http://www.gdal.org/ogr/drv_csv.html

  • 1
    Thank you for your creative answer (and welcome to our site!). The O.P. probably means "polylines" instead of (geometric) "lines." That's why linear referencing solutions are preferable. Note, too, that the haversine formula is appropriate only for spherical data, not for projected data (nor even for ellipsoidal datums if high accuracy is required). – whuber Jul 11 '11 at 16:25
  • True on all accounts, but it's reasonably easy to reproject coordinates using any of the implementations of proj4 and if more accuracy is needed, one can also use the Vincenty formula. Anyway thanks for the welcome Bill, long time since I've bumped into you back in the Arcview-L days. – user3615 Jul 11 '11 at 21:20
  • @Sophia To keep threads clean, we encourage people to edit improvements into their original answers (rather than submit multiple replies) and to carry on short focused discussions via comments. You don't yet have the rep to create comments, so I moved your reply for you. If you keep contributing answers, you'll quickly get the needed reputation: I look forward to it! – whuber Jul 11 '11 at 21:54
  • @whuber you are correct, it is a polyline. Actually a canal network. – BWill Jul 16 '11 at 7:38

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.