Extract Latitude/Longitude from polygon vertices on QGIS
Open your attribute table of the layer you want to add this information to and its field calculator. Create a new field with data type double/real and give it a length of 3 and a precision of, lets say, 8. Name it x/lng and y/lat and insert the expression
x(transform($geometry, layer_property(@layer_name, 'crs'), 'EPSG:4326'))
for longitude and
y(transform($geometry, layer_property(@layer_name, 'crs'), 'EPSG:4326'))
for latitude.
This expression will work with every source crs, so you do not need to care about that. In case your layers crs already is EPSG:4326, it would be enough to just enter the expression $x
or $y
.
If you need latitude and longitude as csv you may simply right click your vertices layer and choose Export > Save Features as...:
Then in the dialogue chose Comma Separated Value [CSV] in the combo box on top:
Chose a file name and if applies various restrictions for the output (attributes to export, extent,...). Scroll down and under Layer Options select the output format for your coordinates (here I chose 'AS_XY'). Note the tooltip!
The result will be something like (opened in Notepad++):