[Gdal-dev] gdal_rasterize for World Vector Shoreline (WVS) data

John Mitchell mitchelljj98 at gmail.com
Wed Jan 24 10:46:32 EST 2007


Frank,

I created a blank file to work in with gdal_translate from an existing file:

gdal_translate -scale 0 100 0 0.01 -a_ullr -180 90 180 -90 -a_srs EPSG:4326
source.tif blank.tif

running gdalinfo I get:

Driver: GTiff/GeoTIFF
Size is 10000, 10000
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.2572235630016,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (-180.000000000000000,90.000000000000000)
Pixel Size = (0.036000000000000,-0.018000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=Adobe Photoshop CS Windows
  TIFFTAG_DATETIME=2005:12:29 11:49:37
  TIFFTAG_XRESOLUTION=72
  TIFFTAG_YRESOLUTION=72
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
Lower Left  (-180.0000000, -90.0000000) (180d 0'0.00"W, 90d 0'0.00"S)
Upper Right ( 180.0000000,  90.0000000) (180d 0'0.00"E, 90d 0'0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0'0.00"E, 90d 0'0.00"S)
Center      (   0.0000000,   0.0000000) (  0d 0'0.01"E,  0d 0'0.01"N)
Band 1 Block=10000x1 Type=Byte, ColorInterp=Red
Band 2 Block=10000x1 Type=Byte, ColorInterp=Green
Band 3 Block=10000x1 Type=Byte, ColorInterp=Blue

I then run:

gdal_rasterize -b 1 -b 2 -b 3 -burn 0 -burn 0 -burn 255 -l WVSPLUS_polyline
WVSPLUS_polyline.shp blank.tif

gdal_rasterize successfully processes, but when I look at the blank.tif file
within openEV_FW it still appears to be blank when I was expecting blue to
appears for the shoreline in fact if I put blank.tif on top of the
WVSPLUS_polyline.shp layer within openEV_FW it completely covers it up.

John

On 1/23/07, Frank Warmerdam <warmerdam at pobox.com> wrote:
>
> John Mitchell wrote:
> > Hi,
> >
> > I would like to try gdal_rasterize to convert World Vector Shoreline
> > (WVS) data into raster data.  I am hoping that this will speed up
> > performance when viewing this data within MapServer.  In the
> > documentation is says "Currently gdal_rasterize cannot create new output
> > files though that may be added eventually".  I don't want to merge WVS
> > with an existing raster layer, but have its own layer.  How can I create
> > a blank geotiff that I can use as output for this rasterized WVS data?
>
> John,
>
> This may seem odd, but I've often created a blank file to work in
> with gdal_translate from some existing file.  I use "-scale 0 100 0 0.01"
> to essentially force all the pixels to zero and switches like -a_ullr
> and -a_srs to set the bounds and coordinate system.
>
> Best regards,
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org
>
>


-- 
John J. Mitchell
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070124/3354a257/attachment.html


More information about the Gdal-dev mailing list