2

I have a raster that is projected to a state plane CRS and I am adding polygon/polyline shapefiles that are projected to WGS84. On the fly transformation is set to reproject to my raster CRS. When I use the identify features tool to select a feature, under derived I can see the correct area/length measurements. Is there a way to transfer that exact information into a new column(s) in the attributes by using the field calculator?

2 Answers2

1

If you are not sure about the right units of measurements, save a copy of the shapefile into the CRS of the raster.

That way you will get the correct values using the $area function in field calculator.

Note that identify tool and field calculators use different methods to calculate areas: https://hub.qgis.org/issues/4252

Vector -> Geometry Tools -> Export/Add geometry columns

lets you choose if measurement of the new columns shall be in layer CRS, project CRS or ellipsodial (which the identify tool uses).

AndreJ
  • 76,698
  • 5
  • 86
  • 162
0

Add a column of the type you desire to use.
Use field calculator,
My field = [area]
Not exact syntax.

Brad Nesom
  • 17,412
  • 2
  • 42
  • 68
  • So by using $area expression in the field calculator, the area is calculated based off of the layer's CRS (WGS84) which will yield either an unusable answer or 0. I am wondering if there is a specific expression that will read the info that is under derived. – wonderstruck80 Aug 21 '13 at 04:46
  • $area would work if you have a spatial database. [area] is the existing area field. – Brad Nesom Aug 21 '13 at 04:55
  • You are saying that your layer is in WGS but the area field is in your desired units? I don't have qgis in front of me. But if I were in arcmap I would set the document projection to the units I want, and calculate the length or area using the document units. Possibly a check box – Brad Nesom Aug 21 '13 at 05:01
  • 1
    $area will return the area of the polygon in the layers units. – Nathan W Aug 21 '13 at 05:17