1

I am trying to calculate the areas of administrative regions in Uganda, using the EPSG:102022 projection. They are polygons. But everything I do produces areas in degrees rather than meters, giving results with small decimal values. I'm using QGIS 2.18 on a Mac. It should be so simple, but I'm at my wit's end. Does anyone know the secret?

I have tried:
-Using Vector/Geometry Tools/AddGeometryColumns and $area in fieldcalculator
-Using Layer and Project CRS
-Turning off on-the-fly re-projection
-Turning off the Render toggle
-Saving and loading new .shp files with the EPSG:102022 projection
-Changing all the defaults in Settings/Options/CRS to EPSG:102022
-Running Singlepart to Multipart and the reverse
-Updating QGIS
-Restarting my computer

There have been many similar questions posted, and none of the answers or comments in them are working for me: Area is calculating wrong using $area in field calculator (QGIS 2.8.1-Wien) How to calculate polygon areas in QGIS?

In case you want the file: https://drive.google.com/file/d/0B5fZYKTx5SCbWmFuQkVpYVBXbFU/view?usp=sharing

  • Have you checked your polygon layer for invalid geometries, such as lines that cross, or duplicate nodes? The topology checker plugin will help you find issues, but you'll have to fix them manually. – csk Mar 23 '17 at 16:27
  • Another thing you could try: do the area calculation in a new QGIS project with no extra layers. Sometimes it seems that even with OTF reprojection turned off, the projections of other layers mess with the calculations. Especially if you have a baselayer like Google Maps that uses a pseudomercator projection. – csk Mar 23 '17 at 16:33
  • Welcome to GIS SE! As a new user please take the [tour] to learn about our focused Q&A format. – Midavalo Mar 23 '17 at 16:35
  • EPSG:102022 is not an official EPSG code but an ESRI code even sites like https://epsg.io/102022 seem to give wrong authority. You may need to add a custom projection to QGIS with the parameters that you find from the link before QGIS know what it is. – user30184 Mar 23 '17 at 20:51
  • Thank you @csk I did have one small error in the geometry, but I am getting the same issue now that I have fixed it. Also for other shapefiles that I haven't modified at all. – Carolina Mattsson Mar 23 '17 at 22:52
  • Thank you @user30184 . I tried creating a custom projection with the same parameters, but no dice. Does this look like a reasonable CRS definition? I don't know enough about them to recognize if something is wrong: +proj=aea +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs – Carolina Mattsson Mar 23 '17 at 22:55
  • As a note, this is the only shapefile I have open, in an entirely new project. – Carolina Mattsson Mar 23 '17 at 22:57
  • I just tried measuring a rough outline of the entire shapefile using the Measure tool. It gave an area of 17.4 square meters for the entire country of Uganda, which obviously is incorrect. With a base layer added in, it became clear that this shapefile is displaying as far too small, and located somewhere in Congo (DRC). So the measurement tool is working correctly, but there's something wrong with the shapefile. Probably the projection. Try changing the projection under layer properties (not using save as...). – csk Mar 23 '17 at 23:40
  • OK, I've tried changing the projection to the default (ESPG:4326) and also to one of the UTM 36N ones (ESPG:21096). Without on-the-fly projection this changes where the image is displayed, ie. I have to re-center to see it. But using Vector/Geometry Tools/AddGeometryColumns gives me the same area values in the low decimals for both. Ditto if I save a new shapefile using ESPG:21096 and load it in a fresh open of QGIS.

    Do you have a projection that you suggest I try?

    – Carolina Mattsson Mar 24 '17 at 00:17
  • So, for now I've taken the area that does come out of the calculation and multiplied by 111*111, since one degree ~111km at the equator and Uganda is on the equator. That gives reasonable values in square kilometers, which is making me more certain that QGIS keeps giving me the area in degrees no matter what projection I give it. It's a dumb solution, but it's what I'm doing for now. – Carolina Mattsson Mar 24 '17 at 00:40
  • try adding and renaming this uganda.dbf to l2admin.dbf from https://drive.google.com/open?id=0B9mStgOXbs-jeGg3ZEdSQlU0V00 to your data (removing your .dbf) has the area (km sq) calculated. – Mapperz Mar 24 '17 at 00:59
  • Thank you @Mapperz, but could you tell me where that file comes from? A few of the areas show up as negative for me... – Carolina Mattsson Mar 25 '17 at 18:22

0 Answers0