[gdal-dev] GDALSuggestedWarpOutput() problem

Joe Marrero manvscode at gmail.com
Thu Dec 11 09:06:10 PST 2014


Thank you for your response Even.

Unfortunately when I split the chart down the 180 degree longitude line,
GDALSuggestedWarpOutput() still produces smaller chart dimensions than the
dimensions of the inputs.  I think this would rule out any wrapping problem
because the split pieces exhibited the same behavior despite never crossing
the dateline.

I am going to try and step through the GDALSuggestedWarpOutput() function
and examine it's logic more closely.

-- Joe




On Wed, Dec 10, 2014 at 5:01 AM, Even Rouault <even.rouault at spatialys.com>
wrote:

> "joem",
>
> It seems that your input dataset is very close to the dateline, and very
> likely crossing it. I'm not that surprised that GDALSuggestedWarpOutput()
> has
> issues at that discontinuity. But I think it might have indeed operated
> correctly. If the extent of the dataset crosses the dateline the resulting
> eastings in Web Mercator coordinates will go from about -20 million to
> about
> 20 million. A huge width. GDALSuggestedWarpOutput() tries to scale the
> computed dimensions so that the result has roughly the same number of
> pixels
> as the input. So the huge width becomes a reasonable width, and the
> reasonable
> height becomes a small height.
> In that situation, you could try using modified input and output proj.4
> strings
> by adding +over to the normal proj.4 definition. See
> https://trac.osgeo.org/proj/wiki/GenParms
> This should produce an output datasets with eastings that go beyond the 20
> million limit. You might want to cut it into 2 parts afterwards.
>
> Best regards,
>
> Even
>
> >
> >
> > I am working on a tool to project FAA charts from Lambert Conformal Conic
> > to Web Mercator (EPSG 900913).  It seems to be producing correct output
> > except for a FAA chart of the East Aleutian Islands.    When I traced the
> > problem in my code, it appears that GDALSuggestedWarpOutput() is giving
> me
> > a width and height far too small given the input tiff had larger
> > dimensions.  The source GeoTiff has dimensions of 15555x5786 but
> > GDALSuggestedWarpOutput() gives a suggested width of 17050  and a height
> > of 178.  A height of 178 pixels surely has to be wrong.    I have added
> > the well-known text and proj.4  output from gdalinfo.exe of the input
> tiff
> > below.   Although I am not entirely sure if I should, I have been using
> > the values supplied by GDALSuggestedWarpOutput() for creating my output
> > Geotiff as if the output will always be valid.
> >
> > * Why is GDALSuggestedWarpOutput() giving bad values for the width and
> > height of the output tiff?
> > * Is this incorrect usage of GDALSuggestedWarpOutput() or is it a bug?
> >
> >
> > PROJ.4 : '+proj=lcc +lat_1=54.66666666666666 +lat_2=49.33333333333334
> > +lat_0=52.16666666666666 +lon_0=-177.5 +x_0=0 +y_0=0 +datum=NAD83
> +units=m
> > +no_defs '
> >
> > OGC WKT :
> > PROJCS["unnamed",
> >     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",54.66666666666666],
> >     PARAMETER["standard_parallel_2",49.33333333333334],
> >     PARAMETER["latitude_of_origin",52.16666666666666],
> >     PARAMETER["central_meridian",-177.5],
> >     PARAMETER["false_easting",0],
> >     PARAMETER["false_northing",0],
> >     UNIT["metre",1,
> >         AUTHORITY["EPSG","9001"]]]
> >
> >
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20141211/f0eccd8d/attachment-0001.html>


More information about the gdal-dev mailing list