[gdal-dev] gdal_warp

Rob gis at vanbooth.com
Fri Jun 18 10:48:13 EDT 2010


Thanks for the replies so far, but I'm obviously missing a trick as it
doesnt seem to be working.

The gdalinfo on my TIF looks like this.

E:\rasters>gdalinfo tq00ne.tif
Driver: GTiff/GeoTIFF
Files: tq00ne.tif
       tq00ne.tfw
Size is 7874, 7874
Coordinate System is `'
Origin = (505000.000000000000000,110000.000000000000000)
Pixel Size = (0.635001270002540,-0.635001270002540)
Metadata:
  TIFFTAG_IMAGEDESCRIPTION=1:10000 TILE TQ00NE
  TIFFTAG_DATETIME=2008:07:14 23:22:37
  TIFFTAG_COPYRIGHT=ORDNANCE SURVEY CROWN COPYRIGHT 2008
  TIFFTAG_XRESOLUTION=400
  TIFFTAG_YRESOLUTION=400
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  505000.000,  110000.000)
Lower Left  (  505000.000,  105000.000)
Upper Right (  510000.000,  110000.000)
Lower Right (  510000.000,  105000.000)
Center      (  507500.000,  107500.000)
Band 1 Block=7874x8 Type=Byte, ColorInterp=Palette
  Image Structure Metadata:
    NBITS=4
  Color Table (RGB with 16 entries)
    0: 0,0,0,255
    1: 107,107,107,255
    2: 90,90,90,255
    3: 220,220,220,255
    4: 209,209,209,255
    5: 243,243,243,255
    6: 190,190,190,255
    7: 243,243,243,255
    8: 190,190,190,255
    9: 255,255,255,255
   10: 0,0,0,255
   11: 0,0,0,255
   12: 0,0,0,255
   13: 0,0,0,255
   14: 0,0,0,255
   15: 0,0,0,255


But whenever I try to do a gdalwarp with the using -dstalpha I get an error
message and an unsuable TIF file as output


E:\rasters>gdalwarp -of GTiff -s_srs "EPSG:27700" -t_srs "EPSG:4326" -co
"TFW=YES" -co "TILED=YES" -co "COMPRESS=LZW"  -dstalpha TQ00NE.TIF
TQwarpa.TIF
Copying color table from TQ00NE.TIF to new file.
Creating output file that is 9687P x 6132L.
ERROR 6: SetColorTable() not supported for multi-sample TIFF files.
Processing input file TQ00NE.TIF.
0...10...20...30...40...50...60...70...80...90...100 - done.


E:\rasters>gdalwarp -of GTiff -s_srs "EPSG:27700" -t_srs "EPSG:4326" -co
"TFW=YES" -co "TILED=YES" -co "COMPRESS=LZW" -dstnodata 12 -dstalpha
TQ00NE.TIF TQwarpa.TIF
Copying color table from TQ00NE.TIF to new file.
Creating output file that is 9687P x 6132L.
ERROR 6: SetColorTable() not supported for multi-sample TIFF files.
Processing input file TQ00NE.TIF.
0...10...20...30...40...50...60...70...80...90...100 - done.

Any more suggestions?

Thanks

Rob


On 18 June 2010 15:06, Chaitanya kumar CH <chaitanya.ch at gmail.com> wrote:

> Rob,
>
> You can try the -dstalpha option in gdalwarp to create an alpha band. (
> http://www.gdal.org/gdalwarp.html)
>
> On Fri, Jun 18, 2010 at 7:22 PM, Rob <gis at vanbooth.com> wrote:
>
>> Hi Guys
>>
>> I'm reprojecting some rasters from OSGB (EPSG:27700) to WGS84 (EPSG:4326)
>> and am running into a problem.
>>
>> The rasters are reprojecting nicely, but I am left with black pixels
>> around the image where the reprojected image doesnt fit squarely within the
>> rectangular dimensions of the file.
>>
>> I posted about this issue a few weeks ago, and then realised that I should
>> be marking that colour as transparent when rendering using GeoServer, and
>> ho! everything was OK.
>>
>> However, I am now reprojecting some greyscale rasters, and by making the
>> black pixels on the outside transparent, I am losing the black details of
>> the raster image that I want to display!
>>
>> Is there a way of selecting the colour that gdal uses to populate these
>> dead pixels around the side?
>>
>> MTIA
>>
>> Rob
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
> --
> Best regards,
> Chaitanya kumar CH.
> /tʃaɪθənjə/ /kʊmɑr/
> +91-9494447584
> 17.2416N 80.1426E
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100618/6c49232a/attachment-0001.html


More information about the gdal-dev mailing list