1

I am currently using the QGIS C++ libraries to display a map. I am new to QGIS, and wantd to know what the difference between map and layer coordinates is? From what I understand, map gives the coordinates as per the CRS of the canvas. Is that correct?

1

Yes, map is the canvas, while layer is the individual layer.

And from the API Docs:

toMapCoordinates()

transformation from screen coordinates to map coordinates

http://qgis.org/api/classQgsMapTool.html#af5d1a72453be6d47ab1583d4e71e7e53

toLayerCoordinates()

transformation from screen coordinates to layer's coordinates

http://qgis.org/api/classQgsMapTool.html#a8b39f33854affab69ca560a530856609

  • 1
    Just to further clarify - screen coordinates are pixels. – ndawson Feb 10 '17 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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