6

I have the map of Cambodia(map) and the economic land concessions(elc). In trying to find the proportion of district covered by land concesions, I need the area variable. But when I create the variable as $area, there are some entries that are NULL - it is the case for both layers. I have tried 'fix geometries.' It mostly fixed the problem for elc layer but still is NULL for one layer as following. Smaller piece and the bigger piece are seperate entries but area is calculated only for the small area.

enter image description here

The area calculation issue is not fixed at all for the elc layer. What is the next thing I could try to fix this problem?

I am following the steps from this link: Finding overlay percentage between two polygon shapefiles

Data using: GEO2_KH (Cambodia shapefile) https://international.ipums.org/international/gis_harmonized_2nd.shtml ELCs: All economic land concessions shapefile https://data.opendevelopmentcambodia.net/dataset/economiclandconcessions

2
  • 2
    Please add the projection your are using. – Mapperz Jan 26 at 4:51
  • 1
    @mapperz, I am using EPSG:4326 - WGS 84. Thank you! – JessicaP Jan 26 at 5:18
10

Short Answer

you have to re-project the shapefile to EPSG:3148 - Indian 1960 / UTM zone 48N

Long Answer

  1. Load the shapefile
  2. Left click the shapefile in Layers pallet
  3. Go to Export > Save feature as
  4. Save as ESRI Shapefile with giving a new File Name and setting the coordinate system CRS as EPSG:3148 (EPSG:3148- Indian 1960 / UTM zone 48N)

enter image description here

  1. Then go to Attribute Table of the newly created shapefile
  2. Go to Field Calculator
  3. And enter $area in the Expression Field while giving a name to the column with data type int (if you prefer int64 over int give int64 but not required) enter image description here

then all the shapes with a positive geometry will display an area.

enter image description here

but areas with unknown geometry will not display any area

enter image description here

8
  • 1
    Thanks Uditha! Could I ask why re-projection was necessary? – JessicaP Jan 26 at 7:15
  • 1
    Thank you so much, Uditha! – JessicaP Jan 26 at 7:26
  • 2
    As explanation, $area returns the area calculated in the units of the CRS being used. EPSG:4326 is unprojected, in degrees latitude and longitute. So the answer is in "square degrees" (it's actually a bit more complicated) with one "square degree" being about 10000 sq km on the ground. I expect some of your areas were close to zero at this scale. When you reproject to a better CRS, the calculation takes place in square meters. – Houska Jan 26 at 12:09
  • 1
    Good Answer, thanks for taking time for this detailed answer, – Mapperz Jan 26 at 14:20
  • 1
    What do you mean by a "positive geometry"? I have the same problem, as some polygons return NULL areas, but I already had my data projected (I'm using UTM Zone 36N) – Hany Nagaty Feb 4 at 12:17

Your Answer

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

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