listgeo/geotifcp and gdal

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

listgeo/geotifcp and gdal

Conrad Bielski
Hello geotiff list!

Today I created my first BifTIFF (6.7 Gb) using gdal (1.8) and I needed to use listgeo for some projection injection which I have done with regular size tiff files in the past. The problem is that when I run listgeo on the BigTIFF, I get an error that states libtiff does not support BigTIFF.

Here is some background to this problem. I'm running CentOS 5.4 which obviously has it's own libtif libraries in the system specified areas required to run many system programs but I build gdal with libtiff and geotiff = internal and keep those libraries in a local directory because I want to have access to the latest and greatest for my geoprocessing.

What I would like to know is how can I install the listgeo/geotifcp tools so that they link to the local gdal tiff libraries (which I know are BigTIFF ready)?

Today, I tried installing geotiff from sources after having installed gdal with the interal tiff libraries. Using the configuration script I passed the local lib and include directories of the gdal install. When it finished, I ran ldd listgeo and geotiff points to the correct local library but tiff points to the system tiff library files in /usr/lib64.

Anyone have any suggestions?
Thanks and have a great day,
Conrad :)


     
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

David Burken
Conrad,

Here's what I do.  I build my own libtiff, libgeotiff and gdal from
svn.  I install each to a local sandbox.  Then set the sandbox bin in my
PATH and lib in my LD_LIBRARY_PATH.  A wise friend of mine (thanks
Scott) taught me a long time ago to make a config script for each
library for the configure line and run it.  So I do:

// Build libtiff:
cd libtiff
./mylibtiffconfig.sh
make
make install

// Build geotiff:
cd libgeotiff
./mylibgeotiffconfig.sh
make
make install

// Build gdal
cd gdal
./mygdalconfig.sh
make
make install

In you bash dot files add your install bin to your PATH.  If you go to
/usr/local you may not need.
In you bash dot files add your install lib to your LD_LIBRARY_PATH=$.  
If you go to /usr/local you may not need.

Snip from .bashrc (or wherever):
LD_LIBRARY_PATH=/work/osgeo/local/lib
PATH=/work/osgeo/local/bin:${PATH}
export LD_LIBRARY_PATH PATH

// Contents of mylibtiffconfig.sh
#!/bin/sh
# File: mylibtiffconfig.sh
prefix=/work/osgeo/local
./configure --prefix=${prefix}

// Contents of mylibgeotiffconfig.sh
#!/bin/sh
# File: mylibgeotiffconfig.sh
prefix=/work/osgeo/local
./configure --prefix=${prefix} --with-proj=/work/osgeo/local
--with-libtiff=/work/osgeo/local

// Contents of mygdalconfig.sh
#!/bin/sh
# File: mygdalconfig.sh
prefix=/work/osgeo/local
./configure --prefix=${prefix} --with-libtiff=/work/osgeo/local
--with-geotiff=/work/osgeo/local

Obviously your config scripts could have man other options.  Like here
is my real gdal config:
#!/bin/sh
# File: mygdalconfig.sh
prefix=/work/osgeo/local
./configure --prefix=${prefix} --with-kakadu=/work/drb/kakadu/latest
--with-hdf4=/work/osgeo/local --with-hdf5=/work/osgeo/local
--with-libtiff=/work/osgeo/local --with-geotiff=/work/osgeo/local
--with-mrsid=/work/drb/mrsid/Geo_DSDK-7.0.0.2167

Hope that helps,
Dave

On 03/01/2011 04:55 PM, Conrad Bielski wrote:

> Hello geotiff list!
>
> Today I created my first BifTIFF (6.7 Gb) using gdal (1.8) and I needed to use listgeo for some projection injection which I have done with regular size tiff files in the past. The problem is that when I run listgeo on the BigTIFF, I get an error that states libtiff does not support BigTIFF.
>
> Here is some background to this problem. I'm running CentOS 5.4 which obviously has it's own libtif libraries in the system specified areas required to run many system programs but I build gdal with libtiff and geotiff = internal and keep those libraries in a local directory because I want to have access to the latest and greatest for my geoprocessing.
>
> What I would like to know is how can I install the listgeo/geotifcp tools so that they link to the local gdal tiff libraries (which I know are BigTIFF ready)?
>
> Today, I tried installing geotiff from sources after having installed gdal with the interal tiff libraries. Using the configuration script I passed the local lib and include directories of the gdal install. When it finished, I ran ldd listgeo and geotiff points to the correct local library but tiff points to the system tiff library files in /usr/lib64.
>
> Anyone have any suggestions?
> Thanks and have a great day,
> Conrad :)
>
>
>
> _______________________________________________
> Geotiff mailing list
> [hidden email]
> http://lists.maptools.org/mailman/listinfo/geotiff
>
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

Conrad Bielski
Dear David (and Scott),
Thanks for the solution including the config scripting (helps a lot!).

So it works... partially. At the moment, I can now use listgeo correctly and it provides the information that I require. The next step however is not working and I'm not sure whether it is because it is a bug or a feature that should be added to geotifcp.

The issue is that when I try to create my new geotif with geotifcp, I get errors "TIFFAppendToStrip: Maximum TIFF file size exceeded" and the file is not larger than 4GB. Reading the geotifcp info pages, I came to realise that it is actually calling tiffcp to create the final geotiff.

Now, tiffcp has a parameter (-8) that forces the creation of BigTiff. This is not available in geotifcp. Is this the reason why I'm getting this error? For whatever reason, it is not automatically understanding that it should create a BigTIFF output (even when I force -c none).

BTW, I did not follow David's recommendation 'exactly'. I am using tiff-4.0.0beta6, I tested the latest geotiff releases (including: libgeotiff-1.3.0, libgeotiff-1.3.0RC2, and an svn co), and gdal-1.8. None seemed to get passed this BigTIFF creation issue.

Have a great day,
Conrad :)

--- On Tue, 3/1/11, David Burken <[hidden email]> wrote:

> From: David Burken <[hidden email]>
> Subject: Re: [Geotiff] listgeo/geotifcp and gdal
> To: "Conrad Bielski" <[hidden email]>
> Cc: [hidden email]
> Date: Tuesday, March 1, 2011, 3:42 PM
> Conrad,
>
> Here's what I do.  I build my own libtiff, libgeotiff
> and gdal from svn.  I install each to a local
> sandbox.  Then set the sandbox bin in my PATH and lib
> in my LD_LIBRARY_PATH.  A wise friend of mine (thanks
> Scott) taught me a long time ago to make a config script for
> each library for the configure line and run it.  So I
> do:
>
> // Build libtiff:
> cd libtiff
> ./mylibtiffconfig.sh
> make
> make install
>
> // Build geotiff:
> cd libgeotiff
> ./mylibgeotiffconfig.sh
> make
> make install
>
> // Build gdal
> cd gdal
> ./mygdalconfig.sh
> make
> make install
>
> In you bash dot files add your install bin to your
> PATH.  If you go to /usr/local you may not need.
> In you bash dot files add your install lib to your
> LD_LIBRARY_PATH=$.  If you go to /usr/local you may not
> need.
>
> Snip from .bashrc (or wherever):
> LD_LIBRARY_PATH=/work/osgeo/local/lib
> PATH=/work/osgeo/local/bin:${PATH}
> export LD_LIBRARY_PATH PATH
>
> // Contents of mylibtiffconfig.sh
> #!/bin/sh
> # File: mylibtiffconfig.sh
> prefix=/work/osgeo/local
> ./configure --prefix=${prefix}
>
> // Contents of mylibgeotiffconfig.sh
> #!/bin/sh
> # File: mylibgeotiffconfig.sh
> prefix=/work/osgeo/local
> ./configure --prefix=${prefix}
> --with-proj=/work/osgeo/local
> --with-libtiff=/work/osgeo/local
>
> // Contents of mygdalconfig.sh
> #!/bin/sh
> # File: mygdalconfig.sh
> prefix=/work/osgeo/local
> ./configure --prefix=${prefix}
> --with-libtiff=/work/osgeo/local
> --with-geotiff=/work/osgeo/local
>
> Obviously your config scripts could have man other
> options.  Like here is my real gdal config:
> #!/bin/sh
> # File: mygdalconfig.sh
> prefix=/work/osgeo/local
> ./configure --prefix=${prefix}
> --with-kakadu=/work/drb/kakadu/latest
> --with-hdf4=/work/osgeo/local --with-hdf5=/work/osgeo/local
> --with-libtiff=/work/osgeo/local
> --with-geotiff=/work/osgeo/local
> --with-mrsid=/work/drb/mrsid/Geo_DSDK-7.0.0.2167
>
> Hope that helps,
> Dave
>
> On 03/01/2011 04:55 PM, Conrad Bielski wrote:
> > Hello geotiff list!
> >
> > Today I created my first BifTIFF (6.7 Gb) using gdal
> (1.8) and I needed to use listgeo for some projection
> injection which I have done with regular size tiff files in
> the past. The problem is that when I run listgeo on the
> BigTIFF, I get an error that states libtiff does not support
> BigTIFF.
> >
> > Here is some background to this problem. I'm running
> CentOS 5.4 which obviously has it's own libtif libraries in
> the system specified areas required to run many system
> programs but I build gdal with libtiff and geotiff =
> internal and keep those libraries in a local directory
> because I want to have access to the latest and greatest for
> my geoprocessing.
> >
> > What I would like to know is how can I install the
> listgeo/geotifcp tools so that they link to the local gdal
> tiff libraries (which I know are BigTIFF ready)?
> >
> > Today, I tried installing geotiff from sources after
> having installed gdal with the interal tiff libraries. Using
> the configuration script I passed the local lib and include
> directories of the gdal install. When it finished, I ran ldd
> listgeo and geotiff points to the correct local library but
> tiff points to the system tiff library files in /usr/lib64.
> >
> > Anyone have any suggestions?
> > Thanks and have a great day,
> > Conrad :)
> >
> >
> >
> > _______________________________________________
> > Geotiff mailing list
> > [hidden email]
> > http://lists.maptools.org/mailman/listinfo/geotiff
> >
>


     
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

David Burken
Conrad,

Glad that helped.  Note, to see what your app is linking with use
"ldd".  Like "ldd /usr/local/bin/geotifcp".  I think you should try one
of the gdal apps, gdal_translate maybe.  I'm not an expert there.  You
could ping the gdal mailing list at this point.

Take care,
Dave


On 03/02/2011 06:44 AM, Conrad Bielski wrote:

> Dear David (and Scott),
> Thanks for the solution including the config scripting (helps a lot!).
>
> So it works... partially. At the moment, I can now use listgeo correctly and it provides the information that I require. The next step however is not working and I'm not sure whether it is because it is a bug or a feature that should be added to geotifcp.
>
> The issue is that when I try to create my new geotif with geotifcp, I get errors "TIFFAppendToStrip: Maximum TIFF file size exceeded" and the file is not larger than 4GB. Reading the geotifcp info pages, I came to realise that it is actually calling tiffcp to create the final geotiff.
>
> Now, tiffcp has a parameter (-8) that forces the creation of BigTiff. This is not available in geotifcp. Is this the reason why I'm getting this error? For whatever reason, it is not automatically understanding that it should create a BigTIFF output (even when I force -c none).
>
> BTW, I did not follow David's recommendation 'exactly'. I am using tiff-4.0.0beta6, I tested the latest geotiff releases (including: libgeotiff-1.3.0, libgeotiff-1.3.0RC2, and an svn co), and gdal-1.8. None seemed to get passed this BigTIFF creation issue.
>
> Have a great day,
> Conrad :)
>
> --- On Tue, 3/1/11, David Burken<[hidden email]>  wrote:
>
>> From: David Burken<[hidden email]>
>> Subject: Re: [Geotiff] listgeo/geotifcp and gdal
>> To: "Conrad Bielski"<[hidden email]>
>> Cc: [hidden email]
>> Date: Tuesday, March 1, 2011, 3:42 PM
>> Conrad,
>>
>> Here's what I do.  I build my own libtiff, libgeotiff
>> and gdal from svn.  I install each to a local
>> sandbox.  Then set the sandbox bin in my PATH and lib
>> in my LD_LIBRARY_PATH.  A wise friend of mine (thanks
>> Scott) taught me a long time ago to make a config script for
>> each library for the configure line and run it.  So I
>> do:
>>
>> // Build libtiff:
>> cd libtiff
>> ./mylibtiffconfig.sh
>> make
>> make install
>>
>> // Build geotiff:
>> cd libgeotiff
>> ./mylibgeotiffconfig.sh
>> make
>> make install
>>
>> // Build gdal
>> cd gdal
>> ./mygdalconfig.sh
>> make
>> make install
>>
>> In you bash dot files add your install bin to your
>> PATH.  If you go to /usr/local you may not need.
>> In you bash dot files add your install lib to your
>> LD_LIBRARY_PATH=$.  If you go to /usr/local you may not
>> need.
>>
>> Snip from .bashrc (or wherever):
>> LD_LIBRARY_PATH=/work/osgeo/local/lib
>> PATH=/work/osgeo/local/bin:${PATH}
>> export LD_LIBRARY_PATH PATH
>>
>> // Contents of mylibtiffconfig.sh
>> #!/bin/sh
>> # File: mylibtiffconfig.sh
>> prefix=/work/osgeo/local
>> ./configure --prefix=${prefix}
>>
>> // Contents of mylibgeotiffconfig.sh
>> #!/bin/sh
>> # File: mylibgeotiffconfig.sh
>> prefix=/work/osgeo/local
>> ./configure --prefix=${prefix}
>> --with-proj=/work/osgeo/local
>> --with-libtiff=/work/osgeo/local
>>
>> // Contents of mygdalconfig.sh
>> #!/bin/sh
>> # File: mygdalconfig.sh
>> prefix=/work/osgeo/local
>> ./configure --prefix=${prefix}
>> --with-libtiff=/work/osgeo/local
>> --with-geotiff=/work/osgeo/local
>>
>> Obviously your config scripts could have man other
>> options.  Like here is my real gdal config:
>> #!/bin/sh
>> # File: mygdalconfig.sh
>> prefix=/work/osgeo/local
>> ./configure --prefix=${prefix}
>> --with-kakadu=/work/drb/kakadu/latest
>> --with-hdf4=/work/osgeo/local --with-hdf5=/work/osgeo/local
>> --with-libtiff=/work/osgeo/local
>> --with-geotiff=/work/osgeo/local
>> --with-mrsid=/work/drb/mrsid/Geo_DSDK-7.0.0.2167
>>
>> Hope that helps,
>> Dave
>>
>> On 03/01/2011 04:55 PM, Conrad Bielski wrote:
>>> Hello geotiff list!
>>>
>>> Today I created my first BifTIFF (6.7 Gb) using gdal
>> (1.8) and I needed to use listgeo for some projection
>> injection which I have done with regular size tiff files in
>> the past. The problem is that when I run listgeo on the
>> BigTIFF, I get an error that states libtiff does not support
>> BigTIFF.
>>> Here is some background to this problem. I'm running
>> CentOS 5.4 which obviously has it's own libtif libraries in
>> the system specified areas required to run many system
>> programs but I build gdal with libtiff and geotiff =
>> internal and keep those libraries in a local directory
>> because I want to have access to the latest and greatest for
>> my geoprocessing.
>>> What I would like to know is how can I install the
>> listgeo/geotifcp tools so that they link to the local gdal
>> tiff libraries (which I know are BigTIFF ready)?
>>> Today, I tried installing geotiff from sources after
>> having installed gdal with the interal tiff libraries. Using
>> the configuration script I passed the local lib and include
>> directories of the gdal install. When it finished, I ran ldd
>> listgeo and geotiff points to the correct local library but
>> tiff points to the system tiff library files in /usr/lib64.
>>> Anyone have any suggestions?
>>> Thanks and have a great day,
>>> Conrad :)
>>>
>>>
>>>
>>> _______________________________________________
>>> Geotiff mailing list
>>> [hidden email]
>>> http://lists.maptools.org/mailman/listinfo/geotiff
>>>
>
>
>
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

Conrad Bielski
Hi David,
my ldd output is below. Before turning to gdal though I will try to see what else I can find with geotifcp (it is the perfect tool for what I'm doing!).
If there are any other suggestions out there, please write!
Thanks and have a great day,
Conrad :)

[conrad@DMAPCTESLA bin]$ ldd geotifcp
        libgeotiff.so.2 => /home/conrad/PRJ-DIR/PACKAGE/lib/libgeotiff.so.2 (0x00002aae63a32000)
        libproj.so.0 => /home/conrad/PRJ-DIR/PACKAGE/lib/libproj.so.0 (0x00002aae63c63000)
        libtiff.so.5 => /home/conrad/PRJ-DIR/PACKAGE/lib/libtiff.so.5 (0x00002aae63ea5000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x0000003e48800000)
        libz.so.1 => /usr/lib64/libz.so.1 (0x0000003e44800000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003e43800000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003e43c00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003e43400000)






     
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

David Burken
Hi Conrad,

Your ldd looks good.   I'm not sure what your goal is but you could look
at ossim also.  It might be overkill for what you're doing...

http://trac.osgeo.org/ossim/wiki/icp
http://trac.osgeo.org/ossim/wiki/orthoigen

Take care,
Dave


On 03/03/2011 02:24 AM, Conrad Bielski wrote:

> Hi David,
> my ldd output is below. Before turning to gdal though I will try to see what else I can find with geotifcp (it is the perfect tool for what I'm doing!).
> If there are any other suggestions out there, please write!
> Thanks and have a great day,
> Conrad :)
>
> [conrad@DMAPCTESLA bin]$ ldd geotifcp
>          libgeotiff.so.2 =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libgeotiff.so.2 (0x00002aae63a32000)
>          libproj.so.0 =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libproj.so.0 (0x00002aae63c63000)
>          libtiff.so.5 =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libtiff.so.5 (0x00002aae63ea5000)
>          libjpeg.so.62 =>  /usr/lib64/libjpeg.so.62 (0x0000003e48800000)
>          libz.so.1 =>  /usr/lib64/libz.so.1 (0x0000003e44800000)
>          libc.so.6 =>  /lib64/libc.so.6 (0x0000003e43800000)
>          libm.so.6 =>  /lib64/libm.so.6 (0x0000003e43c00000)
>          /lib64/ld-linux-x86-64.so.2 (0x0000003e43400000)
>
>
>
>
>
>
>
>
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff
Reply | Threaded
Open this post in threaded view
|

Re: listgeo/geotifcp and gdal

Conrad Bielski
Thanks Dave,
but yes... ossim would be to heavy for what I'm doing. I did find a workaround though with gdal which I will share here.

What I was doing with listgeo/geotifcp was injecting projection information into a tiff file. What this means is that I had a country that had their own 'special' TM based projection that was not being correctly saved by proprietary software.

My initial solution was to use listgeo to extract the image information, insert the projection information and together use geotifcp to insert the new information into the tif.

My new solution is similar, but I use:
gdalwarp -s_srs WKT-file.txt -t_srs EPSG:4326 inputFile.tif outputFile

and it worked!
Thanks again for your help,
Conrad :)

--- On Thu, 3/3/11, David Burken <[hidden email]> wrote:

> From: David Burken <[hidden email]>
> Subject: Re: [Geotiff] listgeo/geotifcp and gdal
> To: "Conrad Bielski" <[hidden email]>
> Cc: [hidden email]
> Date: Thursday, March 3, 2011, 3:43 AM
> Hi Conrad,
>
> Your ldd looks good.   I'm not sure what
> your goal is but you could look
> at ossim also.  It might be overkill for what you're
> doing...
>
> http://trac.osgeo.org/ossim/wiki/icp
> http://trac.osgeo.org/ossim/wiki/orthoigen
>
> Take care,
> Dave
>
>
> On 03/03/2011 02:24 AM, Conrad Bielski wrote:
> > Hi David,
> > my ldd output is below. Before turning to gdal though
> I will try to see what else I can find with geotifcp (it is
> the perfect tool for what I'm doing!).
> > If there are any other suggestions out there, please
> write!
> > Thanks and have a great day,
> > Conrad :)
> >
> > [conrad@DMAPCTESLA bin]$ ldd geotifcp
> >          libgeotiff.so.2
> =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libgeotiff.so.2
> (0x00002aae63a32000)
> >          libproj.so.0
> =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libproj.so.0
> (0x00002aae63c63000)
> >          libtiff.so.5
> =>  /home/conrad/PRJ-DIR/PACKAGE/lib/libtiff.so.5
> (0x00002aae63ea5000)
> >          libjpeg.so.62
> =>  /usr/lib64/libjpeg.so.62 (0x0000003e48800000)
> >          libz.so.1
> =>  /usr/lib64/libz.so.1 (0x0000003e44800000)
> >          libc.so.6
> =>  /lib64/libc.so.6 (0x0000003e43800000)
> >          libm.so.6
> =>  /lib64/libm.so.6 (0x0000003e43c00000)
> >         
> /lib64/ld-linux-x86-64.so.2 (0x0000003e43400000)
> >
> >
> >
> >
> >
> >
> >
> >
>


     
_______________________________________________
Geotiff mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/geotiff