Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a GeoTiff file that I have created by using the command:

gdal_translate -gcp <my gcp> -a_srs <my wkt file> input.tif output.tif

Note that I have twelve -gcp options set on the command, not just the one as shown above.

Running gdalinfo on the resulting output.tif gives this info:

$ gdalinfo output.tif
Driver: GTiff/GeoTIFF
Files: output.tif
Size is 14988, 4817
Coordinate System is `'
GCP Projection = 
PROJCS["NAD83 / Lambert Conformal Conic",
GEOGCS["NAD83",
    DATUM["North_American_Datum_1983",
        SPHEROID["GRS 1980",6378137,298.2572221010002,
            AUTHORITY["EPSG","7019"]],
        AUTHORITY["EPSG","6269"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4269"]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",53],
PARAMETER["standard_parallel_2",58],
PARAMETER["latitude_of_origin",55],
PARAMETER["central_meridian",-117],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
    AUTHORITY["EPSG","9001"]]]
GCP[  0]: Id=1, Info=
      (2825.895,258.41074) -> (-880122.870999,429169.114123,0)
GCP[  1]: Id=2, Info=
      (4287.7334,677.89484) -> (-647749.215943,385189.927027,0)
GCP[  2]: Id=3, Info=
      (5770.6079,1015.5618) -> (-413230.559378,354650.048432,0)
GCP[  3]: Id=4, Info=
      (8782.7646,1429.8372) -> (59130.821732,334247.905451,0)
GCP[  4]: Id=5, Info=
      (11819.869,1494.3732) -> (530709.611705,368232.705719,0)
GCP[  5]: Id=6, Info=
      (13468.901,2820.1733) -> (805645.946747,186796.122966,0)
GCP[  6]: Id=7, Info=
      (13603.036,4243.1196) -> (847013.722386,-31779.568436,0)
GCP[  7]: Id=8, Info=
      (10238.577,4364.8101) -> (327399.354203,-99445.655019,0)
GCP[  8]: Id=9, Info=
      (6879.6489,4099.3042) -> (-196548.115146,-106984.902876,0)
GCP[  9]: Id=10, Info=
      (3574.6519,3447.9844) -> (-717894.287773,-54297.530737,0)
GCP[ 10]: Id=11, Info=
      (1518.3627,4345.4502) -> (-1023098.699938,-222975.023951,0)
GCP[ 11]: Id=12, Info=
      (1955.6367,2981.635) -> (-975431.79687,-5555.816475,0)
GCP[ 12]: Id=13, Info=
      (2390.9373,1619.8647) -> (-927792.139262,211739.118477,0)
Metadata:
  TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
  TIFFTAG_DATETIME=2011:05:25 08:08:20
  TIFFTAG_XRESOLUTION=635
  TIFFTAG_YRESOLUTION=635
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 4817.0)
Upper Right (14988.0,    0.0)
Lower Right (14988.0, 4817.0)
Center      ( 7494.0, 2408.5)
Band 1 Block=14988x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA 
Band 2 Block=14988x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA 
Band 3 Block=14988x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA 
Band 4 Block=14988x1 Type=Byte, ColorInterp=Alpha

When I run the output.tif file through our tile generator I get to 99% done with the base level and it suddenly fails with this error:

Traceback (most recent call last):
  File "<string>", line 7, in process
  File "/home/<my user dir>/maptiler/tiler/tiler.py", line 839, in generate_base_tiles_async
    image_output.write_base_tile(tile, xyzzy)
  File "/home/<my user dir>/maptiler/tiler/tiler.py", line 1000, in write_base_tile
    dsquery.WriteRaster(xyzzy.wx, xyzzy.wy, xyzzy.wxsize, xyzzy.wysize, data, band_list=data_bands)
  File "/usr/lib/python2.7/dist-packages/osgeo/gdal.py", line 746, in WriteRaster
buf_pixel_space, buf_line_space, buf_band_space )
TypeError: not a string

When looking at the output from the tile generator up to that point, all tiles look good. Does anyone have insight as to what this error means to gdal and how it can be fixed so the tile generator can go on and generate the overview tile levels?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Is this an application developed by you, or is it a third-party application? if the former, you may get more help over at StackOverflow which deals with programming problems. If the latter, try the support forum/mailing list on the developer's website.

That said, it appears to be having problems with the filename you specify for writing, which is why you get 99% of the way through: the application has done all the slicing and dicing and the last step is to write the file out. If it's your own code, look at where you create dsquery which will usually be a Create() function in which the first parameter is the filename.

If you don't know what I'm talking about and you're using a third-party application, make sure that you are providing a valid filename to it.

share|improve this answer
    
Thanks for the reply. I just tried running the same thing on a different computer with nearly the same setup and it worked. The only difference is that the computer it worked on is using GDAL 1.7.2 vs. 1.8. Perhaps something significant has changed since 1.7.2 –  afarnham Jul 5 '11 at 16:16
    
Ah yes, that might do it. The Python interface has been worked on since 1.7.x There was a message today on the gdal-dev list about the 1.8.1 release candidate (svn.osgeo.org/gdal/branches/1.8/gdal/NEWS) which fixes a number of bugs, so you may want to wait a while for the latest and greatest before upgrading to 1.8.x. That said, many of the bug fixes in 1.8.0 have been backported to the 1.7.x maintenance release. –  MerseyViking Jul 6 '11 at 9:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.