Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to figure out how to calculate the lat/long of points using the QGIS field calculator. Is there an easy way to do this? I saw a previous related question, but it deals with a more advanced approach.

In ArcGIS this is similar to the Calculate Geometry function; I just can't find where do this in QGIS.

share|improve this question
add comment

1 Answer

up vote 14 down vote accepted

Sure can. First, save the layer as WGS84 and import it again. Then in the field calculator you can use $x or $y as a variable to get the x and y.

x and y

NOTE: This was added in 1.7.

share|improve this answer
    
Wonderful! How did you know that $x returns this value? –  djq Mar 14 '11 at 6:16
3  
Looked in the code for the field calculator :) The wonders of open source. –  Nathan W Mar 14 '11 at 6:22
    
This isn't documented anywhere outside the code yet because it has been added only last week. –  underdark Mar 14 '11 at 7:41
    
and that too... –  Nathan W Mar 14 '11 at 9:44
    
@NathanW Is it really enough to just enable on-the-fly reprojection? I tested and it only worked after reprojection using "Save as ...". –  underdark Mar 13 '13 at 7:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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