Sunday 12 May 2019

postgis - Calculate distance between point and linestring and how to represent that on QGIS?


I have loaded my data with osm2pgrouting and I have my network with ways (Linestring) and nodes (Point). The problem is : I have a database of doctors addresses (point) and I should calculate the distance between these points and my ways (Linestring).


Yellow points are Doctors : 1


I am using the following query :



SELECT ST_Distance ( 
ST_GeomFromText('POINT(55.4504545699355 -20.8752577759738)',4326),
ST_GeomFromText('LINESTRING(55.4748349 -27.1342723, 55.4747091 -21.1338699)',4326) )
As ST_DISTANCE;

But I don't think that works. I need to calculate the distance from all the doctors points and represent that in QGIS as a linestring.


Any help or advice?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...