[Gdal-dev] AAIGrid driver: small PROJCS detection problem

Markus Neteler neteler at itc.it
Mon Apr 26 12:07:17 EDT 2004


On Mon, Apr 26, 2004 at 05:00:07PM +0200, Markus Neteler wrote:
> On Fri, Apr 23, 2004 at 09:45:43AM -0400, Frank Warmerdam wrote:
> > Markus Neteler wrote:
> > 
> > > PROJCS["Monte_Mario_Italy_1_BZ",
> > >    GEOGCS["GCS_Monte_Mario",
> > >        DATUM["Monte_Mario",
> > >            SPHEROID["International_1924",6378388,297]],
> > >        PRIMEM["Greenwich",0],
> > >        UNIT["Degree",0.017453292519943295]],
> > >    PROJECTION["Transverse_Mercator"],
> > >    PARAMETER["False_Easting",500000.0],
> > >    PARAMETER["False_Northing",-5000000.0],
> > >    PARAMETER["Central_Meridian",9],
> > >    PARAMETER["Scale_Factor",0.9996],
> > >    PARAMETER["Latitude_Of_Origin",0],
> > >    UNIT["Meter",1]]
> > 
> > Markus,
> > 
> > I have committed a bunch of additional changes to GDAL to preserve the
> > PROJCS and GEOGCS names as citations in the geotiff files, and to recover
> > them when reading and forming WKT again.  I can't seem to find the
> > exact message that triggered me into doing that but it was related to
> > this thread.
> 
> 
> Thanks, I have retried it:
> 
> gdalwarp -order 2 -t_srs '+proj=tmerc +lat_0=0 +lon_0=9 \
>       +k=0.999600 +x_0=500000 +y_0=-5000000 +ellps=intl +units=m \
>       +towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68' \
>       -tr 28.5 28.5 p192r028_7t20010826_z32_nn10.tif p192r028_7t20010826_z32_nn10_PBZ.tif
> 
> # creates:
> gdalinfo p192r028_7t20010826_z32_nn10_PBZ.tif
> Driver: GTiff/GeoTIFF
> Size is 8765, 7797
> Coordinate System is:
> PROJCS["unnamed",
>     GEOGCS["International 1909 (Hayford)",
>         DATUM["unknown",
>             SPHEROID["unnamed",6378388,297.000000000005]],
>         PRIMEM["Greenwich",0],
>         UNIT[,0.0174532925199433]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["latitude_of_origin",0],
>     PARAMETER["central_meridian",9],
>     PARAMETER["scale_factor",0.9996],
>     PARAMETER["false_easting",500000],
>     PARAMETER["false_northing",-5000000],
>     UNIT["metre",1,
>         AUTHORITY["EPSG","9001"]]]
> Origin = (609787.107032,213299.997571)
> Pixel Size = (28.50000000,-28.50000000)
> Corner Coordinates:
> Upper Left  (  609787.107,  213299.998) ( 10d26'44.63"E, 47d 3'47.46"N)
> Lower Left  (  609787.107,   -8914.502) ( 10d23'40.03"E, 45d 3'49.97"N)
> Upper Right (  859589.607,  213299.998) ( 13d43'39.92"E, 46d58'28.59"N)
> Lower Right (  859589.607,   -8914.502) ( 13d33'38.62"E, 44d58'52.44"N)
> Center      (  734688.357,  102192.748) ( 12d 1'57.18"E, 46d 1'55.89"N)
> Band 1 Block=8765x1 Type=Byte, ColorInterp=Gray
> 
> #... which looks ok, but then, when cutting out a piece:
> 
> gdal_translate -of GTiff -projwin 610000 205000 767840 118240 \
>        p192r028_7t20010826_z32_nn10_PBZ.tif \
>        p192r028_7t20010826_z32_nn10_PBZ_small.tif
> Input file size is 8765, 7797
> Computed -srcwin 7 291 5538 3044 from projected window.
> 0.Segmentation fault
> 
> With gdb I got:
> ...
> Program received signal SIGSEGV, Segmentation fault.
> 0x42074462 in _int_malloc () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x42074462 in _int_malloc () from /lib/tls/libc.so.6
> #1  0x4207378d in malloc () from /lib/tls/libc.so.6
> #2  0x40160957 in VSIMalloc () from /usr/local/lib/libgdal.so.1
> #3  0x40143fe7 in _TIFFmalloc () from /usr/local/lib/libgdal.so.1
> #4  0x4013e2d7 in TIFFClientOpen () from /usr/local/lib/libgdal.so.1
> #5  0x40143f89 in TIFFOpen () from /usr/local/lib/libgdal.so.1
> #6  0x4014f980 in XTIFFOpen () from /usr/local/lib/libgdal.so.1
> #7  0x400dc542 in GTiffCreate(char const*, int, int, int, GDALDataType, char**) ()
>    from /usr/local/lib/libgdal.so.1
> #8  0x400dcc8e in GTiffCreateCopy(char const*, GDALDataset*, int, char**, int (*)(double, char const*, void*), void*) () from /usr/local/lib/libgdal.so.1
> #9  0x4015181e in GDALDriver::CreateCopy(char const*, GDALDataset*, int, char**, int (*)(double, char const*, void*), void*) () from /usr/local/lib/libgdal.so.1
> #10 0x40151c75 in GDALCreateCopy () from /usr/local/lib/libgdal.so.1
> #11 0x0804a142 in main ()
> #12 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6
> 
> Maybe there is still an initialization problem left.


Sorry for the confusion (didn't want to send this one...). 
The problem above was related to a missing 'make distclean' before recompiling.

So, after a clean built everything works well.
 
Kind regards
 
  Markus Neteler



More information about the Gdal-dev mailing list