Note that there are some explanatory texts on larger screens.

plurals
  1. POUniformly colorize perfectly flat surfaces (contiguous pixels) in geotiff file in R
    primarykey
    data
    text
    <p>I am using RGDAL to read in and plot a geotiff file:</p> <pre><code>df.gtiff = readOGR("/df.tif") image(df.gtiff, red=1, green=2, blue=3) </code></pre> <p>The map contains some perfectly flat surfaces which are either lakes or ocean-sections, i.e. there are patches where contiguous pixels have the same elevation. Is there any way to identify these patches, say as polygons, so that I can color them uniformly (to blue, for example)? [Note: the file is too large to upload, so <code>gdalinfo(df.tif)</code> is given below):</p> <pre><code>Driver: GTiff/GeoTIFF Files: ~/df.tif Size is 2928, 2285 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]] Origin = (81.381111111111110,22.564444444444447) Pixel Size = (0.002083333333333,-0.002083333333333) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 81.3811111, 22.5644444) ( 81d22'52.00"E, 22d33'52.00"N) Lower Left ( 81.3811111, 17.8040278) ( 81d22'52.00"E, 17d48'14.50"N) Upper Right ( 87.4811111, 22.5644444) ( 87d28'52.00"E, 22d33'52.00"N) Lower Right ( 87.4811111, 17.8040278) ( 87d28'52.00"E, 17d48'14.50"N) Center ( 84.4311111, 20.1842361) ( 84d25'52.00"E, 20d11' 3.25"N) Band 1 Block=2928x1 Type=Byte, ColorInterp=Red Band 2 Block=2928x1 Type=Byte, ColorInterp=Green Band 3 Block=2928x1 Type=Byte, ColorInterp=Blue </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload