[gdal-dev] Messages: gdal_translate and gdal_rasterize

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Tue Jul 21 12:03:29 EDT 2009


Thanks Frank,
".... the command cannot determine it from the .shp file"
Why? Is it because the EPSG code of this .shp is unknown to GDAL or GDAL 
can't get any SRS from a .shp? 
Should I add the EPSG code somewhere in a configuration file?

Best regards,
Steve


Steve Toutant, M. Sc.
Analyste en géomatique
Secteur environnement
Direction des risques biologiques, environnementaux et occupationnels
Institut national de santé publique du Québec
945, avenue Wolfe
Québec, Qc G1V 5B3 
Tél.: (418) 650-5115 #5281
Fax.: (418) 654-3144
steve.toutant at inspq.qc.ca
http://www.inspq.qc.ca
 




Frank Warmerdam <warmerdam at pobox.com> 
21/07/2009 11:53 AM

A
Steve.Toutant at inspq.qc.ca
cc
gdal-dev at lists.osgeo.org
Objet
Re: [gdal-dev] Messages: gdal_translate and gdal_rasterize








Steve.Toutant at inspq.qc.ca wrote:
> 
> Hello!!!
> When I launch this command
> gdal_translate -projwin -428734.998712 20337 1.497532 -387578.449250 
> 172036.180727 EstMtl.img rssMtl.img
> 
> I get this message
> Input file size is 7771, 7410
> Computed -srcwin 1204 4838 1372 1045 from projected window.
> 0Warning 1: Lost metadata writing to GeoTIFF ... too large to fit in 
tag.
> Warning 1: Lost metadata writing to GeoTIFF ... too large to fit in tag.
> ...10...20...30...40...50...60...70...80...90...100 - done.
> Warning 1: Lost metadata writing to GeoTIFF ... too large to fit in tag.

Steve,

First, you may not be aware that gdal_translate writes TIFF by default,
even if you use the extension .img.  So if you want a .img output you
would need to specify -of HFA on the commandline.

The warning indicates that there was too much metadata in the source
file to properly store in the GeoTIFF so it was discarded.  Often
this won't matter to you.

> When I launch this command
> gdal_rasterize -burn 0 -i -l rssMtl_32198 
> Z:\MSSS\rssmrn\2005\shapefile\32198\rssMtl_32198.shp rssMtl.img
> 
> I get this message
> Warning : the output raster dataset has a SRS, but the input vector 
> layer not. Results will be probably incorrect.
> 0...10...20...30...40...50...60...70...80...90...100 - done.

This means it is your responsibility to ensure that the shapefile
and the .img file are in the same coordinate system since the command
cannot determine it from the .shp file.  The warning is perhaps a bit
too dramatic.

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    | Geospatial Programmer for Rent




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20090721/c4e08ddb/attachment.html


More information about the gdal-dev mailing list