I have a point layer, that I'd like to return the Longitude, latitude using the qgis api. I assume I need to use QgsPoint
This works on the latest release 'Tethys'.
The point layer that I am interested in is the first layer in my layer list. The coordinate values will be in the units of the spatial reference system of the layer. If your layer is in lat/lon, remember that x=lon and y=lat...
Open the Python Console and type this:
This requires your layer to be in a projection using lat/lon to return geographic coordinates:
(taken from Points2One Plugin by Pavol Kapusta & Goyo Diaz)