1

I have 2 point layers, I want to calculate the shortest distance between 2 point layers by python code and enclose the conditions of satisfaction. For example, a point a when there is the shortest distance with point b and this a point must have a field that satisfies the given condition.

Is there any python to do it?

geozelot
  • 30,050
  • 4
  • 32
  • 56
User0AB
  • 111
  • 4
  • We're a little different from other sites. We're a Q&A site, not a discussion forum. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an [edit] button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. Please check out our short [tour] for more about how the site works. Thanks. – PolyGeo Nov 26 '19 at 03:08
  • https://www.qgistutorials.com/en/docs/nearest_neighbor_analysis.html should be close with https://gis.stackexchange.com/questions/111784/displaying-only-selected-features-on-map-in-qgis to ensure the from and to layers satisfy the attribute conditions. This can be scripted like https://gis.stackexchange.com/questions/211659/how-to-calculate-distance-matrices-for-points-based-on-common-denominator – Michael Stimson Nov 26 '19 at 03:58

0 Answers0