mod13A2g.c 559 B

12345678910111213141516171819202122232425
  1. /* mod13A2 Land/Water Flags 1Km bits[11-13]
  2. * 000 -> class 0: Shallow Ocean
  3. * 001 -> class 1: Land (Nothing else but land)
  4. * 010 -> class 2: Ocean Coastlines and lake shorelines
  5. * 011 -> class 3: Shallow inland water
  6. * 100 -> class 4: Ephemeral water
  7. * 101 -> class 5: Deep inland water
  8. * 110 -> class 6: Moderate or continental ocean
  9. * 111 -> class 7: Deep ocean
  10. */
  11. #include <grass/raster.h>
  12. CELL mod13A2g (CELL pixel)
  13. {
  14. CELL qctemp;
  15. pixel >>= 11; /*bits [11-13] become [0-2] */
  16. qctemp = pixel & 0x07;
  17. return qctemp;
  18. }