[gdal-dev] Labeling rasters

Jerl Simpson jsimpson at wxtrends.com
Mon May 16 14:34:21 EDT 2011


Hi guys and gals:

I have something that's evading me.  I have a basic ESRI Shape file
(created using gdal_contour) that I run through gdal_rasterize to
generate very nice looking contour map.  But I want the value of the
contour in there.

I've been trying different things with the -a option, but I can't get
it to work out.
Here's the latest thing I've tried for gdal_rasterize:

gdal_rasterize -a contour -3d -b 1 -b 2 -b 3 -b 4 -burn 255 -burn 255
-burn 255 -burn 255 -burn 255 -l contour contour BLANK.tif

I put an extra burn value in there (have also tried with out) to see
if maybe it was just going in as 0.  BLANK.tif is just a black image.
I'm sure I'm missing something simple, just can't see it.  I thought
the -a would burn the value of "contour" into the raster.

Thanks for any guidance!!

Here's the data from my shapefile:

INFO: Open of `contour/'
      using driver `ESRI Shapefile' successful.

Layer name: contour
Geometry: 3D Line String
Feature Count: 157
Extent: (-0.500000, -89.830132) - (359.500000, 89.144137)
Layer SRS WKT:
GEOGCS["GCS_WGS_1984",
    DATUM["WGS_1984",
        SPHEROID["WGS_1984",6378137,298.257223563]],
    PRIMEM["Greenwich",0],
    UNIT["Degree",0.017453292519943295]]
ID: Integer (8.0)
contour: Real (12.3)
OGRFeature(contour):0
  ID (Integer) = 0
  contour (Real) =     1000.000
  LINESTRING (87.765060240963862 80.0 1000,.....


More information about the gdal-dev mailing list