3

I used R to calculate the area of every land polygon of the world (Projection of the source shapefile: WGS84; CRS: EPGS: 4326).

To do that, I loaded the required packages ("sp" and "raster") and I simply used this line of code:

polygon_name$new_field <- area(polygon_name)/1000000

I divided by 1000000 to obtain the area in square kilometers.

However, repeating the same operation with QGIS 3.0.3 for some random polygons, I observed that the result is slightly different. For example, with R the surface of Antarctica is 13,924,270 kmq, whereas using QGIS is 13,761,440 kmq.

What could cause such difference?

  • 2
    Antarctica is a bit special in a lat-long projection, being around the pole. Can you add a couple more examples, perhaps some nearer the equator? – Spacedman Jun 22 '18 at 17:15
  • isnt EPGS 4326 in lat lon units?? – Kurt Jun 22 '18 at 17:22
  • 2
    It's likely you've got an ellipsoid set for your qgis project, so you may be comparing Cartesian vs ellipsoidal areas. – ndawson Jun 22 '18 at 23:24
  • @Spacedman, there is a difference between the two methods in every polygon, also for the equatorial ones. – M.S. Jun 25 '18 at 13:44
  • @ndawson, actually, in the project properties (General -> Measurements) the WGS84 elipsoid is set. However, looking at the CRS of the original shapefile I read in R before the area calculation crs (shapefile_name), I obtained the following +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs=0,0,0 – M.S. Jun 25 '18 at 14:27

Your Answer

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

Browse other questions tagged or ask your own question.