3

I am using the NNjoin tool to compute the distance between points and a multilinestring. Both layers are in CRS 4326 and cover most of Africa.

I've understood that I need to reproject my layers to a projected coordinate system to be able to get the distance between the points in metres rather than degrees.

How can I choose which projected coordinate system to use?

2
  • Convert them to EPSG:3857 Commented Jun 8, 2020 at 17:30
  • 1
    No, Web Mercator is the last projection you want to use for distance calculation even within a kilometer of the Equator.
    – Vince
    Commented Jun 8, 2020 at 17:39

2 Answers 2

5

You could create a custom Chamberlin trimetric projected CRS.


From Snyder, John P. Map projections: A working manual. USGS Publications Warehouse. 1987:

The Chamberlin Trimetric projection is an approximate "three-point equidistant" projection, constructed so that distances from three chosen points to any other point on the map are approximately correct. The latter distances cannot be exactly true, but the projection is a compromise which the National Geographic Society uses as a standard projection for maps of most continents. This projection was geometrically constructed by the Society, of which Wellman Chamberlin (1908-76) was chief cartographer for many years.


For the Wikimedia example:

1

Africa on Chamberlin trimetric projection. 10° graticule, anchor points at (22°N, 0°), (22°N, 45°E), and (22°S, 22°30'E).


You can create the custom PROJ.4 string for the Chamberlin trimetric conversion method for a WGS84 datum:

+proj=chamb +lat_1=22 +lon_1=0 +lat_2=22 +lon_2=45 +lat_3=-22 +lon_3=22.5 +datum=WGS84 +type=crs

And ask its WKT2:2019 string with:

C:\>projinfo "+proj=chamb +lat_1=22 +lon_1=0 +lat_2=22 +lon_2=45 +lat_3=-22 +lon_3=22.5 +datum=WGS84 +type=crs"
PROJ.4 string:
+proj=chamb +lat_1=22 +lon_1=0 +lat_2=22 +lon_2=45 +lat_3=-22 +lon_3=22.5 +datum=WGS84 +type=crs

WKT2:2019 string:
PROJCRS["unknown",
    BASEGEOGCRS["unknown",
        DATUM["World Geodetic System 1984",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]],
            ID["EPSG",6326]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8901]]],
    CONVERSION["unknown",
        METHOD["PROJ chamb"],
        PARAMETER["lat_1",22,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]],
        PARAMETER["lon_1",0,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]],
        PARAMETER["lat_2",22,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]],
        PARAMETER["lon_2",45,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]],
        PARAMETER["lat_3",-22,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]],
        PARAMETER["lon_3",22.5,
            ANGLEUNIT["degree",0.0174532925199433,
                ID["EPSG",9122]]]],
    CS[Cartesian,2],
        AXIS["(E)",east,
            ORDER[1],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]],
        AXIS["(N)",north,
            ORDER[2],
            LENGTHUNIT["metre",1,
                ID["EPSG",9001]]]]
0

You can change te projected coordinate system in QGIS of the project by using ctrl+shift+P --> CRS

enter image description here

To change the projection of a layer, right click on the layer in the layers pane --> Set CRS --> Set Layer CRS.

enter image description here

Somebody before you already asked the same question.

Changing unit of measure from degrees to meters in QGIS?

1
  • 1
    I doubt if NNJOIN will recognize that the project's CRS has changed; most likely it will rely on the layer CRS, and will thus output gibberish. Much preferable to re-project the layer, as in Gabriel's answer.
    – Stu Smith
    Commented Jun 8, 2020 at 18:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.