7

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.

BWill
  • 1,772
  • 1
  • 16
  • 27
  • 2
    See http://grass.osgeo.org/gdp/html_grass63/lrs.html – Mike T Jul 09 '11 at 02:12
  • 1
    Do the points stay on the line? or are they at difference offsets to the line. – Nathan W Jul 09 '11 at 05: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 09 '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 09 '11 at 13:09
  • 1
    On the other hand, I think I'll give this a try in QGIS https://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 09 '11 at 13:23
  • As far as we can make out it turns out the LRS was created as output from on a old polyline which had significant location errors. Since then the database and LRS have been updated manually, probably these updates are accurate, but cannot be distinguished from the original dataset. My colleagues did not want to go to the trouble of outputing a poorly located GIS layer. So cannot report to you on the use of LRS in QGIS just yet. But will have a go at in the next few weeks. – BWill Jul 16 '11 at 07:37

1 Answers1

6

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

sophia
  • 61
  • 1
  • 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. –  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 07:38