[FWTools] gdal_merge with -ps optoin is giving the following error

mzorova mzorova at yahoo.com
Mon Nov 19 18:58:16 EST 2007


>From looking at samples from around the web, I think I might have
mis-interpreted the -ps option to be specifying the dimensions of the output
file.

Then the issue I am facing is different - without the ps (which I guess
defaults to 1x1) the output file is exactly the same size of the first file
- all the files are copied into starting at 0,0 - it does not seem to be
using the GCP's specified in the file to actually tile them (each of these
files is adjacent to one another - forming four quadrants of a larger
rectangle).

gdalinfo on the 1.tif and 2.tif does seem to show the different GCPs and
projection information.. Pasting below

1.tif:
Driver: GTiff/GeoTIFF
Files: vzw-1.tif
Size is 740, 300
Coordinate System is `'
GCP Projection = PROJCS["WGS 84 / Plate Carree",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],AUTHORI
TY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32
662"]]
GCP[  0]: Id=1, Info=
          (740,0) -> (-122.008813333333,37.5581,0)
GCP[  1]: Id=2, Info=
          (0,300) -> (-121.988586666667,37.5663,0)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  300.0)
Upper Right (  740.0,    0.0)
Lower Right (  740.0,  300.0)
Center      (  370.0,  150.0)
Band 1 Block=740x3 Type=Byte, ColorInterp=Red
Band 2 Block=740x3 Type=Byte, ColorInterp=Green
Band 3 Block=740x3 Type=Byte, ColorInterp=Blue

2.tif:
Driver: GTiff/GeoTIFF
Files: vzw-2.tif
Size is 740, 300
Coordinate System is `'
GCP Projection = PROJCS["WGS 84 / Plate Carree",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],AUTHORI
TY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32
662"]]
GCP[  0]: Id=1, Info=
          (740,0) -> (-122.988586666667,37.5581,0)
GCP[  1]: Id=2, Info=
          (0,300) -> (-121.968360000001,37.5663,0)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  300.0)
Upper Right (  740.0,    0.0)
Lower Right (  740.0,  300.0)
Center      (  370.0,  150.0)
Band 1 Block=740x3 Type=Byte, ColorInterp=Red
Band 2 Block=740x3 Type=Byte, ColorInterp=Green
Band 3 Block=740x3 Type=Byte, ColorInterp=Blue

3.tif:
Driver: GTiff/GeoTIFF
Files: vzw-3.tif
Size is 740, 300
Coordinate System is `'
GCP Projection = PROJCS["WGS 84 / Plate Carree",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],AUTHORI
TY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32
662"]]
GCP[  0]: Id=1, Info=
          (740,0) -> (-122.988586666667,37.5499,0)
GCP[  1]: Id=2, Info=
          (0,300) -> (-121.968360000001,37.5581,0)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  300.0)
Upper Right (  740.0,    0.0)
Lower Right (  740.0,  300.0)
Center      (  370.0,  150.0)
Band 1 Block=740x3 Type=Byte, ColorInterp=Red
Band 2 Block=740x3 Type=Byte, ColorInterp=Green
Band 3 Block=740x3 Type=Byte, ColorInterp=Blue

4.tif:
Driver: GTiff/GeoTIFF
Files: vzw-4.tif
Size is 740, 300
Coordinate System is `'
GCP Projection = PROJCS["WGS 84 / Plate Carree",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],AUTHORI
TY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","32
662"]]
GCP[  0]: Id=1, Info=
          (740,0) -> (-122.00881333,37.5499,0)
GCP[  1]: Id=2, Info=
          (0,300) -> (-121.988586666667,37.5581,0)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  300.0)
Upper Right (  740.0,    0.0)
Lower Right (  740.0,  300.0)
Center      (  370.0,  150.0)
Band 1 Block=740x3 Type=Byte, ColorInterp=Red
Band 2 Block=740x3 Type=Byte, ColorInterp=Green
Band 3 Block=740x3 Type=Byte, ColorInterp=Blue




mzorova wrote:
> 
> ERROR 1: Attempt to create 1x0 dataset is illegal,sizes must be larger
> than zero
> .
> Creation failed, terminating gdal_merge.
> 
> the command that causes this error:
> 
> [Mon 11/19/2007 15:22:58.60] C:\temp>gdal_merge -v -ps 1480 600 -o
> merged.tif 1.tif 2.tif 3.tif 4.tif
> 
> I did add two GCP points for each of the 1-4.tif files as well as
> specified the projection that they are in.. 
> 
> Would anyone have an idea as to what I may be doing wrong here?
> 

-- 
View this message in context: http://www.nabble.com/gdal_merge-with--ps-optoin-is-giving-the-following-error-tf4840207.html#a13848252
Sent from the FWTools mailing list archive at Nabble.com.



More information about the FWTools mailing list