[FWTools] gdalwarp issue?

David Fawcett david.fawcett at gmail.com
Wed Dec 15 12:22:37 EST 2010


I did a similar thing several years ago using the ogr/osr python
modules and an exif module to read gps info out of the exif headers,
calculate approximate image scale and rotation, and then write out
world files for the images.  The georeferencing is rough and
approximate, but surprisingly good.  The code also creates shapefiles
containing image footprint polys and image 'center' (airplane
location) points.

It can reference several hundred images in a few minutes.  This is
partly because it is doing nothing to the actual images, just creating
world files.

My use case is a little bit different than yours, as I assume that the
sensor plane is parallel to the ground.  I am happy to show you the
code if you are interested.  I wrote it several years ago, so it is
pretty ugly and pretty specific to my use case.


On Wed, Dec 15, 2010 at 10:19 AM,  <jkenneally at cartenav.com> wrote:
> Hi Rengifo,
> Thanks a lot for your reply.   I am aware that GDAL can't really perform an
> orthorectification, and I can easily see this getting to the point of
> requiring a 'proper' orthorectification through another 3rd party software
> if everything else works out.
> However, as it stands right now I'm working under assumed 'idea' conditions
> with my raw photo's, or that general errors due to lack of
> orthorectification are acceptable.  This is meant to provide a quick
> overview of an area being imaged (ie near real-time aboard an aircraft),
> with proper orthorectification, etc happening in a post-processing stage at
> a later time.
> I'm more confused as to why GDAL doesn't want to warp my raw image into what
> I would consider a correct geographic shape when I specify that the bottom
> of the image isn't geographically as 'wide' as the top.
> I know Global Mapper doesn't perform orthorectification either, but does
> seem to display/save the raster data as I would expect, and I'm confused
> about what I'm missing to create the same result through GDAL.
> Given the assumptions I am making above, I wonder if I should be specifying
> an 'orthographic' projection when doing the gdal_translate before the warp?
> Cheers!
> -----Original Message-----
> From: "Rengifo Ortega" <rengifoo at yahoo.de>
> Sent: Wednesday, December 15, 2010 11:48am
> To: jkenneally at cartenav.com
> Cc: FWTools at lists.maptools.org
> Subject: AW: [FWTools] gdalwarp issue?
> Dear jeff,
> I don´t know if this helps you  that  much, but these threads seems to
> confirm, what I was about to answer you. I don´t think gdalwarp can do
> orthorectification ( in a strict sense) but, transformation and
> georeferentiation among many other things.
> http://forum.manifold.net/forum/t73326.13
> http://www.osgeo.org/pipermail/gdal-dev/2004-November/004566.html
>  I  recommend you to use OSSIM for this.
> The good new is that the osgeo created a live cd with OSSIM among, other
> software. So, if you are familiar with linux. Here you will find all
> software you need. http://live.osgeo.org/
> The positive aspect of using OSSIM  is  RSM- approach. (Rigorous Sensor
> Modelling)
> http://www.ossim.org/OSSIM/OSSIM.html
> cheers
> Rengifo Ortega
> ________________________________
> Von: "jkenneally at cartenav.com" <jkenneally at cartenav.com>
> An: FWTools at lists.maptools.org
> Gesendet: Mittwoch, den 15. Dezember 2010, 15:04:59 Uhr
> Betreff: [FWTools] gdalwarp issue?
> Hello,
> I'm having an issue using gdalwarp, and I'm not sure if I'm using the
> utility incorrectly, or if I'm just trying to make it do something it can't
> do.
> I'm trying to perform a crude geo-rectification on a set of aerial photo's.
> For the test case I am just assigning four gcps to the source image corners
> using gdal_translate.  This stage seems to work fine.  I am then intending
> to use gdal_warp to produce an output image that has been transformed based
> on the assigned gcps.  However, no matter what I assign as the image corner
> coordinates, gdal_warp still seems to produce a 'square' final image.
> The easiest way to demonstrate the issue is in cases where the camera was
> not pointed straight down when the aerial photo was taken.   This creates a
> source image where the bottom (near) corners are geographically closer to
> each other than the top (far) corners are.   In this case I am expecting the
> warped output image to contain a trapezoid-ish shape of aerial imagery with
> no data (ie white) pixels around the outside.
> However, while gdal warp does seem to rotate the source images to correctly
> align with lat/lon lines, it doesnt seem to distort the image into the
> trapezoid shape.
> If I load the image that was georeferenced through gdal_translate into
> Global Mapper it does appear properly (ie trapezoidal), and can be saved
> back to disk in that 'warped' form, but I'm really hoping to be able to do
> this through fw_tools/gdal.
> Am I missing something obvious or is this not possible with gdal_warp?
> Thanks!
> Jeff
> _______________________________________________
> FWTools mailing list
> FWTools at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/fwtools
> http://fwtools.maptools.org/

More information about the FWTools mailing list