[Qgis-user] Nearest point on line

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Tue Oct 22 10:22:02 PDT 2019


All,

Just some additional info/thoughts, I tried doing this a bunch of different times over the years, and the best method I’ve come up with for this type of processing is to dump into postgres/postgis and do everything via SQL.  I actually needed to be able to dynamically run a stepped analysis with varied cut-off distances to a line, and this worked out very well, and was easy to reuse for other projects over time, since all the functionality ended up being stored as a View into the souce DB table data.

bobb



On Oct 22, 2019, at 11:35 AM, Falk Huettmann <fhuettmann at alaska.edu<mailto:fhuettmann at alaska.edu>> wrote:

Think Before You Click: This email originated outside our organization.

Hi there, Christoph,

generally speaking: I have another perspective about it and would approach your problem it in a different way:

Instead of pre-defined cut-offs (which are circular reasoning and are often surprising when checked in real world and GIS)
I would simply run a 'proximity to' points vs line first. And then in the resulting proximity table set a cut-off, select accordingly and see whether
this achieves the outcome wanted.

For pre-defined cut-offs, we call it usually 'geographic racism'.
Instead, we try to celebrate the gradient theory; when tested it often works better in real life.
Worth a test.

Just an alternative thought to the problem at hand.

Thanks, best
     Falk Huettmann











On Tue, Oct 22, 2019 at 3:26 AM Christoph Jung <jagodki.cj at gmail.com<mailto:jagodki.cj at gmail.com>> wrote:
Thank you all for your answers. I played a bit with the nnjoins plugin, but Andrews‘ answer is exactly what I was looking for :)

Sincerely,
Christoph

> Am 18.10.2019 um 20:50 schrieb Andrew McAninch <andrew at rabbit-troop.net<mailto:andrew at rabbit-troop.net>>:
>
> You can do this in the field calculator with the refFunctions plugin.   It gives you a function, geomnearest(), which will return the WKT geometry of the nearest line(or geomdistance() if you want to limit your search radius).  Then use the closest_point() function to find the nearest point on that line.  something like:
>
> closest_point(geom_from_wkt(geomdistance('lines','$geometry',10)) , $geometry)
>
>
> Andrew
>
>
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>> On Thursday, October 17, 2019 11:51 PM, Christoph Jung <jagodki.cj at gmail.com<mailto:jagodki.cj at gmail.com>> wrote:
>>
>> Hello list,
>>
>> Does QGIS has a function to calculate the nearest point on a line layer by a given point layer? In PostGIS i could query it with min(st_distance(...)) or st_closestpoint(...). But I miss such a function directly in QGIS (I just found the plugin Cloest Point, but it has some issues...).
>>
>> Sincerely,
>> Christoph
>>
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20191022/4b251fd9/attachment-0001.html>


More information about the Qgis-user mailing list