1

I have data points where respondents have indicated where they were on vacation (variable pointsSH). In the attribute table of these data points is stored where the people live (the zip code). I also have a "centroid" layer, where all postal codes in Germany are given as point data (centroid). In PunkteSH there is also an ID number "I-number" stored, by which the assignment should be done. How can I measure the distance between the centroid of the zip code and the data point?

Vince
  • 20,017
  • 15
  • 45
  • 64
user227676
  • 11
  • 1
  • Welcome to GIS SE. As a new user, please take the [Tour]. We are a problem-solving site, so Questions here should always answer the most frequently asked comments: "What have you tried?" and "Where are you stuck?" Please [Edit] the Question. – Vince Jul 16 '23 at 16:54

1 Answers1

0

Try the Vector > Analysis Tools > Distance Matrix tool. Be aware that both point layers must be in the same coordinate reference system (CRS), and the CRS must use meters or feet as its unit of measure.

Stu Smith
  • 8,252
  • 8
  • 35
  • 84
  • with distance matrix it did not work... And i sadly do not have the same CRS... once I've got PunkteSH: EPSG:4326 - WGS 84 with the method Lat/long (Geodetic alias)

    And the centroid layer with:
    EPSG:3857 - WGS 84 / Pseudo-Mercator with the method Mercator

    – user227676 Jul 17 '23 at 06:56
  • Try to reproject the layers (or, at least, one of them) – jpinilla Jul 17 '23 at 09:47
  • 1
    Could you attach some test-data? Measuring distances with EPSG:3857 is probably not a good idea.... depends on the accuraccy you need: https://gis.stackexchange.com/questions/396004/getting-accurate-distance-measurements-using-epsg3857-in-qgis – Thomas B Jul 17 '23 at 10:11