I am having an issue 'snapping' a points layer (be - bristol education) onto a road network (br - bristol_roads). I have created the code below using the PostGIS in Action guidebook as a reference however when I execute the code I receive this error -
SELECT DISTINCT ON (be.id) br.geom AS br_geom, be.geom AS be_geom, br.gid AS br_id, be.id AS be_id, ST_Line_Locate_Point( br.geom, ST_Line_Interpolate_Point(br.geom, be.geom) ) AS snapped_point FROM bristol_education AS be INNER JOIN bristol_roads AS br ON ST_DWithin(be.geom, br.geom, 1) ORDER BY be.id, ST_Distance(br.geom, be.geom); ERROR: function st_lineinterpolatepoint(geometry, geometry) does not exist LINE 8: ST_LineInterpolatePoint(br.geom, be.geom) ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. SQL state: 42883 Character: 147
Does anyone know how I can get around this? I have tried snapping the points in arcmap/qgis but it seems that PostGIS does not pick up on this.